Post ASJGzLm68PI143zooK by tarasis@social.tarasis.net
(DIR) More posts by tarasis@social.tarasis.net
(DIR) Post #ASJGzLm68PI143zooK by tarasis@social.tarasis.net
2023-02-03T03:37:48Z
0 likes, 1 repeats
Have created a plugin (not published yet) for #11ty that adds syntax highlighting using the Chroma syntax highlighter which is written in `Go`. It supports line numbers, arbitrary start line number, highlights ranges, color themes (below is onedark)https://github.com/tarasis/eleventy-plugin-syntaxhighlighting-chromaSample output attached. Note: Still WIP, needs better docs, possibly rename properties, add support back for `pre` and `code` attributes.I know it runs on macOS and Linux, not tried Windows yet but should work.#eleventy
(DIR) Post #ASJGzNLaHxGlwPbflI by tarasis@social.tarasis.net
2023-02-03T03:40:24Z
0 likes, 0 repeats
I am stepping on the shoulders of othersThis plugin is based off of the official plugin https://github.com/11ty/eleventy-plugin-syntaxhighlight by Zach Leatherman. I modified its code to work with the Chroma highlighterI pull in the https://github.com/krymel/chroma-highlight NPM package by krymel. It downloads the Chroma highlighter binary for the platform you are on, and makes it available through a function where you pass in the formatter to use, the language, and any optionsFinally the highlighter https://github.com/alecthomas/chroma by Alec Thomas.