File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 1
1
{{ $file := .Get 0 }}
2
2
{{ $params := .Get 1 }}
3
+ {{ $codeBlockId := printf "id-%x" (now.UnixNano) }}
3
4
{{ with resources.GetRemote $file }}
4
5
{{ with .Err }}
5
6
{{ errorf "%s" . }}
6
7
{{ else }}
7
8
{{ $lang := path.Ext $file | strings.TrimPrefix "." }}
8
- {{ highlight .Content $lang $params }}
9
+ < div id ="code-block-v1 " data-mf ="false ">
10
+ {{ highlight .Content $lang $params }}
11
+ </ div >
12
+
13
+ < div class ="code-block " data-mf ="true " style ="display: none; ">
14
+ {{- if and (ne $lang "") (ne $lang "none") -}}
15
+ < span class ="code-type chroma "> {{ $lang }}</ span >
16
+ {{- end -}}
17
+ < div class ="code-container chroma ">
18
+ < button onclick ="copyToClipBoard(this, {{ $codeBlockId }}) " class ="code-copy-button multi-line " type ="button "> Copy</ button >
19
+ < div class ="highlight-v2 " id ="{{ $codeBlockId }} ">
20
+ {{ highlight .Content $lang $params }}
21
+ </ div >
22
+ </ div >
23
+ </ div >
9
24
{{ end }}
10
25
{{ else }}
11
26
{{ errorf "Unable to load github content from %s from %q" $file .Position}}
You can’t perform that action at this time.
0 commit comments