Skip to content

Commit

Permalink
feat: add mermaid
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Aug 9, 2022
1 parent 14cf661 commit 2979d61
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Mudkip enables the following Sphinx extensions:
- [`sphinx.ext.githubpages`](https://www.sphinx-doc.org/en/master/usage/extensions/githubpages.html) when deploying to GitHub Pages
- [`myst_parser`](https://myst-parser.readthedocs.io/en/latest/) for markdown support
- [`myst_nb`](https://myst-nb.readthedocs.io/en/latest/) for Jupyter notebook support
- [`sphinxcontrib.mermaid`](https://github.com/mgaitan/sphinxcontrib-mermaid) for [Mermaid](https://mermaid-js.github.io/mermaid/) graphs and flowcharts

## Installation

Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ A friendly Sphinx wrapper.
:hidden:
notebook_example
mermaid_example
changelog
```

Expand Down
23 changes: 23 additions & 0 deletions docs/mermaid_example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Mermaid example

```{mermaid}
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```

```{mermaid}
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts <br/>prevail!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
```
2 changes: 2 additions & 0 deletions mudkip/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ def create_sphinx_application(self):
"intersphinx_mapping", {"python": ("https://docs.python.org/3", None)}
)

extensions.append("sphinxcontrib.mermaid")

extensions.append("mudkip.extension")

self.sphinx = Sphinx(
Expand Down
11 changes: 10 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jupyter-nbextensions-configurator = "^0.5.0"
colorama = {version = "*", markers = 'sys_platform == "win32"'}
myst-nb = "^0.16.0"
furo = "^2022.6.21"
sphinxcontrib-mermaid = "^0.7.1"

[tool.poetry.dev-dependencies]
black = "^22.6.0"
Expand Down

0 comments on commit 2979d61

Please sign in to comment.