diff options
author | tdro <tdro@noreply.example.com> | 2023-10-17 18:54:19 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2023-10-17 18:54:19 -0400 |
commit | e55fd333c9d1afabf5a4818eaf925cf31f677975 (patch) | |
tree | eaa48b023731e83f2aeb70e21fd9a154ad2ecb37 /themes/default/layouts/_default | |
parent | ddcd558c253e2cc350f495fff734c9b5112082ee (diff) | |
download | canory-e55fd333c9d1afabf5a4818eaf925cf31f677975.tar.gz canory-e55fd333c9d1afabf5a4818eaf925cf31f677975.tar.bz2 canory-e55fd333c9d1afabf5a4818eaf925cf31f677975.zip |
themes/default/layouts/_default/_markup: Support MathML
Diffstat (limited to 'themes/default/layouts/_default')
-rw-r--r-- | themes/default/layouts/_default/_markup/render-codeblock-mathml.html | 18 |
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..62ce0e8 --- /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> |