Skip to content

Add guide book and deploy script for it#883

Merged
Martin1887 merged 7 commits intopulldown-cmark:masterfrom
notriddle:test-deploy
Jun 30, 2024
Merged

Add guide book and deploy script for it#883
Martin1887 merged 7 commits intopulldown-cmark:masterfrom
notriddle:test-deploy

Conversation

@notriddle
Copy link
Collaborator

@notriddle notriddle commented May 4, 2024

Fixes #863

You can see what it looks like at https://notriddle.github.io/pulldown-cmark/.

The final version would probably be at https://pulldown-cmark.github.io.

To make this work, you need to change the branch restrictions on deploying to github pages:

image

The action will then push a new version of the page whenever a release is made, or whenever a push is made to test-deploy.

@Martin1887
Copy link
Collaborator

I have to read it, but on a fast look it seems great, thanks!

@ehuss
Copy link
Contributor

ehuss commented May 6, 2024

You may also want to remove guide/deploy.rs.

@notriddle
Copy link
Collaborator Author

Good call.

@chriskrycho
Copy link

First of all, this is a fantastic addition! It would be awesome if shipping this kind of thing just became a normal part of libraries in the Rust community. 💙

Second, content structure suggestion: move the CommonMark spec. My recommendation would be to either put it as an appendix at the end, or remove the content entirely in favor of a link. If someone is just coming to the library for the first time and wants a quick guide, the spec is… quite the second page to get to. 😂 More than that, though, I think for most people, the spec is actually irrelevant, and just linking to the spec (maybe links to both the copy in the repo and the upstream?) would be more than sufficient. Thoughts?

@notriddle
Copy link
Collaborator Author

I think the specifications, in general, are "too much" for ordinary users, but there's still value in having them as an appendix for anyone that wants a more detailed understanding.

So, to make this work better, I've added a cheat sheet section as the new second page, and explicitly reorganized all the detailed specs into their own appendix.

@Martin1887
Copy link
Collaborator

Martin1887 commented May 25, 2024

I have just read it and I find it really good! The cheat sheet chapter is very useful for new users.

However, I miss an introduction chapter (maybe just importing the README and/or docs.rs main page despite repeating them?) and a chapter to include the examples of the examples directory of the repository.

Also, the Math spec is missing in this book, and it is maybe the most important one, but only because it was not merged yet in the branch in which you are working. It should be in the cheat sheet however, although it makes more sense adding it when the Math spec is integrated in the book.

Thanks!

@notriddle
Copy link
Collaborator Author

It's weird that I click the examples, but the Files browser doesn't include them...

https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc

@notriddle
Copy link
Collaborator Author

Anyway, @Martin1887

I've added an

  • introduction chapter (mostly copying the README)
  • the Math extension (rebased onto the current branch)
  • the example programs and API index of them (using rustdoc scraped examples)

@Martin1887
Copy link
Collaborator

Sorry for the delay, I'm been busy this week.

I see perfect the introduction and the introduction of the Math spec, but:

  • In the cheat sheet, I think Math mode should not be under GFM features because we use another spec.
  • The chapter 2 links seem to redirect to another subdomain, which feels weird and remove the mdBook theme (burning your eyes if you are using a dark theme 😜), could not the examples be transformed to mdBook chapters? For the API docs I think we can create a mini-chapter explaining that the API documentation is in docs.rs and indicating the link, so it is clear it is an external source.

Thanks!

@notriddle
Copy link
Collaborator Author

For the API docs I think we can create a mini-chapter explaining that the API documentation is in docs.rs and indicating the link, so it is clear it is an external source.

If we're going to link to docs.rs for the API docs, could we also link to there for the examples?

@Martin1887
Copy link
Collaborator

We could do it, but examples are not currently in docs.rs and it seems a bit weird placing them there, no?

I think the best place for examples is the book, but other alternatives could be also good.

@notriddle
Copy link
Collaborator Author

We could do it, but examples are not currently in docs.rs and it seems a bit weird placing them there, no?

The upshot is that it lets us use Rustdoc scraped examples to link these examples from the functions that use them.

@Martin1887
Copy link
Collaborator

Really interesting, I didn't know that. But this feature is not stable, could it be used in the official docs.rs documentation just publishing the crate as usual?

@notriddle
Copy link
Collaborator Author

I was planning to pin a specific nightly, so that we wouldn't have to worry about future changes breaking our docs without us doing anything.

If you really want to stick to using docs.rs as the main rustdoc host, then I'll move the examples into mdBook. Here's a new commit that includes the examples into mdBook instead of using rustdoc.

