Upgrade crates to support mdBook 0.5 breaking changes#652
Upgrade crates to support mdBook 0.5 breaking changes#652avivace merged 6 commits intogbdev:masterfrom
Conversation
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.
| 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 | ||
| }; |
There was a problem hiding this comment.
@ISSOtm if you have a way of verifying this "out of repo" flag is still doing what we intend, I'd appreciate the help!
230c08d to
f805992
Compare
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.
|
@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 yes, those links are failing even on the main CI , probably the github ip is getting blocked |
|
@avivace do you want me to skip external links? It's a feature directly built into |
|
In any case, linkcheck2 should not fail when there are errors, according to what |
|
@avivace Please do not merge non-trivial PRs unilaterally. |

This PR specifically does the following:
multilingualattrbitue frombook.toml. This was never really used and was removed as part of 0.5:preproccrate now depend onmdbook-preprocessor. As part of 0.5 the mdbook crate was broken down into components.PreProcessortrait slightly changed. Thesupports_renderfunction now returns aResult<bool>instead of merely abool: Addoptionalfield for preprocessors rust-lang/mdBook#2797get_preprocessorwas removed, so I had to usegetinstead: Remove toml as a public dependency rust-lang/mdBook#2773renderercrate now depend onmdbook-rendererandmdbook-html. This one is mostly just updatingusenames.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_repofunctionality. I wasn't really following what that flag is for, but I believe I'm still correctly reading it from the config.Closes #641