Highlight TypeScript and bash blocks with @pierre/highlights using its
css-variables theme, mapped to the existing syntax colors through
--hls-* custom properties. Pierre cannot load custom grammars, so the
Filtron examples use the existing Lexer-based toHtml() instead of the
TextMate grammar. Unsupported code block languages now fail the build.
Fix the HTML minifier collapsing whitespace inside code: <pre> blocks
and inline syntax examples lost indentation, alignment and the spaces
between tokens. Set those blocks aside while minifying.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Why
Shiki is only used at build time, to highlight about 20 snippets, yet it brings in a sizeable dependency tree and a custom TextMate grammar for the Filtron examples.
@pierre/highlightsis smaller and faster to build with. While checking the output I also found that the HTML minifier was collapsing whitespace inside code blocks.What
@pierre/highlights(pinned at 0.2.0) using its css-variables theme. Token colors map to the existing syntax colors through--hls-*custom properties instyles.css, so dark mode follows automatically.toHtml()fromsrc/highlight.ts, since Pierre cannot load custom grammars. The website no longer uses the TextMate grammar;filtron.tmLanguage.jsonstays in@filtron/core.minifyHtmlcollapsing whitespace inside code.<pre>blocks and inline<code class="syntax-example">elements lost indentation, comment alignment and the spaces between tokens (for examplelevel>3AND...). Those blocks are now set aside while minifying.dist/index.htmlHighlighting happens at build time, so visitors see no size difference.
Notes
@filtron/coreis split into@plus a coloredfiltron/core, and package names are colored as variables.