-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathparser.ts
62 lines (51 loc) · 1.21 KB
/
parser.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
import type { Options as RehypeOption } from 'remark-rehype'
import type { MdcConfig } from './config'
import type { MDCData, MDCRoot } from './tree'
import type { Toc } from './toc'
import type { RehypeHighlightOption } from './highlighter'
export interface RemarkPlugin {
instance?: any
options?: Array<any> | Record<string, any>
}
export interface RehypePlugin {
instance?: any
options?: Array<any> | Record<string, any>
}
export interface MDCParseOptions {
remark?: {
plugins?: Record<string, false | RemarkPlugin>
}
rehype?: {
options?: RehypeOption
plugins?: Record<string, false | RehypePlugin>
}
highlight?: RehypeHighlightOption | false
toc?: {
/**
* Maximum heading depth to include in the table of contents.
*/
depth?: number
searchDepth?: number
} | false
keepComments?: boolean
/**
* Keep the position of the node
*/
keepPosition?: boolean
/**
* Extract content heading from the markdown file.
*
* @default true
*/
contentHeading?: boolean
/**
* Inline mdc.config.ts
*/
configs?: MdcConfig[]
}
export interface MDCParserResult {
data: MDCData
body: MDCRoot
excerpt: MDCRoot | undefined
toc: Toc | undefined
}