Use Shiki to highlight code.
pip install sphinx-shikijs
Then, add sphinx_shikijs
to your extensions in conf.py
:
extensions = [
# ...
"sphinx_shikijs",
]
Setting | Default | Description |
---|---|---|
shikijs_mode | "cli" |
Either "cli" or "browser" . In browser mode, this will load Shiki from unpkg. |
shikijs_path | "shiki-cli" |
Path to a Shiki CLI executable. |
shikijs_highlight_theme | "dark-plus" |
A Shiki theme. For possible themes, see here |