blog-static/themes/vanilla/layouts/shortcodes/codelines

6 lines
210 B
Plaintext

{{ $s := (readFile (printf "code/%s" (.Get 1))) }}
{{ $t := split $s "\n" }}
{{ $u := after (.Get 2) $t }}
{{ $v := first (sub (int (.Get 3)) (int (.Get 2))) $u }}
{{ highlight (delimit $v "\n") (.Get 0) "" }}