#mdbook #mermaid #graph

bin+lib mdbook-mermaid

mdbook preprocessor to add mermaid support

30 releases

0.12.6 Dec 19, 2022
0.12.2 Nov 29, 2022
0.11.2 Jul 29, 2022
0.10.0 Feb 7, 2022
0.2.2 Jul 16, 2019

#248 in Text processing

Download history 617/week @ 2022-12-01 611/week @ 2022-12-08 671/week @ 2022-12-15 359/week @ 2022-12-22 330/week @ 2022-12-29 465/week @ 2023-01-05 423/week @ 2023-01-12 550/week @ 2023-01-19 561/week @ 2023-01-26 595/week @ 2023-02-02 867/week @ 2023-02-09 1081/week @ 2023-02-16 761/week @ 2023-02-23 731/week @ 2023-03-02 766/week @ 2023-03-09 651/week @ 2023-03-16

3,051 downloads per month
Used in mdbook-dtmo

MPL-2.0 license

1MB
1.5K SLoC

JavaScript 1K 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

~10–42MB
~728K SLoC