refactor plugins to be functions instead of classes

This commit is contained in:
Jacky Zhao committed 2023-06-11 23:26:43 -07:00
1 parent b8c011410d
commit 352075ae81
20 files changed
+464 -507

No files matched your search

+6 -9
View File
@@ -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 @@ export class SyntaxHighlighting extends QuartzTransformerPlugin {
},
} satisfies Partial<CodeOptions>]]
}
}
})