2020-12-09 21:42:46 +03:00
|
|
|
<!--
|
|
|
|
mermaid-js loader
|
|
|
|
-->
|
2021-01-23 10:07:18 +03:00
|
|
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js"></script>
|
2020-12-09 21:42:46 +03:00
|
|
|
<script>
|
2020-12-10 14:49:43 +03:00
|
|
|
$(function() {
|
|
|
|
let initTheme = "default";
|
2020-12-09 21:42:46 +03:00
|
|
|
|
2020-12-10 14:49:43 +03:00
|
|
|
if ($("html[mode=dark]").length > 0
|
|
|
|
|| ($("html[mode]").length == 0
|
|
|
|
&& window.matchMedia("(prefers-color-scheme: dark)").matches ) ) {
|
|
|
|
initTheme = "dark";
|
|
|
|
}
|
2020-12-09 21:42:46 +03:00
|
|
|
|
2020-12-10 14:49:43 +03:00
|
|
|
let mermaidConf = {
|
|
|
|
theme: initTheme /* <default|dark|forest|neutral> */
|
|
|
|
};
|
2020-12-09 21:42:46 +03:00
|
|
|
|
2020-12-10 14:49:43 +03:00
|
|
|
/* Markdown converts to HTML */
|
|
|
|
$("pre").has("code.language-mermaid").each(function() {
|
|
|
|
let svgCode = $(this).children().html();
|
|
|
|
$(this).addClass("unloaded");
|
|
|
|
$(this).after(`<div class=\"mermaid\">${svgCode}</div>`);
|
|
|
|
});
|
2020-12-09 21:42:46 +03:00
|
|
|
|
2020-12-10 14:49:43 +03:00
|
|
|
mermaid.initialize(mermaidConf);
|
|
|
|
});
|
2020-12-09 21:42:46 +03:00
|
|
|
</script>
|