diff options
author | Jan-Erik Rediger <janerik@fnordig.de> | 2019-07-10 21:32:34 +0200 |
---|---|---|
committer | Jan-Erik Rediger <janerik@fnordig.de> | 2019-07-10 21:35:46 +0200 |
commit | bd5e53feb854e000785ce6675ec546d5e8f9656e (patch) | |
tree | d2da9c1d2c0822b1c4546d29e01212f5d6c1085d | |
parent | 52c71ad04c2ed00dddc3c04b7a08a4a3d70cbe2c (diff) |
Prepare for a release
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Cargo.toml | 4 | ||||
-rw-r--r-- | README.md | 42 |
3 files changed, 11 insertions, 37 deletions
@@ -1,2 +1,2 @@ +/book /target -**/*.rs.bk @@ -2,6 +2,10 @@ name = "mdbook-mermaid" version = "0.1.0" authors = ["Jan-Erik Rediger <janerik@fnordig.de>"] +description = "mdbook preprocessor to add mermaid support" +license = "MPL-2.0" +homepage = "https://github.com/badboy/mdbook-mermaid" +repository = "https://github.com/badboy/mdbook-mermaid" [dependencies] mdbook = "0.3.0" @@ -29,12 +29,16 @@ in your book. If you want to use only this preprocessor, install the tool: ``` -cargo install --git https://github.com/badboy/mdbook-mermaid +cargo install mdbook-mermaid ``` Add the following to your `book.toml` ```toml +[preprocessor.toc] +command = "mdbook-mermaid" +renderer = ["html"] + [output.html] additional-css = ["mermaid.css"] additional-js = ["mermaid.min.js", "mermaid-init.js"] @@ -45,43 +49,9 @@ Copy the files (`mermaid.css`, `mermaid.min.js`, `mermaid-init.js`) from the [`a Finally, build your book: ``` -mdbook-mermaid path/to/book -``` - -### Programmatic use - -You can also use this programmatically, e.g. in order to use multiple additional preprocessors. -Add `mdbook-mermaid` as a dependency in your `Cargo.toml`: - -```toml -[dependencies.mdbook-mermaid] -git = "https://github.com/badboy/mdbook-mermaid" -``` - -Then add it to your code: - -```rust -extern crate mdbook_mermaid; - -// ... - -let mut book = MDBook::load(&book_dir)?; -book.with_preprecessor(mdbook_mermaid::Mermaid); -``` - -Don't forget to copy the files (`mermaid.css`, `mermaid.min.js`, `mermaid-init.js`) from the [`assets/`] (assets) directory into your source directory. - -Add the following to your `book.toml` to include these files in your build: - -```toml -[output.html] -additional-css = ["mermaid.css"] -additional-js = ["mermaid.min.js", "mermaid-init.js"] +mdbook path/to/book ``` - - - ## License MPL. See [LICENSE](LICENSE). |