LTerm_textStyled text.
type t = (Zed_char.t * LTerm_style.t) arrayType of a string with styles for each characters.
val aval_width : Zed_string.width -> intval of_string : Zed_string.t -> tCreates a styled string from a string. All characters of the string have no style.
val to_string : t -> Zed_string.tReturns the string part of a styled string.
val of_utf8 : string -> tCreates a styled string from a utf8 string. All characters of the string have no style.
val of_string_maybe_invalid : Zed_string.t -> tCreates a styled string from a Zed_string. All characters of the string have no style. The string may contain invalid sequences, in which case invalid bytes are escaped with the syntax \yXX.
val of_utf8_maybe_invalid : string -> tCreates a styled string from a string. All characters of the string have no style. The string may contain invalid UTF-8 sequences, in which case invalid bytes are escaped with the syntax \yXX.
val of_rope : Zed_rope.t -> tCreates a styled string from a rope.
val to_rope : t -> Zed_rope.tReturns the string part of a styled string as a rope.
val stylise : string -> LTerm_style.t -> tstylise string style creates a styled string with all styles set to style.
val stylise_parenthesis :
t ->
?paren:(Zed_char.t * Zed_char.t) list ->
int ->
LTerm_style.t ->
unitstylise_parenthesis text ?paren pos style searchs for parenthesis group starting or ending at pos and apply them the style style. paren is the list of parenthesis recognized.
Markup strings are used to conveniently define styled strings.
type item = | S of Zed_utf8.tA UTF-8 encoded string.
*)| R of Zed_rope.tA rope.
*)| B_bold of boolBegins bold mode.
*)| E_boldEnds bold mode.
*)| B_underline of boolBegins underlined mode.
*)| E_underlineEnds underlined mode.
*)| B_blink of boolBegins blinking mode.
*)| E_blinkEnds blinking mode.
*)| B_reverse of boolBegins reverse video mode.
*)| E_reverseEnds reverse video mode.
*)| B_fg of LTerm_style.colorBegins foreground color.
*)| E_fgEnds foreground color.
*)| B_bg of LTerm_style.colorBegins background color.
*)| E_bgEnds background color.
*)Type of an item in a markup string.
type markup = item listType of a markup string.
val make_formatter :
?read_color:(Format.tag -> LTerm_style.t) ->
unit ->
(unit -> t) * Format.formatterCreate a formatter on a styled string. Returns a tuple get_content, fmt. Calling get_content () will flush the formatter and output the resulting styled string.
If a read_color function is provided, Format's tag are enabled and read_color is used to transform tags into styles.
val pp_with_style :
(LTerm_style.t -> Format.tag) ->
LTerm_style.t ->
('b, Format.formatter, unit, unit) format4 ->
Format.formatter ->
'bpp_with_style f will create a pretty printer analogous to stylise, using f to encode style into tags. Will only work on a formatter with tag enabled.
val styprintf :
?read_color:(Format.tag -> LTerm_style.t) ->
('a, Format.formatter, unit, t) format4 ->
'aEquivalent of Format.sprintf for styled strings.
val kstyprintf :
?read_color:(Format.tag -> LTerm_style.t) ->
(t -> 'a) ->
('b, Format.formatter, unit, 'a) format4 ->
'bEquivalent of Format.ksprintf for styled strings.