Skip to content
A fast, modern Sphinx theme with dark mode, full-text search, and Alpine.js interactivity. Star on GitHub ★

Mermaid Diagrams

sphinxcontrib-mermaid renders Mermaid diagrams directly in your docs. Lumina automatically adjusts diagram colors to match the current light/dark theme.

Setup

uv add sphinxcontrib-mermaid
conf.py
extensions = ["sphinxcontrib.mermaid"]

Dark Mode Support

Lumina handles Mermaid theme switching automatically — diagrams re-render when the reader toggles dark mode. No extra configuration needed.

Usage

Write diagrams with the mermaid directive:

```{mermaid}
graph LR
    A[Source] --> B[Build]
    B --> C[Deploy]
```

Result:

        graph LR
    A[Source] --> B[Build]
    B --> C[Deploy]
    

See also

Diagrams — flowcharts, sequence diagrams, class diagrams, Gantt charts, and more rendered examples.