From ced88ff53e58667dcc0a1d6bc7c6460e60a80e92 Mon Sep 17 00:00:00 2001 From: Lokathor Date: Sun, 30 Jun 2019 16:47:28 -0600 Subject: [PATCH] Better explain how to use `mdbook` --- README.md | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 1973ee1..1e9dac9 100644 --- a/README.md +++ b/README.md @@ -29,34 +29,24 @@ Building the Nomicon requires [mdBook]. To get it: $ cargo install mdbook ``` -### Building +### `mdbook` usage -To build the Nomicon: +To build the Nomicon use the `build` sub-command: ```bash $ mdbook build ``` -The output will be in the `book` subdirectory. To check it out, open it in -your web browser. +The output will be placed in the `book` subdirectory. To check it out, open the +`index.html` file in your web browser. You can pass the `--open` flag to `mdbook +build` and it'll open the index page (if the process is successful) just like with +`cargo doc --open`: -_Firefox:_ ```bash -$ firefox book/index.html # Linux -$ open -a "Firefox" book/index.html # OS X -$ Start-Process "firefox.exe" .\book\index.html # Windows (PowerShell) -$ start firefox.exe .\book\index.html # Windows (Cmd) +$ mdbook build --open ``` -_Chrome:_ -```bash -$ google-chrome book/index.html # Linux -$ open -a "Google Chrome" book/index.html # OS X -$ Start-Process "chrome.exe" .\book\index.html # Windows (PowerShell) -$ start chrome.exe .\book\index.html # Windows (Cmd) -``` - -To run the tests: +There is also a `test` sub-command to test all code samples contained in the book: ```bash $ mdbook test