Closed monajalal closed 1 month ago
Heya, have you tried doing it in a restructuredtext file? from a first look this does not appear to be an issue with myst-parser, and should be raised in https://github.com/mgaitan/sphinxcontrib-mermaid
FYI though I don't think you need to indent the mermaid syntax:
```{mermaid}
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
Heya, have you tried doing it in a restructuredtext file? from a first look this does not appear to be an issue with myst-parser, and should be raised in https://github.com/mgaitan/sphinxcontrib-mermaid
FYI though I don't think you need to indent the mermaid syntax:
```{mermaid} graph TD; A-->B; A-->C; B-->D; C-->D;
I specifically want the mermaid chart to be inside the .md file. The extension I linked in OP shows it should be possible.
I specifically want the mermaid chart to be inside the .md file.
yes but... thus far, there is nothing to suggest this is a bug with myst-parser or anything that can be fixed here, its more likely a bug in https://github.com/mgaitan/sphinxcontrib-mermaid
if it was shown that exactly the same thing works correctly within a restructuredtext file, then ok, thats more evidence that perhaps there is a fault in myst-parser.
I'd also note that previously I had a mermaid graph example in the documentation for this repo, but removed it due to this issue: https://github.com/mgaitan/sphinxcontrib-mermaid/issues/109, which infuriatingly after 1.5 years is still not fixed. If they fix that, I would add an example back into the docs 😅
I was not able to reproduce this using the given example or any variation on its whitespace. My guess as to what appears to be happening based on the output image (if it is MyST Parser) is that the graph's content is somehow getting recognized as a Markdown code block, which can be specified in Markdown by indenting.
The versions I'm using are:
docutils 0.20.1
sphinx 7.4.7
myst_parser 2.0.0
sphinxcontrib-mermaid 0.9.2
@monajalal can you please provide a full file example?
I will investigate if this could be a regression in 3.0.1 shortly, but I doubt it.
Is the problem about the presence or lack of braces {}
as discussed in:
GitHub seems to need no braces and sphinxcontrib-mermaid appears to need the braces.
Fixed by adding myst_fence_as_directive = ["mermaid"]
to conf.py
as discussed at
What version of
myst-parser
are you using?$ pip show myst-parser Name: myst-parser Version: 3.0.1 Summary: An extended CommonMark compliant parser, Home-page: Author: Author-email: Chris Sewell chrisj_sewell@hotmail.com License: Location: /home/mona/anaconda3/lib/python3.9/site-packages Requires: docutils, jinja2, markdown-it-py, mdit-py-plugins, pyyaml, sphinx Required-by:
What version dependencies are you using?
sphinxcontrib-mermaid
What operating system are you using?
Ubuntu 22.04
Describe the Bug
I am using
https://github.com/mgaitan/sphinxcontrib-mermaid
and when I do
make html
this is what I get.