github-tui/lib/pretty.mli
2024-03-23 10:41:54 +00:00

21 lines
598 B
OCaml

(** A type representing a structured document. *)
type doc
(** Formatting of a string. *)
type styles = ANSITerminal.style list
(** Create a single chunk of string without formatting. *)
val str : string -> doc
(** Create a single chunk of string with formatting. *)
val fmt : styles -> string -> doc
(** Put all documents in a list vertically after each other with a line separator. *)
val row : doc list -> doc
(** Put all documents in a list horizontally, automatically adding required padding. *)
val col : doc list -> doc
(** Render the resulting document. *)
val render : doc -> string