No description
Find a file
2026-05-22 20:06:19 +02:00
.github/workflows chore: updated CI 2026-04-27 21:43:03 +02:00
dist fix: pack shiki 2026-04-28 00:02:48 +02:00
src fix: pack shiki 2026-04-28 00:02:48 +02:00
types chore: centralize type declarations and standardize tooling config 2026-03-16 18:55:26 +01:00
.eslintrc.json chore: centralize type declarations and standardize tooling config 2026-03-16 18:55:26 +01:00
.gitignore chore: commit dist/ and remove prepare script 2026-03-14 22:01:39 +01:00
.prettierignore chore: centralize type declarations and standardize tooling config 2026-03-16 18:55:26 +01:00
.prettierrc Initial commit 2026-02-13 21:36:52 +01:00
CHANGELOG.md Initial commit 2026-02-13 21:36:52 +01:00
LICENSE Initial commit 2026-02-13 21:36:52 +01:00
package-lock.json deps: update @quartz-community/types and @quartz-community/utils 2026-04-16 13:31:05 +02:00
package.json docs: add missing defaultOptions and optionSchema to package.json manifest 2026-05-22 20:06:19 +02:00
README.md chore: updated CI 2026-04-27 21:43:03 +02:00
tsconfig.build.json fix: use separate tsconfig for DTS build to avoid vitest dependency 2026-03-22 13:12:01 +01:00
tsconfig.json feat: add clipboard copy button for code blocks 2026-02-14 00:32:49 +01:00
tsup.config.ts feat: add shiki targeting 2026-04-27 21:42:54 +02:00
vitest.config.ts fix: add passWithNoTests to vitest config 2026-03-09 03:21:30 +01:00

@quartz-community/syntax-highlighting

Adds syntax highlighting to code blocks using rehype-pretty-code, with an optional clipboard copy button.

Installation

npx quartz plugin add github:quartz-community/syntax-highlighting

Usage

plugins:
  - source: github:quartz-community/syntax-highlighting
    enabled: true
    options:
      theme:
        light: github-light
        dark: github-dark
      keepBackground: false

For advanced use cases, you can override in TypeScript:

import * as ExternalPlugin from "./.quartz/plugins";

ExternalPlugin.SyntaxHighlighting({
  theme: { light: "github-light", dark: "github-dark" },
  keepBackground: false,
});

Configuration

Option Type Default Description
theme { light: CodeTheme, dark: CodeTheme } { light: "github-light", dark: "github-dark" } The theme to use for syntax highlighting.
keepBackground boolean false Whether to keep the background color of the code block.
clipboard boolean true Whether to add a clipboard copy button to code blocks.
tokenClassification boolean true Adds data-token-type attributes (keyword, string, comment, etc.) to token spans. Enables theme-aware code styling via CSS selectors.

Documentation

See the Quartz documentation for more information.

License

MIT