Skip to main content
Code blocks are highlighted with Shiki in both light and dark themes. Set the theme pair with styling.codeblocks in docs.json (defaults: min-light / one-dark-pro). Every block gets a copy button. Unknown languages fall back to plain text.

Fence options

Options go on the opening fence line, in any order:

Diffs

Mark added and removed lines inside the code itself:
// [!code ++] and // [!code --] mark the line they’re on (append :3 to span three lines). The markers are stripped from the output.

Code groups

Combine alternatives into one tabbed block:

Mermaid diagrams

A mermaid fence renders as a diagram:
The Mermaid runtime is only included on sites that use it.

Math

Write inline math as $E = mc^2$ and block math with $$ … $$. Rendering is auto-detected per page. Force it on or off site-wide with styling.latex in docs.json. KaTeX assets are only included on sites that use math.