Skip to content

How to render MermaidJS code in an HTML file? #5977

Discussion options

You must be logged in to vote

https://github.com/orgs/mermaid-js/discussions/5977#discussioncomment-10982775

Indeed, http://mermaid.js.org/intro/getting-started.html#requirements-for-the-mermaid-api worked:

  1. <html>
      <body>
        Here is one mermaid diagram:
        <pre class="mermaid">
                graph TD
                A[Client] --> B[Load Balancer]
                B --> C[Server1]
                B --> D[Server2]
        </pre>
    
        And here is another:
        <pre class="mermaid">
                graph TD
                A[Client] -->|tcp_123| B
                B(Load Balancer)
                B -->|tcp_456| C[Server1]
                B -->|tcp_456| D[Server2]
        </pre>
    
        <script type="module">
          import mermaid from 'https://cdn.jsdelivr.net/n…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@RokeJulianLockhart
Comment options

Answer selected by RokeJulianLockhart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant