Skip to content

Commit 52cc9d7

Browse files
Merge pull request #14 from ISISComputingGroup/add_mermaid_extension_to_sphinx
Add mermaid extension to sphinx
2 parents 05089af + f8c16f6 commit 52cc9d7

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

doc/Editing-the-Wiki.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,42 @@ 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+
121+
will render as:
122+
```{mermaid}
123+
---
124+
title: Simple sample
125+
---
126+
stateDiagram-v2
127+
[*] --> Document
128+
Document --> Develop_software
129+
Develop_software --> Document
130+
Develop_software --> Test_software
131+
Test_software --> Crash
132+
Crash --> Develop_software
133+
Test_software --> [*]
134+
```
135+
136+
137+
The Mermaid syntax is documented [here](https://mermaid.js.org/intro/syntax-reference.html).
138+
103139
## Spellchecking
104140

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

doc/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@
4141
"sphinx.ext.viewcode",
4242
# Redirects
4343
"sphinx_reredirects",
44+
# Mermaid diagrams
45+
"sphinxcontrib.mermaid",
4446
]
47+
mermaid_d3_zoom = True
4548
napoleon_google_docstring = True
4649
napoleon_numpy_docstring = False
4750

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)