module Polebrush_html:Facilities for converting polebrush into htmlsig
..end
Enum.t
from ExtLib as a more powerful way to work with streams.exception Invalid_polebrush of string
Header 10
.typetoc =
(string * int * Polebrush.line list) list
val toc_of_enum : Polebrush.block Enum.t -> toc * Polebrush.block Enum.t
val elements_of_toc : toc -> Polebrush.element list
val of_enum : ?disable_toc:bool ->
?escape_cdata:bool ->
?escape_nomarkup:bool ->
?code_highlight_cmd:string -> Polebrush.block Enum.t -> string Enum.t
disable_toc
: Do not generate Tables of Contents. Accelerates outputing and makes it streaming. If true, all Polebrush.ToC
will be ignored. Default if false.escape_cdata
: Do not escape spedial HTML chars. Default is false.escape_nomarkup
: Escape special HTML chars even in ==nomarkup==
and nomarkup.
. Default is false.val of_stream : ?escape_cdata:bool ->
?escape_nomarkup:bool ->
?code_highlight_cmd:string -> Polebrush.block Stream.t -> string Stream.t
escape_cdata
: Do not escape spedial HTML chars. Default is false.escape_nomarkup
: Escape special HTML chars even in ==nomarkup==
and nomarkup.
. Default is false.val of_block : ?toc:toc ->
?escape_cdata:bool ->
?escape_nomarkup:bool ->
?code_highlight_cmd:string -> Polebrush.block -> string
toc
: Table of Contents which will be used if toc.
will attended. If not passed, all toc.
will be ignored.escape_cdata
: Do not escape spedial HTML chars. Default is false.escape_nomarkup
: Escape special HTML chars even in ==nomarkup==
and nomarkup.
. Default is false.
let () =
let to_lines path =
let chan = open_in path in
Stream.from
(fun _ ->
try Some (input_line chan)
with End_of_file -> None) in
let lines = to_lines "test.txt" in
let polebrush = Polebrush_pasrer.of_stream lines in
Stream.iter print_endline (Polebrush_html.of_block polebrush)
val of_line : ?escape_cdata:bool -> ?escape_nomarkup:bool -> Polebrush.line -> string