aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/_default/_markup/render-codeblock-mathml.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/_default/_markup/render-codeblock-mathml.html')
-rw-r--r--themes/default/layouts/_default/_markup/render-codeblock-mathml.html18
1 files changed, 18 insertions, 0 deletions
diff --git a/themes/default/layouts/_default/_markup/render-codeblock-mathml.html b/themes/default/layouts/_default/_markup/render-codeblock-mathml.html
new file mode 100644
index 0000000..f6e5b61
--- /dev/null
+++ b/themes/default/layouts/_default/_markup/render-codeblock-mathml.html
@@ -0,0 +1,18 @@
+{{- $caption := default "Math Render" .Attributes.caption -}}
+{{- $ordinal := add .Ordinal 1 -}}
+{{- $hash := print (truncate 3 "" (sha256 .Inner)) (truncate 3 "" (sha256 .Page.RelPermalink)) "-" $ordinal -}}
+{{- $id := print "math:" $hash | safeURL -}}
+
+<math-ml>
+ <figure id="{{ $id }}">
+ <figure>
+ {{- with $math := .Inner -}}
+ {{- $math | safeHTML -}}
+ {{- end -}}
+ </figure>
+ <figcaption>
+ <a href="#{{ $id }}">({{ $ordinal }})</a>
+ {{ $caption | markdownify }}
+ </figcaption>
+ </figure>
+</math-ml>