Code blocks that name their language (go, yaml, ```bash …) are now colored when the site is built. No script on the page.
Uses chroma (MIT). The HTML is the same shape MkDocs' pymdownx.highlight makes (div.highlight, Pygments class names), so MkDocs stylesheets color it too.
hl_lines="2 4-5" marks lines.
Blocks with no language, text, or a language chroma doesn't know come out exactly as before. markdown.highlight: false turns it off.
The starter's styles.css and the docs pack (now 1.5.0) have the colors. Each is a hue mixed into the code's own text color, so it reads on light and dark code blocks. A theme can change the hues with --code-keyword and the rest.
The MkDocs importer no longer lists pymdownx.highlight / codehilite as unsupported.
Checked: built docs.inbuxa.org, docs.ihasmail.org and hotdogcms.org with main and with this branch. Only code blocks change, the text in them is the same, and build times are the same. The binary is 3.4 MB bigger (20.3 → 23.7 MB) and starts about 5 ms slower. Looked at it in Chrome in light, dark and on a light code background.
Code blocks that name their language (```go, ```yaml, ```bash …) are now colored when the site is built. No script on the page.
- Uses chroma (MIT). The HTML is the same shape MkDocs' pymdownx.highlight makes (`div.highlight`, Pygments class names), so MkDocs stylesheets color it too.
- `hl_lines="2 4-5"` marks lines.
- Blocks with no language, `text`, or a language chroma doesn't know come out exactly as before. `markdown.highlight: false` turns it off.
- The starter's styles.css and the docs pack (now 1.5.0) have the colors. Each is a hue mixed into the code's own text color, so it reads on light and dark code blocks. A theme can change the hues with `--code-keyword` and the rest.
- The MkDocs importer no longer lists pymdownx.highlight / codehilite as unsupported.
Checked: built docs.inbuxa.org, docs.ihasmail.org and hotdogcms.org with main and with this branch. Only code blocks change, the text in them is the same, and build times are the same. The binary is 3.4 MB bigger (20.3 → 23.7 MB) and starts about 5 ms slower. Looked at it in Chrome in light, dark and on a light code background.
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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Code blocks that name their language (
go,yaml, ```bash …) are now colored when the site is built. No script on the page.div.highlight, Pygments class names), so MkDocs stylesheets color it too.hl_lines="2 4-5"marks lines.text, or a language chroma doesn't know come out exactly as before.markdown.highlight: falseturns it off.--code-keywordand the rest.Checked: built docs.inbuxa.org, docs.ihasmail.org and hotdogcms.org with main and with this branch. Only code blocks change, the text in them is the same, and build times are the same. The binary is 3.4 MB bigger (20.3 → 23.7 MB) and starts about 5 ms slower. Looked at it in Chrome in light, dark and on a light code background.