mirror of
https://github.com/alrayyes/wiki.git
synced 2025-04-29 22:04:14 +00:00
plugin integration round 2
This commit is contained in:
parent
a757521313
commit
ad6ce0d73f
29 changed files with 3863 additions and 100 deletions
quartz/plugins
38
quartz/plugins/types.ts
Normal file
38
quartz/plugins/types.ts
Normal file
|
@ -0,0 +1,38 @@
|
|||
import { PluggableList } from "unified"
|
||||
import { StaticResources } from "../resources"
|
||||
import { ProcessedContent } from "./vfile"
|
||||
|
||||
export abstract class QuartzTransformerPlugin {
|
||||
abstract name: string
|
||||
abstract markdownPlugins(): PluggableList
|
||||
abstract htmlPlugins(): PluggableList
|
||||
externalResources?: Partial<StaticResources>
|
||||
}
|
||||
|
||||
export abstract class QuartzFilterPlugin {
|
||||
abstract name: string
|
||||
abstract shouldPublish(content: ProcessedContent): boolean
|
||||
}
|
||||
|
||||
export interface EmitOptions {
|
||||
// meta
|
||||
title: string
|
||||
description: string
|
||||
slug: string
|
||||
ext: `.${string}`
|
||||
|
||||
// rendering related
|
||||
content: string
|
||||
}
|
||||
|
||||
export type EmitCallback = (data: EmitOptions) => Promise<void>
|
||||
export abstract class QuartzEmitterPlugin {
|
||||
abstract name: string
|
||||
abstract emit(content: ProcessedContent[], emitCallback: EmitCallback): Promise<string[]>
|
||||
}
|
||||
|
||||
export interface PluginTypes {
|
||||
transformers: QuartzTransformerPlugin[],
|
||||
filters: QuartzFilterPlugin[],
|
||||
emitters: QuartzEmitterPlugin[],
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue