@@ -4,41 +4,37 @@ type vfile<'a> = {..} as 'a
44
55external makePlugin : 'a => plugin = "%identity"
66
7- %%private (
8- @module ("unified" ) external make : unit => t = "unified"
7+ @module ("unified" ) external make : unit => t = "unified"
98
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"
1514
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"
1817
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"
2120
22- @module ("vfile-matter" ) external vfileMatter : vfile <'a > => unit = "matter"
23- )
21+ @module ("vfile-matter" ) external vfileMatter : vfile <'a > => unit = "matter"
2422
2523type result = {
2624 frontmatter : JSON .t ,
2725 content : string ,
2826}
2927
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 )
4238
4339let parseSync = content => {
4440 let vfile = parser -> processSync (content )
0 commit comments