mdBook/guide/src/cli
Eldred Habert 89a2e39b80
Mention missing file creation in build/watch/serve's docs (#1548)
Fixes #1246
2021-05-25 13:45:30 +02:00
..
README.md Fix sentence on installation page. 2021-01-15 07:50:06 -08:00
build.md Mention missing file creation in build/watch/serve's docs (#1548) 2021-05-25 13:45:30 +02:00
clean.md Rename `book-example` to `guide` (#1336) 2020-09-23 03:16:09 +02:00
init.md Update init.md 2021-05-05 12:06:56 +02:00
serve.md Mention missing file creation in build/watch/serve's docs (#1548) 2021-05-25 13:45:30 +02:00
test.md Rename `book-example` to `guide` (#1336) 2020-09-23 03:16:09 +02:00
watch.md Mention missing file creation in build/watch/serve's docs (#1548) 2021-05-25 13:45:30 +02:00

README.md

Command Line Tool

mdBook can be used either as a command line tool or a Rust crate. Let's focus on the command line tool capabilities first.

Install From Binaries

Precompiled binaries are provided for major platforms on a best-effort basis. Visit the releases page to download the appropriate version for your platform.

Install From Source

mdBook can also be installed by compiling the source code on your local machine.

Pre-requisite

mdBook is written in Rust and therefore needs to be compiled with Cargo. If you haven't already installed Rust, please go ahead and install it now.

Install Crates.io version

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 PATH.

Run mdbook help in your terminal to verify if it works. Congratulations, you have installed mdBook!

Install Git version

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

The executable mdbook will be in the ./target/release folder, this should be added to the path.