Implementing highlighting.
h3rald h3rald@h3rald.com
Sat, 17 Feb 2024 16:19:15 +0100
1 files changed,
17 insertions(+),
0 deletions(-)
jump to
M
rules.min
→
rules.min
@@ -99,6 +99,22 @@ asset "output/articles/$1/$1" (name) => % %id @asset
asset output-cp ) ^copy-pdf-article-asset +; Syntax highlighting +( + symbol process-code + (str :text ==> str :result) + ( + "echo \"$#\" | chroma --html --html-only --html-prevent-surrounding-pre" :cmd + text "<code[^>]*>([\s\S]+?)</code>" ( + :match + match 1 get escape :code + cmd (code) =% run /output :out + "<code>$#</code>" (out) =% + ) replace-apply @result + + ) +) :: + ; Process :icon: markup ( symbol process-icons@@ -151,6 +167,7 @@ (content /ext ".md" ==) (contents content markdown @contents) when
content contents %contents @content tpl content mustache @page id page process-icons @page + id page process-code @page content page %contents @content ( ((id "^(glyph|ruby-compendium)\/book" match?) ()) ;Do not add index.html