add support for mermaid diagrams (#17213)

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De loof 2023-05-02 10:58:56 +02:00 committed by GitHub
parent 4d4a7352d1
commit 6e3509f682
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -76,6 +76,8 @@
{%- endif -%} {%- endif -%}
{%- include analytics/feedback.html -%} {%- include analytics/feedback.html -%}
{% include mermaid.html %}
{%- comment -%} {%- comment -%}
preload fonts: https://www.freecodecamp.org/news/web-fonts-in-2018-f191a48367e8/ preload fonts: https://www.freecodecamp.org/news/web-fonts-in-2018-f191a48367e8/
we only preload the "woff2" variants, as older formats (woff, eot) are only used we only preload the "woff2" variants, as older formats (woff, eot) are only used

7
_includes/mermaid.html Normal file
View File

@ -0,0 +1,7 @@
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: false });
await mermaid.run({
querySelector: '.language-mermaid',
});
</script>