Linux command
mdbook 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Create
mdbook init
Example
mdbook init [path/to/directory]
Clean
mdbook clean
Serve
mdbook serve
Watch
mdbook watch
说明
mdbook creates online books by writing Markdown files. Developed by the Rust community, it compiles a collection of Markdown files into a static website with navigation, search, and theming support. A typical mdbook project contains a SUMMARY.md file that defines the book's structure and chapter organization. The tool processes these files and generates HTML, with support for code syntax highlighting, MathJax equations, and custom themes. The serve command is particularly useful during writing, providing a local development server that automatically rebuilds and refreshes the browser when files change.
参数
- init
- Create a new mdbook project with default structure
- build
- Build the book from Markdown sources
- serve
- Start a local web server with live reload
- watch
- Rebuild automatically when source files change
- clean
- Remove the generated book output directory
- test
- Test Rust code samples in the book
FAQ
What is the mdbook command used for?
mdbook creates online books by writing Markdown files. Developed by the Rust community, it compiles a collection of Markdown files into a static website with navigation, search, and theming support. A typical mdbook project contains a SUMMARY.md file that defines the book's structure and chapter organization. The tool processes these files and generates HTML, with support for code syntax highlighting, MathJax equations, and custom themes. The serve command is particularly useful during writing, providing a local development server that automatically rebuilds and refreshes the browser when files change.
How do I run a basic mdbook example?
Run `mdbook init` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does init do in mdbook?
Create a new mdbook project with default structure