Skip to content

Commit cc1f7bb

Browse files
Added Mermaid graphical markup extension to Sphinx
1 parent 05089af commit cc1f7bb

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

doc/Editing-the-Wiki.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,41 @@ You can then add the image in markdown using the URL `test.png`:
100100

101101
![alternative text](test.png)
102102

103+
## Mermaid Diagrams
104+
Mermaid diagrams can be added using the following syntax (example):
105+
```
106+
```{mermaid}
107+
---
108+
title: Simple sample
109+
---
110+
stateDiagram-v2
111+
[*] --> Document
112+
Develop_software --> Document
113+
Document --> Develop_software
114+
Develop_software --> Test_software
115+
Test_software --> Crash
116+
Crash --> Develop_software
117+
Test_software --> [*]
118+
```
119+
120+
will render as:
121+
```{mermaid}
122+
---
123+
title: Simple sample
124+
---
125+
stateDiagram-v2
126+
[*] --> Document
127+
Document --> Develop_software
128+
Develop_software --> Document
129+
Develop_software --> Test_software
130+
Test_software --> Crash
131+
Crash --> Develop_software
132+
Test_software --> [*]
133+
```
134+
135+
136+
The Mermaid syntax is documented [here](https://mermaid.js.org/intro/syntax-reference.html).
137+
103138
## Spellchecking
104139

105140
The wiki has a built-in spellchecker, which will automatically run when a commit

doc/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
"sphinx.ext.viewcode",
4242
# Redirects
4343
"sphinx_reredirects",
44+
# Mermaid diagrams
45+
"sphinxcontrib.mermaid",
46+
# Graphvis diagrams
47+
"sphinx.ext.graphviz",
4448
]
4549
napoleon_google_docstring = True
4650
napoleon_numpy_docstring = False

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ dependencies = [
3232
"sphinxcontrib-spelling",
3333
"sphinx-reredirects",
3434
"pytest",
35+
"sphinxcontrib-mermaid"
3536
]
3637

3738
[project.optional-dependencies]

0 commit comments

Comments
 (0)