File tree Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Original file line number Diff line number Diff line change 1
- import { JSItem } from './types' ;
1
+ import { JSItem , IMarkmapCreateOptions } from './types' ;
2
2
import { persistJS , persistPlugins } from './util' ;
3
3
import { mathJax , prism } from './plugins' ;
4
4
@@ -14,7 +14,7 @@ const baseJs: JSItem[] = [
14
14
} ,
15
15
} ) ) ;
16
16
17
- export function fillTemplate ( data : any , opts ?: any ) : string {
17
+ export function fillTemplate ( data : any , opts ?: IMarkmapCreateOptions ) : string {
18
18
const { js, css, processors } = persistPlugins ( [
19
19
opts ?. mathJax && mathJax ,
20
20
opts ?. prism && prism ,
Original file line number Diff line number Diff line change 1
1
import { Markmap } from './view' ;
2
2
3
3
export interface IHierachy < T > {
4
+ /**
5
+ * type
6
+ */
4
7
t : string ;
8
+ /**
9
+ * payload
10
+ */
5
11
p ?: any ;
12
+ /**
13
+ * children
14
+ */
6
15
c ?: T [ ] ;
7
16
}
8
17
9
18
export interface INode extends IHierachy < INode > {
19
+ /**
20
+ * depth
21
+ */
10
22
d ?: number ;
23
+ /**
24
+ * value
25
+ */
11
26
v : string ;
12
27
}
13
28
14
29
export interface IMarkmapCreateOptions {
30
+ /**
31
+ * whether to open the generated markmap in browser
32
+ */
15
33
open ?: boolean ;
34
+ /**
35
+ * Markdown content as string. It will be ignored if `input` is provided.
36
+ */
16
37
content ?: string ;
38
+ /**
39
+ * Input file path of a Markdown file. If this is provided, `content` will be ignored.
40
+ */
17
41
input ?: string ;
42
+ /**
43
+ * Output file path of the markmap HTML file. If not provided, the same basename as the Markdown input file will be used.
44
+ */
18
45
output ?: string ;
46
+ /**
47
+ * Enable MathJax support. If an object is passed, it will be merged into MathJax options.
48
+ */
19
49
mathJax ?: boolean | object ;
50
+ /**
51
+ * Enable Prism support for code blocks.
52
+ */
53
+ prism ?: boolean ;
20
54
}
21
55
22
56
export interface IMarkmapOptions {
You can’t perform that action at this time.
0 commit comments