Skip to content

Upgrade crates to support mdBook 0.5 breaking changes#652

Merged
avivace merged 6 commits intogbdev:masterfrom
mtthgn:mdbook-upgrade
Mar 26, 2026
Merged

Upgrade crates to support mdBook 0.5 breaking changes#652
avivace merged 6 commits intogbdev:masterfrom
mtthgn:mdbook-upgrade

Conversation

@mtthgn
Copy link
Copy Markdown
Contributor

@mtthgn mtthgn commented Mar 26, 2026

This PR specifically does the following:

  1. It removes the multilingual attrbitue from book.toml. This was never really used and was removed as part of 0.5:
  2. It makes the preproc crate now depend on mdbook-preprocessor. As part of 0.5 the mdbook crate was broken down into components.
  3. It makes the renderer crate now depend on mdbook-renderer and mdbook-html. This one is mostly just updating use names.

I tested this with both docker and locally installing everything and was able to get the docs rendering on localhost with both development approaches. Things seemed to look right to me, but an extra set of eyes would be helpful.

I'd also appreciate confirmation I didn't break expectations with the out_of_repo functionality. I wasn't really following what that flag is for, but I believe I'm still correctly reading it from the config.

Closes #641

mtthgn added 2 commits March 25, 2026 22:36
This field was removed in mdbook 0.5.0-alpha.1 because it was never
actually in use: rust-lang/mdBook#2775
As of mdbook 0.5, preprocessor functionality and renderer functionality
have been broken up into separate crates. This commit refactors those
features to use the appropriate crates.
Comment on lines +103 to +109
let out_of_repo = match ctx.config.get::<bool>("preprocessor.pandocs.out-of-repo") {
Ok(boolean) => match boolean {
Some(b) => b,
None => false
},
Err(_) => false
};
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ISSOtm if you have a way of verifying this "out of repo" flag is still doing what we intend, I'd appreciate the help!

@mtthgn mtthgn force-pushed the mdbook-upgrade branch 2 times, most recently from 230c08d to f805992 Compare March 26, 2026 12:02
mdBook was still referring to 0.4.x versions in the github workflow, and
mdbook-linkcheck has not been updated to support 0.5. This commit
switches the repo to using "mdbook-linkcheck2", which is a fork that's
been properly updated.

mdbook-linkcheck2 does not have any releases associated with the repo,
which meant I had to switch installation methods. As such, I moved
towards a (hopefully) straightforward `cargo install` approach.
@mtthgn
Copy link
Copy Markdown
Contributor Author

mtthgn commented Mar 26, 2026

@avivace I've got the github workflow to a state where the builds are properly running. With regard to the link checks, I'm noticing that things are failing due to a number of 403 response codes.

I've manually verified all the links work. What I believe is happening is that sites are correctly identified the workflow as bot traffic and rejecting the requests. In my opinion, we should only use the link checker for ensuring links are correct for links navigating the pandoc itself, and not bother with external traffic. The idea of making sure we don't have dead links is nice, but due to the state of the world these days, websites actively prevent exactly this kind of traffic.

@mtthgn mtthgn requested a review from avivace March 26, 2026 16:04
@avivace
Copy link
Copy Markdown
Member

avivace commented Mar 26, 2026

@mtthgn yes, those links are failing even on the main CI , probably the github ip is getting blocked

@mtthgn
Copy link
Copy Markdown
Contributor Author

mtthgn commented Mar 26, 2026

@avivace do you want me to skip external links? It's a feature directly built into mdbook-linkcheck, so it's just changing one more line in the book.toml file.

@avivace
Copy link
Copy Markdown
Member

avivace commented Mar 26, 2026

In any case, linkcheck2 should not fail when there are errors, according to what warning-policy should do.. I've opened marxin/mdbook-linkcheck2#9

Copy link
Copy Markdown
Member

@avivace avivace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @mtthgn - Export looks ok to me! Only small things remaining is the one page export which is still carrying the 'title' of the single.md page we replace at the bottom.

@avivace avivace merged commit 4058013 into gbdev:master Mar 26, 2026
3 checks passed
@avivace
Copy link
Copy Markdown
Member

avivace commented Mar 26, 2026

image

@ISSOtm
Copy link
Copy Markdown
Member

ISSOtm commented Mar 27, 2026

@avivace Please do not merge non-trivial PRs unilaterally.

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.

Upgrade to mdbook 0.5.x

3 participants