-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2fdce2e
commit 20c6bad
Showing
9 changed files
with
1,717 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.language-mermaid + button { | ||
display: none !important; | ||
} | ||
|
||
.language-mermaid, .mermaid { | ||
text-align: center; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
|
||
{{- $result := transform.HighlightCodeBlock . -}} | ||
|
||
<div> | ||
{{- $result.Wrapped | safeHTML -}} | ||
</div> | ||
|
||
{{- .Page.Store.Set "hasMermaid" true -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{{/* mermaid form css */}} | ||
|
||
{{- if or (.Page.Store.Get "hasMermaid") (.HasShortcode "mermaid") -}} | ||
<style> | ||
{{- with resources.Get "css/mermaid/mermaid_tweak.css" | toCSS | minify -}} | ||
{{- .Content | safeCSS -}} | ||
{{- end -}} | ||
</style> | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{{- if or (.Page.Store.Get "hasMermaid") (.HasShortcode "mermaid") -}} | ||
|
||
{{- $mermaid_license_body := "/*\nSPDX-License-Identifier: MIT\nLicensed under the MIT license.\nhttps://github.com/mermaid-js/mermaid/blob/develop/LICENSE\nhttps://opensource.org/license/mit/\n*/\n" -}} | ||
{{- $mermaid_license_js := $mermaid_license_body | resources.FromString "js/mermaid_license.js" -}} | ||
|
||
{{- with (slice $mermaid_license_js (resources.Get "js/mermaid.min.js")) | resources.Concat "assets/js/mermaid.min.js" | fingerprint -}} | ||
<script | ||
defer | ||
crossorigin="anonymous" | ||
type="module" | ||
src="{{- .RelPermalink -}}" | ||
integrity="{{- .Data.Integrity -}}" | ||
></script> | ||
{{- end -}} | ||
|
||
<script> | ||
document.addEventListener("DOMContentLoaded", async function() { | ||
mermaid.initialize({ startOnLoad: false }) | ||
await mermaid.run({ | ||
querySelector: ".language-mermaid, .mermaid", | ||
suppressErrors: true, | ||
}); | ||
document.querySelectorAll(".language-mermaid").forEach(function(e) { | ||
e.style.cssText += "background: none !important;" | ||
}) | ||
}) | ||
</script> | ||
|
||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{{- if eq (.Get 0) "display" -}} | ||
<p class="katex_sc" data-katex="\displaystyle {{ trim .Inner "\n\r" -}}">{{- trim .Inner "\n\r" -}}</p> | ||
<p class="katex_sc" data-katex="\displaystyle {{ trim .Inner "\n\r" | safeHTMLAttr -}}">{{- trim .Inner "\n\r" | safeHTML -}}</p> | ||
{{- else if eq (.Get 0) "inline" -}} | ||
<span class="katex_sc" data-katex="{{- trim .Inner "\n\r" -}}">{{- trim .Inner "\n\r" -}}</span> | ||
<span class="katex_sc" data-katex="{{- trim .Inner "\n\r" | safeHTMLAttr -}}">{{- trim .Inner "\n\r" | safeHTML -}}</span> | ||
{{- else -}} | ||
<p class="katex_sc" data-katex="\displaystyle {{ trim .Inner "\n\r" -}}">{{- trim .Inner "\n\r" -}}</p> | ||
<p class="katex_sc" data-katex="\displaystyle {{ trim .Inner "\n\r" | safeHTMLAttr -}}">{{- trim .Inner "\n\r" | safeHTML -}}</p> | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<p class="mermaid"> | ||
{{ .Inner | safeHTML }} | ||
</p> |