blob: 6f3e357681b5bf572731515ed4d0dbb00fe1bdcd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
{{- $lang := .Type -}}
{{- $hasLang := gt (len $lang) 0 -}}
{{- $highlightLang := $lang -}}
{{- if not $hasLang -}}{{- $highlightLang = "text" -}}{{- end -}}
{{- $opts := dict "lineNos" true "lineNumbersInTable" true -}}
<div class="code-block-wrapper not-prose">
{{- if $hasLang -}}
<div class="code-header" data-lang="{{ $lang }}">
<span class="code-lang-label">{{ $lang }}</span>
<div class="code-copy-wrapper">
<span role="status" aria-live="polite" class="sr-only code-copy-status"></span>
<button class="code-copy-btn" aria-label="Copy code" data-copy-target>
<i data-feather="copy" class="icon-copy" aria-hidden="true"></i>
<i data-feather="check" class="icon-check hidden" aria-hidden="true"></i>
</button>
</div>
</div>
{{- end -}}
<div class="code-body">
{{- highlight .Inner $highlightLang $opts -}}
</div>
</div>
|