package b0
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha512=00a6868b4dfa34565d0141b335622a81a0e8d5b9e3c6dfad025dabfa3df2db2a1302b492953bbbce30c3a4406c324fcec25250a00b38f6d18a69e15605e3b07e
doc/b0_b00_kit/B00_cmark/index.html
Module B00_cmark
B00 cmark support.
This models the cmark tool. There's not much to model though.
An extraction function is also provided.
Cmark
val tool : B00.Tool.ttool is the cmark tool.
val cmd :
?validate_utf_8:bool ->
?format:string ->
B00.Memo.t ->
opts:B0_std.Cmd.t ->
mds:B0_std.Fpath.t list ->
o:B0_std.Fpath.t ->
unitcmd m ~format ~validate_utf_8 ~args ~mds ~o writes to file o the result of processing the CommonMark files mds.
formatis the output format. It defaults to"html"which outputs a fragment not a full page page (this the--tooption).validate_utf_8is the--validate-utf8option it defaults totrue.argsare additional command line arguments you may want to pass tocmark.
Convenience
val to_html :
?generator:string ->
?lang:string ->
?scripts:string list ->
?styles:string list ->
?title:string ->
B00.Memo.t ->
opts:B0_std.Cmd.t ->
mds:B0_std.Fpath.t list ->
o_frag:B0_std.Fpath.t ->
o:B0_std.Fpath.t ->
unitto_html m ~opts ~mds ~o_frag o compiles the concatenation of mds to an HTML fragment o_frag and then to an HTML page o by invoking cmd with opts and B00_htmlg.El.write_page; for the documentation of optional arguments see the later.
Extraction
first_section src is Some (title, content) where title is the content of first CommonMark header found in CommonMark source src and content everything that follows until the next header (preamble is true) or next header of the same of smaller level (preamble is false). Trailing blank lines are discarded.
Warning. This function may break on valid CommonMark inputs in all sorts of fashion.