@@ -4,41 +4,37 @@ type vfile<'a> = {..} as 'a
4
4
5
5
external makePlugin : 'a => plugin = "%identity"
6
6
7
- %%private (
8
- @module ("unified" ) external make : unit => t = "unified"
7
+ @module ("unified" ) external make : unit => t = "unified"
9
8
10
- @module ("remark-parse" ) external remarkParse : plugin = "default"
11
- @module ("remark-gfm" ) external remarkGfm : plugin = "default"
12
- @module ("remark-comment" ) external remarkComment : plugin = "default"
13
- @module ("remark-frontmatter" ) external remarkFrontmatter : plugin = "default"
14
- @module ("remark-stringify" ) external remarkStringify : plugin = "default"
9
+ @module ("remark-parse" ) external remarkParse : plugin = "default"
10
+ @module ("remark-gfm" ) external remarkGfm : plugin = "default"
11
+ @module ("remark-comment" ) external remarkComment : plugin = "default"
12
+ @module ("remark-frontmatter" ) external remarkFrontmatter : plugin = "default"
13
+ @module ("remark-stringify" ) external remarkStringify : plugin = "default"
15
14
16
- @send external use : (t , plugin ) => t = "use"
17
- @send external useOptions : (t , plugin , array <{.. }>) => t = "use"
15
+ @send external use : (t , plugin ) => t = "use"
16
+ @send external useOptions : (t , plugin , array <{.. }>) => t = "use"
18
17
19
- @send external processSync : (t , string ) => vfile <'a > = "processSync"
20
- @send external toString : vfile <'a > => string = "toString"
18
+ @send external processSync : (t , string ) => vfile <'a > = "processSync"
19
+ @send external toString : vfile <'a > => string = "toString"
21
20
22
- @module ("vfile-matter" ) external vfileMatter : vfile <'a > => unit = "matter"
23
- )
21
+ @module ("vfile-matter" ) external vfileMatter : vfile <'a > => unit = "matter"
24
22
25
23
type result = {
26
24
frontmatter : JSON .t ,
27
25
content : string ,
28
26
}
29
27
30
- %%private (
31
- let vfileMatterPlugin = makePlugin (_options => (_tree , vfile ) => vfileMatter (vfile ))
32
-
33
- let parser =
34
- make ()
35
- -> use (remarkParse )
36
- -> use (remarkStringify )
37
- -> use (remarkGfm )
38
- -> use (remarkComment )
39
- -> useOptions (remarkFrontmatter , [{"type" : "yaml" , "marker" : "-" }])
40
- -> use (vfileMatterPlugin )
41
- )
28
+ let vfileMatterPlugin = makePlugin (_options => (_tree , vfile ) => vfileMatter (vfile ))
29
+
30
+ let parser =
31
+ make ()
32
+ -> use (remarkParse )
33
+ -> use (remarkStringify )
34
+ -> use (remarkGfm )
35
+ -> use (remarkComment )
36
+ -> useOptions (remarkFrontmatter , [{"type" : "yaml" , "marker" : "-" }])
37
+ -> use (vfileMatterPlugin )
42
38
43
39
let parseSync = content => {
44
40
let vfile = parser -> processSync (content )
0 commit comments