Mermaid graphs support for sphinx generated documentations.
- GitHub repository at Doreapp/sphinx-mermaid
- Pypi package sphinx-mermaid
- Example of usage: GitHub pages of this repo
pip install sphinx-mermaid
In the conf.py
file of your documentation, add the extension:
extensions = [
...,
'sphinxmermaid'
]
sphinxmermaid_mermaid_init
can be set as a dictionary of values.
These will be passed to mermaid.initialize()
. Find more info at
MermaidJS
Example:
sphinxmermaid_mermaid_init = {
'theme': 'base',
'themeVariables': {
'primaryColor': '#BB2528',
'primaryTextColor': '#fff',
'primaryBorderColor': '#7C0000',
'lineColor': '#F8B229',
'secondaryColor': '#006100',
'tertiaryColor': '#fff'
}
}
In your rst
(or md
) files, use the directive just like:
.. mermaid ::
graph TD
A --> B
B -- Label --> C