added mermaid samples to demo document

This commit is contained in:
zadam
2021-09-30 13:17:37 +02:00
parent a68fd5ab83
commit 291b434d70
5 changed files with 15 additions and 34 deletions

View File

@@ -94,6 +94,11 @@ async function getRenderedContent(note, options = {}) {
.css("display", "flex")
.css("justify-content", "space-around");
const documentStyle = window.getComputedStyle(document.documentElement);
const mermaidTheme = documentStyle.getPropertyValue('--mermaid-theme');
mermaid.mermaidAPI.initialize({ startOnLoad: false, theme: mermaidTheme.trim() });
try {
mermaid.mermaidAPI.render("in-mermaid-graph-" + idCounter++, content,
content => $renderedContent.append($(content)));