mdBook/book-example/src/cli
cetra3 bdb37ec117 Use relative links and translate internal references (#603)
* Relative links for 0.1.8

* Compat for IE11 search
2018-07-11 21:33:44 +08:00
..
README.md Add index preprocessor (#685) 2018-05-04 19:41:28 +08:00
build.md Update documentation to reflect addition of `clean` subcommand. (#607) 2018-02-18 15:04:04 +08:00
clean.md Update documentation to reflect addition of `clean` subcommand. (#607) 2018-02-18 15:04:04 +08:00
init.md Use relative links and translate internal references (#603) 2018-07-11 21:33:44 +08:00
serve.md Update documentation to reflect addition of `clean` subcommand. (#607) 2018-02-18 15:04:04 +08:00
test.md update example to encourage using book.toml 2016-12-23 08:17:04 +00:00
watch.md Update documentation to reflect addition of `clean` subcommand. (#607) 2018-02-18 15:04:04 +08: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

Pre-requisite

mdBook is written in Rust and therefore needs to be compiled with Cargo, because we don't yet offer ready-to-go binaries. 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 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-nursery/mdBook.git
cd mdBook
cargo build --release

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