Color code blocks when the site is built #30

Merged
jcoffey-dev merged 1 commits from docs/code-highlighting into main 2026-10-15 03:42:48 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev 034b59dac0 Color code blocks when the site is built
ci / editor-ui (pull_request) Successful in 23s
ci / go (pull_request) Successful in 2m10s
A fenced block that names its language is colored at build time with
chroma, so pages need no script. The markup matches pymdownx.highlight
(div.highlight, Pygments class names), so MkDocs stylesheets work too, and
hl_lines="2 4-5" marks lines. Blocks with no language, text, or a language
chroma doesn't know come out exactly as before.

The starter and the docs pack (1.5.0) carry the colors: hues mixed into the
code's own text color, so they read on light and dark code blocks. Turn it
off with markdown.highlight: false.
2026-10-14 20:24:07 -07:00