mdbook-pele
mdBook preprocessor that renders Mermaid diagrams with Pele.
Pele is a fast, small (~230 kB gzipped), zero-dependency Mermaid → SVG renderer that themes via CSS variables. It supports every diagram type in Mermaid 12.1.0 and is used by Obsidian.
Why Pele?
Compared to the classic mdbook-mermaid (client-side mermaid.js):
| Pele | mermaid.js | |
|---|---|---|
| Bundle size (gzip) | ~230 kB | ~1.6 MB |
| Render time | 0.05–0.3 ms | 6–82 ms |
| Dependencies | 0 | 23 |
| Theming | CSS variables | theme config |
| Responsive layout | adapts layout | scales |
Quick example
flowchart TD
A[Mermaid text] --> B{Flowchart?}
B -- Yes --> C[Pele]
B -- No --> D[Mermaid]
C --> E([SVG])
D --> E
What’s in this book
- Getting Started — installing the preprocessor and setting it up in a book
- Usage — writing diagrams, and what the preprocessor does to your Markdown
- Theming — how diagrams follow mdBook themes, and how to customize them
- Supported Diagram Types — every diagram type Pele can render
- Troubleshooting — common problems and fixes