package mosaic

  1. Overview
  2. Docs

Module Text.Fragment

type t = fragment
val text : ?style:Ansi.Style.t -> string -> t

text ?style s is a text fragment containing s. When style is provided, it overrides the inherited style for this fragment.

val span : ?style:Ansi.Style.t -> t list -> t

span ?style children is a container grouping children under an optional shared style.

Attribute builders

Each wraps children in a span with a single attribute set.

val bold : t list -> t
val italic : t list -> t
val underline : t list -> t
val dim : t list -> t
val inverse : t list -> t
val hidden : t list -> t
val strikethrough : t list -> t

Combination builders

val bold_italic : t list -> t
val bold_underline : t list -> t
val italic_underline : t list -> t
val bold_italic_underline : t list -> t

Color builders

val fg : Ansi.Color.t -> t list -> t

fg color children sets the foreground color.

val bg : Ansi.Color.t -> t list -> t

bg color children sets the background color.

val color : Ansi.Color.t -> t list -> t

color is fg.

val bg_color : Ansi.Color.t -> t list -> t

bg_color is bg.

val styled : Ansi.Style.t -> t list -> t

styled style children wraps children with the full style.