mirror of
https://github.com/jackyzha0/quartz
synced 2026-11-27 22:14:40 +01:00
Audit of the docs against 5.1 (release notes, core source, plugins) and fixes: - getting-started: 5.0 → 5.1 upgrade section (plugin doctor --fix, line breaks, heading ids, Bases 1.2, permalinks, frontmatter, CI, GFM before OFM), New in 5.1, git pull upstream v5, no redundant install steps - advanced: new plugin manifest reference (dependencies, defaultOrder, configSchema/optionSchema, deprecated, components…), making plugins (BuildCtx, emitters, page types, peer dependencies, imports), creating components (./components subpath, script loading, render/prefetch contract), capabilities, architecture, paths - cli: --directory is the content folder; build/sync flags and behaviour (sync force-pushes); plugin add from npm - configuration, layout, features and plugin pages: nested colors, built-ins, wikilinks/heading anchors, Obsidian compatibility (OFM 2.0), correct defaults and options, Bases 1.2, stacked pages, og-image v5 API; new pages for Excalidraw, TTRPG maps and themes
2.1 KiB
2.1 KiB
title, description, tags, image, repository, enabled, required
| title | description | tags | image | repository | enabled | required | |
|---|---|---|---|---|---|---|---|
| SyntaxHighlighting | Syntax highlighting for code blocks. |
|
https://images.unsplash.com/photo-1580569214296-5cf2bffc5ccd | [quartz-community/syntax-highlighting](https://github.com/quartz-community/syntax-highlighting) | true | false |
This plugin is used to add syntax highlighting to code blocks in Quartz. See syntax highlighting for more information.
Note
For information on how to add, remove or configure plugins, see the configuration#Plugins page.
This plugin accepts the following configuration options:
theme: a separate id of one of the themes bundled with Shiki. One for light mode and one for dark mode. Defaults totheme: { light: "github-light", dark: "github-dark" }.keepBackground: If set totrue, the background of the Shiki theme will be used. Withfalse(default) the Quartz theme color for background will be used instead.clipboard: Whether to add a copy-to-clipboard button to code blocks. Defaults totrue.tokenClassification: Whether to add adata-token-typeattribute to each highlighted token (keyword,string,comment,function,property, …), so themes and custom CSS can restyle tokens by kind, e.g.span[data-token-type="keyword"]. The theme's own colours are kept. Defaults totrue.
Highlighting is done with rehype-pretty-code, so its other options (such as defaultLang) can be passed too.
In addition, you can further override the colours in the quartz/styles/syntax.scss file.
Default options
- source: "@quartz-community/syntax-highlighting"
enabled: true
options:
theme:
light: github-light
dark: github-dark
keepBackground: false
order: 20
API
- Category: Transformer
- Function name:
ExternalPlugin.SyntaxHighlighting(). - Source:
quartz-community/syntax-highlighting - Install:
npx quartz plugin add @quartz-community/syntax-highlighting(included in the default configuration)