@Martin1887
Copy link
Collaborator

I think that it is better to use docs.rs for a more standard use of docs, we can use scraped examples when that feature become stable.

I think the last commits make this pull request perfect, thanks!

I will wait a bit to merge it in case someone else has any comments.

@Martin1887 Martin1887 merged commit 7a7a25e into pulldown-cmark:master Jun 30, 2024
@notriddle notriddle deleted the test-deploy branch June 30, 2024 14:50
@rhysd
Copy link
Contributor

rhysd commented Jul 4, 2024

@Martin1887 @notriddle

The deploy job seems to need fix: https://github.com/pulldown-cmark/pulldown-cmark/actions/workflows/pages/pages-build-deployment

  Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/style.scss':
                    No such file or directory @ dir_chdir - /github/workspace/docs

@ehuss
Copy link
Contributor

ehuss commented Jul 4, 2024

The workflow seems to be using very old versions of actions/upload-pages-artifact and actions/deploy-pages. I would suggest updating those to the latest.

@rhysd
Copy link
Contributor

rhysd commented Jul 4, 2024

I confirmed it was fixed after updating the actions. I created a PR #920.

@ollpu
Copy link
Collaborator

ollpu commented Aug 13, 2024

What's the status of this? https://pulldown-cmark.github.io/pulldown-cmark is currently giving 404.

What would be involved in changing the URL to https://pulldown-cmark.github.io/? I guess there needs to be a repo pulldown-cmark/pulldown-cmark.github.io in the org and then some (??) adjustments to the Actions workflow to get it deployed there.

@ollpu
Copy link
Collaborator

ollpu commented Aug 13, 2024

I tried pushing to test-deploy. It says this:

Error: Failed to create deployment (status: 404) with build version [..]. Request ID [..] Ensure GitHub Pages has been enabled: https://github.com/pulldown-cmark/pulldown-cmark/settings/pages

@Martin1887
Copy link
Collaborator

Martin1887 commented Aug 14, 2024

It is a bit weird, it was already configured but maybe it got reset after changing the version of the deployment module.

It is working again now. Thanks for reporting it.

@ollpu
Copy link
Collaborator

ollpu commented Aug 17, 2024

The release deployment is giving this error:

Tag "v0.12.0" is not allowed to deploy to github-pages due to environment protection rules.

which is apparently related to https://github.blog/changelog/2023-10-06-actions-secure-deployment-rollouts-to-protected-environments-based-on-select-tag-patterns/

@Martin1887
Copy link
Collaborator

The thing is that a new tag should not trigger a book deploy I think, but I don't see why it is triggered.

@rhysd
Copy link
Contributor

rhysd commented Aug 17, 2024

https://pulldown-cmark.github.io/pulldown-cmark/ looks working fine to me. What is the problem being discussed here?

Okay, I understood that the latest release didn't deploy the book properly. https://github.com/pulldown-cmark/pulldown-cmark/actions/workflows/book.yml

The thing is that a new tag should not trigger a book deploy I think, but I don't see why it is triggered.

Yes, it is triggered on release event, not tag or branch creation.

@rhysd
Copy link
Contributor

rhysd commented Aug 17, 2024

Since I don't have the permission, I can't ensure but I guess the setting on this repository is not correct. The steps are:

  1. Go to 'Settings' tab
  2. Select 'Environments' item in the menu
  3. Find 'Deployment branches and tags' section
  4. Click 'Add deployment branch or tag rule' link
  5. Select 'Ref type: Tag' in the pulldown menu
  6. Add a pattern matching to any release tags
image

@Martin1887
Copy link
Collaborator

I had only set test-deploy and gh-pages branches, a pattern for all v* tags is already set.

@rhysd
Copy link
Contributor

rhysd commented Aug 17, 2024

Hmm, v* should matches to v0.12.0 🤔

@rhysd
Copy link
Contributor

rhysd commented Aug 17, 2024

I'm not sure, but this discussion may be related to this issue: https://github.com/orgs/community/discussions/39054

We deploy the page on release event. And the event is raised on the default branch (if my understanding is correct). How about adding master to the allowed branches?

@Martin1887
Copy link
Collaborator

It works (I have just re-executed the last job), the problem was the v* tags were not allowed when the releases were created.

maxdeviant referenced this pull request in zed-industries/zed Sep 5, 2024
This PR upgrades `pulldown_cmark` to v0.12.

There were a few breaking changes that needed to be accounted for:

