-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: Support rendering of Mermaid.js diagrams, à la Graphviz diagrams
Mermaid.js¹ supports a number of useful diagrams types that are otherwise difficult to create programmatically. The addition now is motivated by wanting to add some sequence diagrams for new authn documentation. The Sphinx/Mermaid integration, sphinxcontrib-mermaid, defaults to client-side rendering at page load time, but this comes with some downsides and practically no upsides. Configure it to render at doc build time instead. Related to this change, I submitted two patches upstream to the Sphinx integration which I think improve the build-time render results: a patch to remove unnecessary JS from the page by default² and a patch to display the SVGs as images rather than embedded documents.³ ¹ <https://mermaid.js.org> ² <mgaitan/sphinxcontrib-mermaid#132> ³ <mgaitan/sphinxcontrib-mermaid#131>
- Loading branch information
Showing
4 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ build: | |
os: ubuntu-20.04 | ||
tools: | ||
python: "3.10" | ||
nodejs: "16" | ||
sphinx: | ||
builder: dirhtml | ||
python: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
exec npx --package @mermaid-js/mermaid-cli -- mmdc "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters