My digital garden
at main 23 lines 1.1 kB view raw view rendered
1--- 2title: "SyntaxHighlighting" 3tags: 4 - plugin/transformer 5--- 6 7This plugin is used to add syntax highlighting to code blocks in Quartz. See [[syntax highlighting]] for more information. 8 9> [!note] 10> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. 11 12This plugin accepts the following configuration options: 13 14- `theme`: a separate id of one of the [themes bundled with Shikiji](https://shikiji.netlify.app/themes). One for light mode and one for dark mode. Defaults to `theme: { light: "github-light", dark: "github-dark" }`. 15- `keepBackground`: If set to `true`, the background of the Shikiji theme will be used. With `false` (default) the Quartz theme color for background will be used instead. 16 17In addition, you can further override the colours in the `quartz/styles/syntax.scss` file. 18 19## API 20 21- Category: Transformer 22- Function name: `Plugin.SyntaxHighlighting()`. 23- Source: [`quartz/plugins/transformers/syntax.ts`](https://github.com/jackyzha0/quartz/blob/v4/quartz/plugins/transformers/syntax.ts).