#mdbook #mermaid

bin+lib mdbook-mermaid

mdbook preprocessor to add mermaid support

31 releases

0.13.0 Dec 13, 2023
0.12.6 Dec 19, 2022
0.12.2 Nov 29, 2022
0.11.2 Jul 29, 2022
0.2.2 Jul 16, 2019

#509 in Text processing

Download history 1027/week @ 2023-11-11 1104/week @ 2023-11-18 1255/week @ 2023-11-25 1299/week @ 2023-12-02 1222/week @ 2023-12-09 1609/week @ 2023-12-16 740/week @ 2023-12-23 1145/week @ 2023-12-30 1474/week @ 2024-01-06 1339/week @ 2024-01-13 1148/week @ 2024-01-20 1169/week @ 2024-01-27 1245/week @ 2024-02-03 1448/week @ 2024-02-10 2009/week @ 2024-02-17 1972/week @ 2024-02-24

6,896 downloads per month
Used in mdbook-dtmo

MPL-2.0 license

3MB
2K SLoC

JavaScript 1.5K SLoC // 0.0% comments Rust 483 SLoC

mdbook-mermaid

A preprocessor for mdbook to add mermaid.js support.

It turns this:

```mermaid
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
```

into this:

Simple Graph

in your book. (Graph provided by Mermaid Live Editor)

Installation

If you want to use only this preprocessor, install the tool:

cargo install mdbook-mermaid

Then let mdbook-mermaid add the required files and configuration:

mdbook-mermaid install path/to/your/book

This will add the following configuration to your book.toml:

[preprocessor.mermaid]
command = "mdbook-mermaid"

[output.html]
additional-js = ["mermaid.min.js", "mermaid-init.js"]

It will skip any unnecessary changes and detect if mdbook-mermaid was already configured.

Additionally it copies the files mermaid.min.js and mermaid-init.js into your book's directory. You find these files in the src/bin/assets directory. You can modify mermaid-init.js to configure Mermaid, see the Mermaid documentation for all options.

Finally, build your book:

mdbook path/to/book

License

MPL. See LICENSE.
Copyright (c) 2018-2021 Jan-Erik Rediger janerik@fnordig.de

Mermaid is MIT licensed. The bundled assets (mermaid.min.js) are MIT licensed.

Dependencies

~14–27MB
~379K SLoC