# mdBook — Create Books from Markdown Like Gitbook in Rust > mdBook creates online books from Markdown files, similar to Gitbook but implemented in Rust. Used for the official Rust Book, Cargo Book, Tokio Tutorial, and many open-source documentation sites. Fast builds and a clean default theme. ## Install Save the content below to `.claude/skills/` or append to your `CLAUDE.md`: ## Quick Use ```bash cargo install mdbook mdbook init my-book cd my-book mdbook serve # Dev server at :3000 mdbook build # Build to book/ ``` Directory structure: ``` my-book/ ├── book.toml └── src/ ├── SUMMARY.md ├── chapter_1.md └── chapter_2/ ├── section_1.md └── section_2.md ``` `src/SUMMARY.md`: ```markdown # Summary - [Introduction](./chapter_1.md) - [Getting Started](./chapter_2/section_1.md) - [Installation](./chapter_2/section_2.md) ``` ## Intro mdBook is a command-line tool and Rust library to create online books from Markdown files. Similar to Gitbook but implemented in Rust — fast, single binary, no Node.js required. Used for the official Rust Book, Cargo Book, Tokio Tutorial, Bevy Book, and many Rust ecosystem docs. - **Repo**: https://github.com/rust-lang/mdBook - **Stars**: 21K+ - **Language**: Rust - **License**: MPL 2.0 ## What mdBook Does - **Markdown to HTML** — clean default theme - **SUMMARY.md** — table of contents as navigation - **Search** — full-text search built in - **Syntax highlighting** — for code blocks - **Preprocessors** — custom Markdown transforms - **Renderers** — HTML (default), PDF, EPUB via plugins - **Themes** — customizable CSS - **Link checking** — validate internal links - **Includes** — embed file contents with `{{#include}}` - **Rust code testing** — `mdbook test` runs Rust code examples ## Comparison | Tool | Language | Speed | Node.js | |---|---|---|---| | mdBook | Rust | Fast | No | | Gitbook | JS | Medium | Yes | | Docusaurus | JS | Medium | Yes | | VitePress | JS | Fast | Yes | | Sphinx | Python | Medium | No | ## FAQ **Q: Compared to VitePress?** A: mdBook is zero-dependency (single Rust binary); VitePress requires Node.js but supports Vue components and richer customization. Pick mdBook for pure docs and VitePress for interactive documentation. ## Sources - Docs: https://rust-lang.github.io/mdBook - GitHub: https://github.com/rust-lang/mdBook - License: MPL 2.0 --- Source: https://tokrepo.com/en/workflows/mdbook-create-books-markdown-like-gitbook-rust-ce6e1a98 Author: Script Depot