forked from antfu/vite-plugin-md
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
106 lines (90 loc) · 2.27 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/* eslint-disable no-use-before-define */
import type MarkdownIt from 'markdown-it'
import type { FilterPattern } from '@rollup/pluginutils'
export interface Options {
/**
* Explicitly set the Vue version
*
* @default auto detected
*/
vueVersion?: string
/**
* Enable head support, need to install @vueuse/head and register to App in main.js
*
* @default false
*/
headEnabled?: boolean
/**
* The head field in frontmatter used to be used for @vueuse/head
*
* When an empty string is passed, it will use the root properties of the frontmatter
*
* @default ''
*/
headField?: string
/**
* Parse for frontmatter
*
* @default true
*/
frontmatter?: boolean
/**
* Remove custom SFC block
*
* @default ['route', 'i18n']
*/
customSfcBlocks?: string[]
/**
* Custom function to process the frontmatter
*/
frontmatterPreprocess?: (frontmatter: Record<string, unknown>, options: ResolvedOptions) => any
/**
* Expose frontmatter via expose API
*
* @default true
*/
exposeFrontmatter?: boolean
/**
* Add `v-pre` to `<code>` tag to escape curly brackets interpolation
*
* @see https://github.com/antfu/vite-plugin-md/issues/14
* @default true
*/
escapeCodeTagInterpolation?: boolean
/**
* Options passed to Markdown It
*/
markdownItOptions?: MarkdownIt.Options
/**
* Plugins for Markdown It
*/
markdownItUses?: (MarkdownIt.PluginSimple | [MarkdownIt.PluginSimple | MarkdownIt.PluginWithOptions<any>, any] | any)[]
/**
* A function providing the Markdown It instance gets the ability to apply custom settings/plugins
*/
markdownItSetup?: (MarkdownIt: MarkdownIt) => void
/**
* Class names for wrapper div
*
* @default 'markdown-body'
*/
wrapperClasses?: string | string[]
/**
* Component name to wrapper with
*
* @default undefined
*/
wrapperComponent?: string | undefined | null
/**
* Custom tranformations apply before and after the markdown transformation
*/
transforms?: {
before?: (code: string, id: string) => string
after?: (code: string, id: string) => string
}
include?: FilterPattern
exclude?: FilterPattern
}
export interface ResolvedOptions extends Required<Options> {
wrapperClasses: string
}