简体   繁体   English

可以有狮身人面像 MyST 渲染美人鱼

[英]It is possible to have sphinx MyST rendering mermaid

It is possible to make work mermaid inside \.md file with MyST md driver?可以使用 MyST md 驱动程序在\.md文件中制作工作美人鱼吗?

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 :下面是用recommonmark呈现的:

```mermaid::

  graph LR
    a --> b
```

but not with MyST-parser但不是MyST-parser

I have open this issue in MyST: https://github.com/executablebooks/MyST-Parser/issues/366我在 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注意: recommonmark不能正确呈现表格,这就是我尝试使用MyST-parser的原因

mermaid is prefectly integrated to MyST-parser . mermaidMyST-parser完美集成。

You only need to call it like that with {mermaid} :你只需要用{mermaid}来这样称呼它:

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

No need to define in conf.py a def setup(app): only:无需在conf.py中定义def setup(app):仅:

extensions = ['myst_parser', 'sphinxcontrib.mermaid']

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM