Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable myst-parser mermaid rendering without curly braces in markdown #99

Closed
d33bs opened this issue Dec 12, 2022 · 8 comments
Closed

Comments

@d33bs
Copy link

d33bs commented Dec 12, 2022

Thank you for the great work within this project! In working with mermaid diagrams through this extension and myst-parser within markdown files I've noticed a minor detail which might assist developers as they draft or review content.

When using this extension via myst-parser in markdown files, one is required to use the following format:

```{mermaid}
<diagram content>
```

Some editors and interfaces, such as Github (see here), enable the rendering of mermaid without building it Sphinx. This format relies on a similar codeblock that does not use curly braces, as seen below:

```mermaid
<diagram content>
```

Using a format which does not rely on curly braces would allow developers referencing mermaid content on platforms like Github to easily view both the rendered output and the code which rendered the output. Is this something which is possible through additional configuration or code with this extension? Thank you in advance for your thoughts and feedback on this topic.

Please note: I was unsure whether it'd be more appropriate to open an issue here or with the myst-parser project. Please don't hesitate to let me know if I may reference this topic elsewhere, or upvote an existing issue, thank you!

@bilderbuchi
Copy link

bilderbuchi commented Feb 2, 2023

I agree, this would indeed be useful to have! It would make collaborating and reviewing/discussing PRs much more streamlined if the mermaid diagrams were rendered in the PR files/diff view, and I think using the brace-less syntax should achieve that. Right now we can either open parallel issues where we copy/paste diagrams, or render the whole documentation and inspect that.

@bilderbuchi
Copy link

See also executablebooks/MyST-Parser#366 (comment)

@ggydush
Copy link

ggydush commented Feb 17, 2023

+1 to this feature, would be a great improvement!

@vppillai
Copy link

+1 to this feature.

@dustinlagoy
Copy link

Note executablebooks/MyST-Parser#366 has been fixed by executablebooks/MyST-Parser#742 which I believe also fixes this issue.

kdeldycke added a commit to kdeldycke/click-extra that referenced this issue Mar 28, 2023
@rjohnkraemer
Copy link

rjohnkraemer commented Apr 11, 2024

+1 to this, would also like to see

::: mermaid
<diagram content>
:::

@timkpaine
Copy link
Collaborator

timkpaine commented Sep 10, 2024

The original ask can be done with myst_fence_as_directive = ["mermaid"]

https://github.com/python-project-templates/yardang/blob/ac6c1df992d56296d2f6fe375a04fcb81f5f7ed6/yardang/conf.py.j2#L78

xref: executablebooks/MyST-Parser#959

@timkpaine
Copy link
Collaborator

closing as won't fix since the above works

@timkpaine timkpaine closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants