Add a way to put in sections of a file
This commit is contained in:
parent
38c703f581
commit
b36d1949de
5
themes/vanilla/layouts/shortcodes/codelines
Normal file
5
themes/vanilla/layouts/shortcodes/codelines
Normal file
|
@ -0,0 +1,5 @@
|
|||
{{ $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) "" }}
|
Loading…
Reference in New Issue
Block a user