module Rich_text:sig..end
type message
val size : message -> int
val char_at : message -> int -> char
val string : message -> string
val substring : message -> int -> int -> string
: message -> int -> (Transitioning.Format.stag * int * int) listval visit : ?output:(string -> int -> int -> unit) ->
?open_tag:(Transitioning.Format.stag -> int -> int -> unit) ->
?close_tag:(Transitioning.Format.stag -> int -> int -> unit) ->
message -> unitval pretty : ?vbox:int -> Format.formatter -> message -> unit
Here, you have two different strategies to render the message properly.
If ~vbox is specified, a vertical box is opened around the message,
and newlines are emitted with a "@\n" and the given indentation.
Otherwise, no box is used and newlines are emitted as
"\n", which only makes sense if there is no current indentation in the
output formatter.
type buffer
The buffer grows on demand, but is protected against huge mesages.
Maximal size is around 2 billions ASCII characters, which sould be enough
to store more than 25kloc source text.
val create : ?indent:int -> ?margin:int -> unit -> buffer
The right-margin is set to ~margin and
maximum indentation to ~indent.
Default values are those of Format.make_formatter, which are
~indent:68 and ~margin:78 in OCaml 4.05.
val message : buffer -> messageval add_char : buffer -> char -> unitval add_string : buffer -> string -> unitval add_substring : buffer -> string -> int -> int -> unitval formatter : buffer -> Format.formatter
val bprintf : buffer -> ('a, Format.formatter, unit) Pervasives.format -> 'a
val kprintf : (Format.formatter -> 'a) ->
buffer -> ('b, Format.formatter, unit, 'a) Pervasives.format4 -> 'b
val contents : buffer -> stringBuffer.contentsval sub : buffer -> int -> int -> stringBuffer.subval range : buffer -> int -> int -> stringrange b p q is sub b p (q+1-p)val trim : buffer -> int * intval shrink : buffer -> unit