Allow hiding code in code blocks
This commit is contained in:
parent
9b9a6dca5f
commit
9c9ced66c3
|
@ -13,7 +13,17 @@
|
|||
{{ .Scratch.Set "opts" "" }}
|
||||
{{ end }}
|
||||
|
||||
{{ if (.Get 5) }}
|
||||
{{ .Scratch.Set "hidden" (.Get 5) }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "geturl.html" (dict "scratch" .Scratch "path" (.Get 1) "siteSourceUrl" .Site.Params.siteSourceUrl "submoduleLinks" .Site.Params.submoduleLinks) }}
|
||||
{{ partial "linerangestr.html" (dict "scratch" .Scratch "from" (.Get 2) "to" (.Get 3)) }}
|
||||
|
||||
{{ with (.Scratch.Get "hidden") }}
|
||||
<details><summary>{{ . | markdownify }}</summary>
|
||||
{{ end }}
|
||||
{{ partial "highlightgroup.html" (dict "url" (.Scratch.Get "bestUrl") "path" (.Get 1) "comment" (.Scratch.Get "comment") "code" (delimit $lines "\n") "language" (.Get 0) "opts" (printf "linenos=table,linenostart=%d%s" (.Get 2) (.Scratch.Get "opts"))) }}
|
||||
{{ with (.Scratch.Get "hidden") }}
|
||||
</details>
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in New Issue
Block a user