mdbook/crates/mdbook-core
Eric Huss 30d3aeb691 Remove non_exhaustive from Book
This removes the `non_exhaustive` attribute from the `Book` and its
inner types `BookItem` and `Chapter`. These were added in
https://github.com/rust-lang/mdBook/pull/2779. After thinking about it
more, I realized that these types cannot be extended in a
semver-compatible way, so I am fine with allowing them be exhaustive.

The problem is that with CmdPreprocessor, the `Book` will be
re-serialized by a preprocessor, which could potentially be on an older
version. Attempting to add any new fields/variants means that either the
deserialization will fail, or the new fields will be stripped by the
preprocessor.

These could potentially be structured such that they have a
`serde(flatten)` or Other/Unknown variant so that a preprocessor would
at least see the extra fields/variants and pass them along back to the
output. However, a preprocessor or renderer wouldn't know what to do
with those new fields/variants (particularly `BookItem`) which would
itself be a problem. It's still possible to do something like this in
the future, but for now I think it's fine to restrict these to
semver-major changes.
2025-08-29 18:24:44 -07:00
..
src Remove non_exhaustive from Book 2025-08-29 18:24:44 -07:00
Cargo.toml Remove pulldown-cmark from mdbook-core 2025-07-23 17:47:31 -07:00
README.md Add READMEs for all new crates 2025-07-23 17:47:31 -07:00

mdbook-core

Documentation crates.io Changelog

This is the base support library for mdBook. It is intended for internal use only. Other mdBook crates depend on this for any types that are shared across the crates.

This crate is maintained by the mdBook team, primarily for use by mdBook and not intended for external use (except as a transitive dependency). This crate may make major changes to its APIs or be deprecated without warning.

License

Mozilla Public License, version 2.0