{"componentChunkName":"component---src-templates-simple-markdown-js","path":"/developer-portal/mermaid/","matchPath":"","result":{"data":{"markdownRemark":{"html":"<h1 style=\"position:relative;\"><a href=\"#mermaid-diagrams\" aria-label=\"mermaid diagrams permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"mermaid-diagrams\"></div>Mermaid diagrams</h1>\n<p>You can insert <a href=\"https://mermaidjs.github.io/\">mermaid</a> charts and diagrams directly into markdown. This allows you to adhere to the docs-as-code philosophy. To insert a diagram, create a code block and specify the <code class=\"language-text\">mermaid</code> language.</p>\n<p>A <a href=\"https://mermaid.live/\">live mermaid diagram editor</a> can be helpful when writing diagrams.</p>\n<div class=\"admonition admonition-attention\"><div class=\"admonition-heading\"><h5><span class=\"admonition-icon\"><i></i></span>Dependencies</h5></div><div class=\"admonition-content\"><p>Mermaid requires heavy dependencies to render, so we offload that to a microservice we host in AWS.\nIf you do not want to send data to our microservice, do not use Mermaid diagrams.</p></div></div>\n<h2 style=\"position:relative;\"><a href=\"#an-example-of-a-flowchart\" aria-label=\"an example of a flowchart permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"an-example-of-a-flowchart\"></div>An example of a flowchart</h2>\n<p>To see the flowchart, you can paste this onto the Markdown page.</p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"3637980635994253300\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`\\\\`\\\\`\\\\`mermaid\ngraph LR\n    Install --> Markdown --> Paths --> Mermaid --> ?\n\\\\`\\\\`\\\\``, `3637980635994253300`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-3637980635994253300\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"md\"><pre class=\"language-md\"><code class=\"language-md\"><span class=\"token code\"><span class=\"token punctuation\">```</span><span class=\"token code-language\">mermaid</span>\n<span class=\"token code-block language-mermaid\">graph LR\n    Install --> Markdown --> Paths --> Mermaid --> ?</span>\n<span class=\"token punctuation\">```</span></span></code></pre></div>\n      </div>\n<h2 style=\"position:relative;\"><a href=\"#edit-the-flowchart\" aria-label=\"edit the flowchart permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"edit-the-flowchart\"></div>Edit the flowchart</h2>\n<p>This training course won't cover the mermaid library in much depth.</p>\n<p>We will replace the <code class=\"language-text\">?</code> in the flowchart with what's up next:</p>\n<ul>\n<li>\npage table of contents\n</li>\n</ul>\n<p>Try to edit this page and replace the <code class=\"language-text\">?</code> with <code class=\"language-text\">TOC</code>.</p>\n<p>Now, try to replace that with <code class=\"language-text\">Table of contents</code>.\nYou should see an error if you replaced it like this.</p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"12385796617204804000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`\\\\`\\\\`\\\\`mermaid\ngraph LR\n    Install --> Markdown --> Paths --> Mermaid --> Table of contents\n\\\\`\\\\`\\\\`\n\nError: Parse error on line 2: ...> Mermaid --> Table of contents -----------------------^ Expecting 'SEMI', 'NEWLINE', 'EOF', 'AMP', 'START_LINK', 'LINK', got 'ALPHA'`, `12385796617204804000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-12385796617204804000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"md\"><pre class=\"language-md\"><code class=\"language-md\"><span class=\"token code\"><span class=\"token punctuation\">```</span><span class=\"token code-language\">mermaid</span>\n<span class=\"token code-block language-mermaid\">graph LR\n    Install --> Markdown --> Paths --> Mermaid --> Table of contents</span>\n<span class=\"token punctuation\">```</span></span>\n\nError: Parse error on line 2: ...> Mermaid --> Table of contents -----------------------^ Expecting 'SEMI', 'NEWLINE', 'EOF', 'AMP', 'START_LINK', 'LINK', got 'ALPHA'</code></pre></div>\n      </div>\n<p>The space causes mermaid to error. Fix it using this escape technique.</p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"69676073115972930000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`\\\\`\\\\`\\\\`mermaid\ngraph LR\n    Install --> Markdown --> Paths --> Mermaid --> TOC[Table of contents]\n\\\\`\\\\`\\\\``, `69676073115972930000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-69676073115972930000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"md\"><pre class=\"language-md\"><code class=\"language-md\"><span class=\"token code\"><span class=\"token punctuation\">```</span><span class=\"token code-language\">mermaid</span>\n<span class=\"token code-block language-mermaid\">graph LR\n    Install --> Markdown --> Paths --> Mermaid --> TOC[Table of contents]</span>\n<span class=\"token punctuation\">```</span></span></code></pre></div>\n      </div>\n<h2 style=\"position:relative;\"><a href=\"#extra-credit\" aria-label=\"extra credit permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"extra-credit\"></div>Extra credit</h2>\n<p>You could spend a day trying all of the different kinds of mermaid diagrams.</p>\n<p>You could try to reproduce the diagram on Redocly's <a href=\"https://redocly.com/docs/\">docs homepage</a>.</p>","headings":[{"value":"Mermaid diagrams","depth":1},{"value":"An example of a flowchart","depth":2},{"value":"Edit the flowchart","depth":2},{"value":"Extra credit","depth":2}]},"contentItem":{"data":{"lastModified":"2023-03-21T02:46:22.000Z","enableToc":null,"disableLastModified":null,"tocMaxDepth":null,"requestLogin":false}},"siteConfig":{"enableToc":false,"disableLastModified":false,"tocMaxDepth":4}},"pageContext":{"matchPath":"","id":"9c6d38a3-058f-5a3f-9852-31040f0f3487__redocly content/developer-portal/mermaid/","seo":{"title":"Mermaid diagrams","description":null,"image":"","keywords":null,"jsonLd":null,"lang":null,"siteUrl":null},"pageId":"developer-portal/mermaid.md","pageBaseUrl":"/developer-portal/mermaid","type":"markdown","toc":{"enable":true,"maxDepth":4,"headings":[{"depth":1,"value":"Mermaid diagrams","id":"mermaid-diagrams"},{"depth":2,"value":"An example of a flowchart","id":"an-example-of-a-flowchart"},{"depth":2,"value":"Edit the flowchart","id":"edit-the-flowchart"},{"depth":2,"value":"Extra credit","id":"extra-credit"}]},"data":{"title":"Mermaid diagrams"},"catalogInfo":null,"link":"/developer-portal/mermaid/","sidebarName":"","isLanding":false,"showPrevButton":null,"showNextButton":null,"apiVersions":null,"apiVersionId":null,"isDefaultApiVersion":null}},"staticQueryHashes":["1123603147","1302185487","1344209882","1398840060","1520077861","1975142765","2667623876","2950305614","3240152602","3743992808","561138138"]}