Make the shortcodes HTML-specific

This commit is contained in:
2020-02-23 20:24:40 -08:00
parent ee90351c17
commit 7ff919c31b
9 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
{{ $s := (readFile (printf "code/%s" (.Get 1))) }}
{{ $t := split $s "\n" }}
{{ if not (eq (int (.Get 2)) 1) }}
{{ .Scratch.Set "u" (after (sub (int (.Get 2)) 1) $t) }}
{{ else }}
{{ .Scratch.Set "u" $t }}
{{ end }}
{{ $v := first (add (sub (int (.Get 3)) (int (.Get 2))) 1) (.Scratch.Get "u") }}
{{ highlight (delimit $v "\n") (.Get 0) "" }}