diff --git a/doc/Editing-the-Wiki.md b/doc/Editing-the-Wiki.md index 9e159b181..345ffddd5 100644 --- a/doc/Editing-the-Wiki.md +++ b/doc/Editing-the-Wiki.md @@ -100,6 +100,42 @@ You can then add the image in markdown using the URL `test.png`: ![alternative text](test.png) +## Mermaid Diagrams +Mermaid diagrams can be added using the following syntax (example): +```` +```{mermaid} +--- +title: Simple sample +--- +stateDiagram-v2 + [*] --> Document + Develop_software --> Document + Document --> Develop_software + Develop_software --> Test_software + Test_software --> Crash + Crash --> Develop_software + Test_software --> [*] +``` +```` + +will render as: +```{mermaid} +--- +title: Simple sample +--- +stateDiagram-v2 + [*] --> Document + Document --> Develop_software + Develop_software --> Document + Develop_software --> Test_software + Test_software --> Crash + Crash --> Develop_software + Test_software --> [*] +``` + + +The Mermaid syntax is documented [here](https://mermaid.js.org/intro/syntax-reference.html). + ## Spellchecking The wiki has a built-in spellchecker, which will automatically run when a commit diff --git a/doc/conf.py b/doc/conf.py index 14a46339d..a3c856cfd 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -41,7 +41,10 @@ "sphinx.ext.viewcode", # Redirects "sphinx_reredirects", + # Mermaid diagrams + "sphinxcontrib.mermaid", ] +mermaid_d3_zoom = True napoleon_google_docstring = True napoleon_numpy_docstring = False diff --git a/pyproject.toml b/pyproject.toml index 2af204be2..35f6443af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,6 +32,7 @@ dependencies = [ "sphinxcontrib-spelling", "sphinx-reredirects", "pytest", + "sphinxcontrib-mermaid" ] [project.optional-dependencies]