Usage
Run katex-render after the site build, with opt-in pages and explicit markers.
Basic command§
katex-render --root public
Without --root, the command reads the public directory. It walks HTML files, processes pages that contain the marker, and writes only pages that changed.
Opt-in pages§
A page opts in by containing the marker string. The default is:
assets/katex/katex.min.css
Set --marker when the stylesheet path differs:
katex-render --root public --marker /assets/katex/katex.min.css
A page without the marker is not parsed or rewritten.
Build integration§
Run the transformer after the build writes HTML:
# after the site build writes HTML
katex-render --root public
The tool reads the built HTML and writes only pages that changed. It does not add or remove scripts, stylesheets, fonts, or other assets.