Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mdbook-mermaid

An mdbook preprocessor that renders Mermaid diagrams to inline SVG at build time.

Features

  • Inline SVG — diagrams are rendered during build, no JavaScript required at runtime
  • 5 mdbook themes — generates a variant for each theme (Light, Navy, Coal, Ayu, Rust) with automatic switching via CSS
  • Pure Rust — uses mermaid-rs-renderer for rendering

Installation

cargo install mdbook-mermaid

Configuration

Add the preprocessor to your book.toml:

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

Usage

Write Mermaid diagrams in fenced code blocks:

```mermaid
graph LR
  A[Start] --> B[End]
```

The preprocessor replaces each block with inline SVG wrapped in theme-specific <div> elements. The correct variant is shown automatically based on the active mdbook theme.

License

MIT

About

mdbook preprocessor that renders mermaid diagrams to inline SVG

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages