Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Getting Started

Installation

From source

cargo install --path .

From crates.io

cargo install mdbook-mermaid-mmdr

Make sure the installed binary is on your PATH.

Linux dependency

On Linux, the font/SVG rendering stack requires fontconfig development headers:

sudo apt-get install -y libfontconfig1-dev

Setup

Add the preprocessor to your book.toml:

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

The command field is optional if the binary is already in your PATH and named mdbook-mermaid-mmdr.

Writing Mermaid Diagrams

Use standard fenced code blocks with the mermaid language tag:

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

When you run mdbook build, the code block is replaced with an inline SVG.

Running the Examples

The repository includes example books under examples/:

ExampleDescription
simpleA minimal book with a single flowchart
comprehensiveAll supported diagram types and customization
themedCustom theme variables via book.toml

To build an example:

cargo build
cd examples/simple
mdbook build
open book/index.html