Skip to content

Update to work with mdbook 0.5.x#196

Open
stevecheckoway wants to merge 1 commit intoavitex:masterfrom
stevecheckoway:update-mdbook-0.5
Open

Update to work with mdbook 0.5.x#196
stevecheckoway wants to merge 1 commit intoavitex:masterfrom
stevecheckoway:update-mdbook-0.5

Conversation

@stevecheckoway
Copy link
Copy Markdown

Use the new mdbook-preprocessor crate.

Fixes: #194.

Use the new `mdbook-preprocessor` crate.
Comment thread Cargo.toml
@@ -1,3 +1,3 @@
[package]
name = "mdbook-tera"
version = "0.6.0"
Copy link
Copy Markdown

@gpwclark gpwclark Feb 6, 2026

Choose a reason for hiding this comment

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

Suggested change
version = "0.6.1"

to the extent that semantic versioning is real, 0.6.1 ok?

because in our line of work you almost have to be more pedantic than a computer, which is just heartbreaking, semver.org
PATCH version when you make backward compatible bug fixes

(functionally just trying to get this to play nice with cargo toml/lock etc.)

and @stevecheckoway thank you so much!

Copy link
Copy Markdown
Author

@stevecheckoway stevecheckoway Feb 6, 2026

Choose a reason for hiding this comment

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

Changing the version certainly seems reasonable. I'm not sure how @avitex wants to handle versioning.

Annoyingly, the mdBook changes themselves are not backwards compatible. In particular, the JSON that is passed to the preprocessors changed format. Specifically, a field was renamed from sections to items and this breaks the parse_input() function. https://github.com/rust-lang/mdBook/blob/b8c90970a63966154b19b4c0a1e4d6ba52fe6375/crates/mdbook-preprocessor/src/lib.rs#L82

I don't know why mdBook didn't add an alias for sections when they renamed it but it means that preprocessors fail to parse the input before they even see the version number so they cannot even fail gracefully if the versions don't match.

I guess that since the version is less than 1.0.0, semver is fine with that breaking change.

My guess would be it would make sense to change the version of mdbook-tera to 0.7.0 so that people could use 0.6 to continue working with mdBook version 0.4.x.

@stevecheckoway
Copy link
Copy Markdown
Author

@avitex Gentle ping.

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.

v0.6.0_ Error when used with newer mdbook (e.g. v0.5.1)

2 participants