mdBook is a Rust-based command line tool that helps create books with Markdown and Rust. With the mdBook tool, You can create a product, API documentation, tutorials, course materials, or anything. You can easily deploy various platforms like GitHub pages, etc.
mdBook comes with two types of installation options available. 1.Install with Pre-compiled binaries 2. Build from source using cargo
It is a very complicated and time-consuming step for beginners, and I do not recommend it.
The recommended way to install the mdbook CLI tool in your system with cargo CLI. Cargo is a cli tool provided by Rust foundation. It helps to create a new project, run the code, etc. But with cargo, Now you can install and build a Rust binary from to source and download it on the Default location is $HOME/.cargo/bin.
You do not need to add the mdbook binary PATH manually into bashrc. The cargo automatically does it, and you can run the mdbook cli anywhere in the machine.
cargo install mdbook
Command out put look like
mdbook init my-first-book
The folder Output is look.
tree
.
├── book
├── book.toml
└── src
├── chapter_1.md
└── SUMMARY.md
2 directories, 3 files
book.toml
file contain all the configuration related to the book.src
folder contains all your markdown files.book
folder contains production built.mdbook is a specific design for rust developers, and you do not need to learn any frontend framework for designing and building documents. With mdbook, you can easily write a document with Markdown and the functionality like search, navbar, code highlighting, pagination, etc., provided by mdbook.