- The `BlockQuote` variant now has a `kind` attached. Right now we're
ignoring it.
- `pulldown_cmark` now emits tags for definition lists. This codepath
has been left unimplemented, for now.

### Release Notes

<details>
<summary>raphlinus/pulldown-cmark (pulldown-cmark)</summary>

###
[`v0.12.1`](https://redirect.github.com/pulldown-cmark/pulldown-cmark/releases/tag/v0.12.1):
0.12.1

[Compare
Source](https://redirect.github.com/raphlinus/pulldown-cmark/compare/v0.12.0...v0.12.1)

##### Security

- Fix O(n\*\*2) comment parser by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/941](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/941)

##### New features

- impl From<CowStr> for String by
[@&#8203;oconnor663](https://redirect.github.com/oconnor663) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/943](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/943)

##### Developers

- Make dos-fuzzer part of the workspace by
[@&#8203;kdarkhan](https://redirect.github.com/kdarkhan) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/945](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/945)

##### New Contributors

- [@&#8203;oconnor663](https://redirect.github.com/oconnor663) made
their first contribution in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/943](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/943)
- [@&#8203;kdarkhan](https://redirect.github.com/kdarkhan) made their
first contribution in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/945](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/945)

**Full Changelog**:
pulldown-cmark/pulldown-cmark@v0.12.0...v0.12.1

###
[`v0.12.0`](https://redirect.github.com/pulldown-cmark/pulldown-cmark/releases/tag/v0.12.0):
0.12.0

[Compare
Source](https://redirect.github.com/raphlinus/pulldown-cmark/compare/v0.11.3...v0.12.0)

Thanks to all contributors! This release mainly adds the long awaited
commonmark-hs description lists (under a flag) and enables the
blockquote kind in `TagEnd` reverted in 0.11.2.

#### Breaking changes

- feat: re-add kind for BlockQuote in TagEnd by
[@&#8203;Martin1887](https://redirect.github.com/Martin1887) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/940](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/940)
- Refactor TextMergeStream by
[@&#8203;ollpu](https://redirect.github.com/ollpu) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/931](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/931)

#### New features

- Implement commonmark-hs compatible definition lists by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/915](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/915)

#### Other changes

- Rename superlinear time fuzzer to `dos-fuzzer` by
[@&#8203;ollpu](https://redirect.github.com/ollpu) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/938](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/938)

**Full Changelog**:
pulldown-cmark/pulldown-cmark@v0.11.2...v0.12.0

###
[`v0.11.3`](https://redirect.github.com/pulldown-cmark/pulldown-cmark/releases/tag/v0.11.3):
0.11.3

[Compare
Source](https://redirect.github.com/raphlinus/pulldown-cmark/compare/v0.11.2...v0.11.3)

#### Security

- Fix O(n\*\*2) comment parser by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/944](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/944)

**Full Changelog**:
pulldown-cmark/pulldown-cmark@v0.11.2...v0.11.3

###
[`v0.11.2`](https://redirect.github.com/pulldown-cmark/pulldown-cmark/releases/tag/v0.11.2)

[Compare
Source](https://redirect.github.com/raphlinus/pulldown-cmark/compare/v0.11.1...v0.11.2)

Revert BlockQuote kind to avoid breaking change.

###
[`v0.11.1`](https://redirect.github.com/pulldown-cmark/pulldown-cmark/releases/tag/v0.11.1)

[Compare
Source](https://redirect.github.com/raphlinus/pulldown-cmark/compare/v0.11.0...v0.11.1)

Thanks to all people involved in this release! The main change of this
release is the reduction of the MSRV to 1.71.1, but it also includes a
lot of bug fixes and a new mdBook for user-friendly documentation.

#### Breaking changes

- Add BlockQuoteKind to BlockQuote TagEnd by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/926](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/926)
(reverted in v0.11.2)

#### What's Changed

- fix: CowStr deserialization when escaping by
[@&#8203;aatifsyed](https://redirect.github.com/aatifsyed) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/895](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/895)
- fix(test): fix generating spec tests doesn't work on Windows due to
line-endings by [@&#8203;rhysd](https://redirect.github.com/rhysd) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/903](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/903)
- feat: add `-G` CLI option to enable GFM support by
[@&#8203;rhysd](https://redirect.github.com/rhysd) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/905](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/905)
- feat: set `DefaultBrokenLinkCallback` as the default broken link
callback of `OffsetIter` by
[@&#8203;rhysd](https://redirect.github.com/rhysd) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/901](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/901)
- chore(doc): use `cargo add` to instruct how to install this crate as
dependency by [@&#8203;rhysd](https://redirect.github.com/rhysd) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/904](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/904)
- fix typo by [@&#8203;jmbhughes](https://redirect.github.com/jmbhughes)
in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/909](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/909)
- Fix parsing blocks inside alert body by
[@&#8203;rhysd](https://redirect.github.com/rhysd) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/908](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/908)
- fuzz: fix building fuzzer and improve fuzzing coverage by enabling
more parse options by [@&#8203;rhysd](https://redirect.github.com/rhysd)
in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/910](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/910)
- fix: fix warnings reported from nightly rustc by
[@&#8203;rhysd](https://redirect.github.com/rhysd) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/911](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/911)
- fix: fix infinite loop when metadata delimiter is indented by
[@&#8203;rhysd](https://redirect.github.com/rhysd) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/913](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/913)
- Raise the link cutoff from 5 to 32 by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/917](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/917)
- Reduce MSRV to 1.71.1 by separating benchmarks into a new crate with
CI enhancements by [@&#8203;rhysd](https://redirect.github.com/rhysd) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/916](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/916)
- Add guide book and deploy script for it by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/883](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/883)
- ci: fix deploying the document to GitHub Pages and make the deploy job
faster by [@&#8203;rhysd](https://redirect.github.com/rhysd) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/920](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/920)
- Fix lone task list item bug by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/924](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/924)
- Fix offset range around footnotes that look like images by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/925](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/925)
- Update old footnote format to interrupt paragraph by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/928](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/928)
- Fix confusing bug with back-to-back footnotes by
[@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/930](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/930)
- Add reproduction cases for
[#&#8203;927](https://redirect.github.com/raphlinus/pulldown-cmark/issues/927)
by [@&#8203;zoni](https://redirect.github.com/zoni) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/929](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/929)
- Add regression test for
[#&#8203;655](https://redirect.github.com/raphlinus/pulldown-cmark/issues/655)
by [@&#8203;ollpu](https://redirect.github.com/ollpu) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/932](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/932)
- Renovate the superlinear time fuzzer by
[@&#8203;ollpu](https://redirect.github.com/ollpu) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/935](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/935)

#### New Contributors

- [@&#8203;aatifsyed](https://redirect.github.com/aatifsyed) made their
first contribution in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/895](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/895)
- [@&#8203;jmbhughes](https://redirect.github.com/jmbhughes) made their
first contribution in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/909](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/909)
- [@&#8203;zoni](https://redirect.github.com/zoni) made their first
contribution in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/929](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/929)

**Full Changelog**:
pulldown-cmark/pulldown-cmark@v0.11.0...v0.11.1

###
[`v0.11.0`](https://redirect.github.com/pulldown-cmark/pulldown-cmark/releases/tag/v0.11.0):
0.11.0

[Compare
Source](https://redirect.github.com/raphlinus/pulldown-cmark/compare/v0.10.3...v0.11.0)

##### Finally, the so long awaited math mode is here! Enable the option
to use it.

This release also includes other improvements and bugfixes, please see
the changelog below for more details. Thanks to all contributors that
has made possible this release!

#### Breaking changes

- Change `write_to_html` to allow `fmt::Write` by
[@&#8203;stepantubanov](https://redirect.github.com/stepantubanov) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/870](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/870)

#### New features

-   Math mode

#### Bugfixes

- \[0.11] Don't exit `scan_attribute` with the ix pointing at block
quote by [@&#8203;notriddle](https://redirect.github.com/notriddle) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/873](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/873)
- (Re)introduce simd feature to pulldown-cmark-escape by
[@&#8203;ollpu](https://redirect.github.com/ollpu) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/880](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/880)
- fix: remove unnecessary end_newline set by
[@&#8203;tomcur](https://redirect.github.com/tomcur) in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/885](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/885)

#### New Contributors

- [@&#8203;duskmoon314](https://redirect.github.com/duskmoon314) made
their first contribution in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/874](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/874)
- [@&#8203;stepantubanov](https://redirect.github.com/stepantubanov)
made their first contribution in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/870](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/870)
- [@&#8203;tomcur](https://redirect.github.com/tomcur) made their first
contribution in
[https://github.com/pulldown-cmark/pulldown-cmark/pull/885](https://redirect.github.com/pulldown-cmark/pulldown-cmark/pull/885)

**Full Changelog**:
pulldown-cmark/pulldown-cmark@v0.10.3...v0.11.0

</details>

Release Notes:

- N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pulldown-cmark mdBook

6 participants