Merge pull request #26 from simon-siggaard/main
add support for Mermaid diagrams
This commit is contained in:
commit
4fe47ad315
4
layouts/_default/_markup/render-codeblock-mermaid.html
Normal file
4
layouts/_default/_markup/render-codeblock-mermaid.html
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<pre class="mermaid">
|
||||||
|
{{- .Inner | safeHTML }}
|
||||||
|
</pre>
|
||||||
|
{{ .Page.Store.Set "hasMermaid" true }}
|
@ -70,6 +70,14 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{ if .Store.Get "hasMermaid" }}
|
||||||
|
<script type="module">
|
||||||
|
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
|
||||||
|
mermaid.initialize({ startOnLoad: true });
|
||||||
|
</script>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
{{/* Next prev controls */}}
|
{{/* Next prev controls */}}
|
||||||
|
|
||||||
{{ if not (.Param "hidePagination") }}
|
{{ if not (.Param "hidePagination") }}
|
||||||
@ -88,4 +96,4 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
Loading…
Reference in New Issue
Block a user