diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 13ee19f..d6c1a2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,15 @@ jobs: - name: Build run: npm run build + - name: Verify dist is up to date + run: | + if git diff --quiet dist/; then + echo "dist/ is up to date" + else + echo "::error::dist/ is stale. Run 'npm run build' and commit the result." + git diff --stat dist/ + exit 1 + fi - name: Verify dist externals run: | node -e " @@ -37,7 +46,7 @@ jobs: const pkg = JSON.parse(fs.readFileSync('package.json', 'utf-8')); const peerDeps = Object.keys(pkg.peerDependencies || {}); const builtins = new Set(['assert','buffer','child_process','cluster','console','constants','crypto','dgram','dns','domain','events','fs','http','http2','https','inspector','module','net','os','path','perf_hooks','process','punycode','querystring','readline','repl','stream','string_decoder','sys','timers','tls','trace_events','tty','url','util','v8','vm','wasi','worker_threads','zlib']); - const shared = ['@quartz-community/','preact','@jackyzha0/quartz','vfile']; + const shared = ['@quartz-community/','preact','@jackyzha0/quartz','vfile','unified']; const content = fs.readFileSync(dist, 'utf-8'); const re = /^\s*(?:import\s+.*\s+from|export\s+.*\s+from)\s+[\"']([^\"'./][^\"']*)[\"']/gm; const unexpected = new Set(); diff --git a/README.md b/README.md index ba353c1..ac7931f 100644 --- a/README.md +++ b/README.md @@ -34,11 +34,12 @@ ExternalPlugin.SyntaxHighlighting({ ## 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. | +| 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