#mdbook #preprocessor #mermaid

bin+lib mdbook-mermaid

mdbook preprocessor to add mermaid support

18 unstable releases (6 breaking)

0.8.3 Jun 11, 2021
0.8.1 Apr 6, 2021
0.8.0 Feb 9, 2021
0.6.1 Sep 28, 2020
0.2.2 Jul 16, 2019
Download history 298/week @ 2021-07-03 315/week @ 2021-07-10 368/week @ 2021-07-17 427/week @ 2021-07-24 373/week @ 2021-07-31 278/week @ 2021-08-07 251/week @ 2021-08-14 392/week @ 2021-08-21 358/week @ 2021-08-28 423/week @ 2021-09-04 404/week @ 2021-09-11 363/week @ 2021-09-18 389/week @ 2021-09-25 341/week @ 2021-10-02 361/week @ 2021-10-09 227/week @ 2021-10-16

1,391 downloads per month
Used in mdbook-dtmo

MPL-2.0 license

1MB
436 lines

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

~10MB
~198K SLoC

RN`