Jacky Zhao
2023-06-20 fd5c8d17d3b3cd0a13b0a21a2b78d85010e02e12
quartz/plugins/transformers/syntax.ts
@@ -1,15 +1,12 @@
import { PluggableList } from "unified"
import { QuartzTransformerPlugin } from "../types"
import rehypePrettyCode, { Options as CodeOptions } from "rehype-pretty-code"
export class SyntaxHighlighting extends QuartzTransformerPlugin {
  name = "SyntaxHighlighting"
  markdownPlugins(): PluggableList {
export const SyntaxHighlighting: QuartzTransformerPlugin = () => ({
  name: "SyntaxHighlighting",
  markdownPlugins() {
    return []
  }
  htmlPlugins(): PluggableList {
  },
  htmlPlugins() {
    return [[rehypePrettyCode, {
      theme: 'css-variables',
      onVisitLine(node) {
@@ -25,4 +22,4 @@
      },
    } satisfies Partial<CodeOptions>]]
  }
}
})