Add a way to put in sections of a file

This commit is contained in:
Danila Fedorin 2019-08-20 20:12:18 -07:00
parent 38c703f581
commit b36d1949de
1 changed files with 5 additions and 0 deletions

View 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) "" }}