mdBook can be used either as a command line tool or a Rust crate. Let's focus on the command line tool capabilities first.
Precompiled binaries are provided for major platforms on a best-effort basis. Visit the releases page to download the appropriate version for your platform.
mdBook can also be installed by compiling the source code on your local machine.
Installing mdBook is relatively easy if you already have Rust and Cargo installed. You just have to type this snippet in your terminal:
cargo install mdbook
This will fetch the source code for the latest release from
Crates.io and compile it. You will have to add Cargo's
bin directory to your
mdbook help in your terminal to verify if it works. Congratulations, you
have installed mdBook!
The git version contains all the latest bug-fixes and features, that will be released in the next version on Crates.io, if you can't wait until the next release. You can build the git version yourself. Open your terminal and navigate to the directory of you choice. We need to clone the git repository and then build it with Cargo.
git clone --depth=1 https://github.com/rust-lang/mdBook.git cd mdBook cargo build --release
mdbook will be in the
./target/release folder, this should be
added to the path.