From b36d1949de99abd39918b3904c9a34c53c6c6640 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Tue, 20 Aug 2019 20:12:18 -0700 Subject: [PATCH] Add a way to put in sections of a file --- themes/vanilla/layouts/shortcodes/codelines | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 themes/vanilla/layouts/shortcodes/codelines diff --git a/themes/vanilla/layouts/shortcodes/codelines b/themes/vanilla/layouts/shortcodes/codelines new file mode 100644 index 0000000..b5d16a6 --- /dev/null +++ b/themes/vanilla/layouts/shortcodes/codelines @@ -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) "" }}