support mermaid
See original GitHub issueDescribe the solution you’d like
support mermaid
Describe alternatives you’ve considered
The conf.py I used to make work mermaid
with recommonmark
:
$ tail conf.py
extensions = [ 'recommonmark', 'sphinxcontrib.mermaid']
from recommonmark.transform import AutoStructify
def setup(app):
app.add_transform(AutoStructify)
$
This mermaid is rendered
```mermaid::
graph LR
a --> b
\```
Note that the above need to have a new line after mermaid::
and graph
need to start with a space.
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Include diagrams in your Markdown files with Mermaid
A picture tells a thousand words. Now you can quickly create and edit diagrams in markdown using words with Mermaid support in your...
Read more >Mermaid | Diagramming and charting tool
JavaScript based diagramming and charting tool that renders Markdown-inspired text definitions to create and modify diagrams dynamically. Get Started · View on ...
Read more >Mermaid diagrams can be displayed within Markdown #372
Today, we're excited to add native support for Mermaid wherever Markdown is supported (e.g., issues, repositories, discussions, gists). Intended ...
Read more >GitHub Writer now available with Mermaid support - CKEditor
GitHub has recently introduced Mermaid support. Mermaid is a flowchart and visualization tool that relies on the Markdown language.
Read more >Markdown Preview Mermaid Support
Extension for Visual Studio Code - Adds Mermaid diagram and flowchart support to VS Code's builtin markdown preview.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just to add a bit of context which may be helpful. Mermaid itself already has directives that are relevant for rendering a figure. Those are already passed through to e.g.
mmdc
and sphinxcontrib-mermaid, for example. sphinxcontrib-mermaid supports a few extra parameters for it’s directive.I’d like to request that mermaid-tagged fenced code blocks, specifically, and possibly others down the road, be treated as directives instead of languages.
You could do so here, by detecting “special” languages that should be interpreted as directives instead of languages to highlight.
https://github.com/executablebooks/MyST-Parser/blob/310580730652f3b84da3868f2a886ef9fc743959/myst_parser/mdit_to_docutils/base.py#L596-L603
A hacky version I did was able to deal with this:
It works now on GitHub as well: https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/
Here an example:
It produces: