feat: support mermaid codeblocks (#485)
This commit is contained in:
parent
53ab130467
commit
12c81554ac
6 changed files with 48 additions and 3 deletions
11
layouts/_default/_markup/render-codeblock-mermaid.html
Normal file
11
layouts/_default/_markup/render-codeblock-mermaid.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
<!-- prettier-ignore-start -->
|
||||
{{ if not (.Page.Scratch.Get "mermaid") }}
|
||||
<!-- Include mermaid only first time -->
|
||||
<script defer src="{{ index (index .Site.Data.assets "mermaid.js") "src" | relURL }}"></script>
|
||||
{{ .Page.Scratch.Set "mermaid" true }}
|
||||
{{ end }}
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
<pre class="gdoc-mermaid mermaid">
|
||||
{{- .Inner -}}
|
||||
</pre>
|
Loading…
Add table
Add a link
Reference in a new issue