aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/_default/_markup/render-codeblock-mathml.html
blob: f6e5b61bf405621a4434f1fccae843ba3c3c672a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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>