public_notes/quartz/plugins/vfile.ts

13 lines
405 B
TypeScript
Raw Normal View History

2023-07-23 09:27:41 +09:00
import { Node, Parent } from "hast"
import { Data, VFile } from "vfile"
2023-05-31 00:02:20 +09:00
export type QuartzPluginData = Data
export type ProcessedContent = [Node<QuartzPluginData>, VFile]
2023-07-01 16:03:01 +09:00
export function defaultProcessedContent(vfileData: Partial<QuartzPluginData>): ProcessedContent {
2023-07-23 09:27:41 +09:00
const root: Parent = { type: "root", children: [] }
2023-07-01 16:03:01 +09:00
const vfile = new VFile("")
vfile.data = vfileData
return [root, vfile]
}