1

It is possible to make work mermaid inside \.md file with MyST md driver ?

For now the only way I found is

$ tail conf.py
extensions = [ 'recommonmark', 'sphinxcontrib.mermaid']
from recommonmark.transform import AutoStructify
def setup(app):
    app.add_transform(AutoStructify)
$

The below is rendered with recommonmark:

```mermaid::

  graph LR
    a --> b
```

but not with MyST-parser

I have open this issue in MyST: https://github.com/executablebooks/MyST-Parser/issues/366

Note: recommonmark does not render correctly tables that's why I try to use MyST-parser

user3313834
  • 5,701
  • 4
  • 40
  • 76
  • Notice that recommonmark is deprecated in favor of myst-parser https://github.com/readthedocs/recommonmark/issues/221 – astrojuanlu May 06 '21 at 19:39

1 Answers1

2

mermaid is prefectly integrated to MyST-parser.

You only need to call it like that with {mermaid}:

```{mermaid}
graph LR
  a --> b
```

No need to define in conf.py a def setup(app): only:

extensions = ['myst_parser', 'sphinxcontrib.mermaid']
AlexTorx
  • 473
  • 1
  • 6