Repository navigation
Breaking: syntaxhighlight is now the default highlighter
Fenced code blocks in markdown are now highlighted with the syntaxhighlight Lua library instead of Pygments. Nothing outside of Lua needs to be installed anymore, but the generated HTML is different:
- Token class names are now prefixed with
sh_, so existing stylesheets written for Pygments output need to be updated. custom_highlightersregistered onPygmentsPluginmust be moved toSyntaxhighlightPlugin. Sitegen prints a warning when it finds custom highlighters registered on a plugin that isn't loaded.
To keep using Pygments, swap the plugins in your site.moon:
sitegen.create =>
remove_plugin "sitegen.plugins.syntaxhighlight"
add_plugin "sitegen.plugins.pygments"See the Migrating from Pygments docs for details.
Breaking: Analytics plugin uses Google Analytics 4
The analytics template helper now emits the gtag.js snippet instead of the retired ga.js one. Pass a GA4 measurement ID instead of a UA- account code:
$analytics{[[G-XXXXXXXXXX]]}
New
add_pluginandremove_pluginare available insite.moonfor changing the default plugin set. Removing a plugin also unregisters any events it was listening to.- The syntaxhighlight plugin now supports
custom_highlighters, matching the Pygments plugin. - Added
jsandscsslanguage aliases to the syntaxhighlight plugin. - New
HighlightPluginbase class (sitegen.highlight_plugin) shared by both highlighters, for writing your own highlighter plugin. Plugininstances have adetachmethod, andevents:offaccepts an optional callback to remove a single handler.
Dependencies
- Requires
syntaxhighlight >= 1.1.0.
Full Changelog: v0.5...v0.6