mirror of
https://github.com/rust-lang/mdBook.git
synced 2025-12-27 07:54:20 -05:00
mdbook-compare
This is a simple utility to compare the output of two different versions of mdbook.
To use this:
- Install
tidy. - Install or build the initial version of mdbook that you want to compare.
- Install or build the new version of mdbook that you want to compare.
- Run
mdbook-comparewith the arguments to the mdbook executables and the books to build.
cargo run --manifest-path /path/to/mdBook/Cargo.toml -p mdbook-compare -- \
/path/to/orig/mdbook /path/to/my-book /path/to/new/mdbook /path/to/my-book
It takes two separate paths for the book to use for "before" and "after" in case you need to customize the book to run on older versions. If you don't need that, then you can use the same directory for both the before and after.
mdbook-compare will do the following:
- Clean up any book directories.
- Build the book with the first mdbook.
- Build the book with the second mdbook.
- The output of those two commands are stored in directories called
compare1andcompare2. - The HTML in those directories is normalized using
tidy. - Runs
git diffto compare the output.