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

Feature request: mermaid diagram rendering in markup files #846

Open
zippocage opened this issue Jun 27, 2023 · 0 comments
Open

Feature request: mermaid diagram rendering in markup files #846

zippocage opened this issue Jun 27, 2023 · 0 comments

Comments

@zippocage
Copy link

zippocage commented Jun 27, 2023

It is great to have markup support in the documentation. There are more and more places where markup files with inline Mermaid diagrams can be rendered directly. Is this something possible to support?

This is how Github handles mermaid inline in markdown files:
https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/#how-it-works

If the generation of markup to HTML can be configured then there is a way (without any server side involvement) to get browsers to render the diagram from the digram code:

<!DOCTYPE html>
<html lang="en">
  <body>
    <pre class="mermaid">
  graph LR
      A --- B
      B-->C[fa:fa-ban forbidden]
      B-->D(fa:fa-spinner);
    </pre>
    <script type="module">
      import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
    </script>
  </body>
</html>

And just for the fun of it, here is the diagram rendered by GitHub itself:

  graph LR
      A --- B
      B-->C[fa:fa-ban forbidden]
      B-->D(fa:fa-spinner);

Loading
@zippocage zippocage changed the title Support for rendering mermaid diagrams in markup files? Feature request: mermaid diagram rendering in markup files Jul 3, 2023
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

1 participant