package textutils_kernel
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=94b7c76b5cd6cedf83128bb5a6ccec2f3a62d57880adbcc2d69dd7d382427c33
md5=f872451af358f3a2f5f8519b83c72994
doc/textutils_kernel.text_block/Text_block/index.html
Module Text_block
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.tinclude Core_kernel.Invariant.S with type t := t
val invariant : t -> unitval nil : tthe empty block. a left and right unit to both hcat and vcat
val fill : char -> width:int -> height:int -> tfill and space assume width and height are non-negative
val space : width:int -> height:int -> ta basic block of text, split on newlines and horizontally aligned as specified.
If max_width is provided, split on whitespace and wrap words to respect the request. So long as no words are longer than max_width, the resulting text block will be no wider than max_width
val textf :
?align:halign ->
?max_width:int ->
('r, unit, string, t) Core_kernel.format4 ->
'rvertical and horizontal concatenation with alignment
val width : t -> inttext block dimensions
val height : t -> intval hstrut : int -> tempty blocks with either horizontal or vertical extent -- useful for specifying a minimum width or height in conjunction with valign or halign, respectively
val vstrut : int -> twrap a block with an ANSI escape sequence. The prefix and suffix arguments should render with zero width and height.
val render : t -> stringrender a block of text as a string
val compress_table_header :
?sep_width:int ->
[ `Cols of (t * t list * halign) list ] ->
[ `Header of t ] * [ `Rows of t list ]compress table header according to column widths. Input: a list of columns of the form (title, values, column alignment). Output: one header block and row sequence. Raises: if the values lists are not the same length in each column. Example:
first name age first name last name age | last name | | | ==> | | | 30 sue smith 30 sue smith 18 bill rodriguez 18 bill rodriguez 76 rick jones 76 rick jones
val vsep : tvsep = vstrut 1
val hsep : thsep = hstrut 1
val sexp : ('a -> Core_kernel.Sexp.t) -> 'a -> tsexp sexp_of_a a = sexp_of_a a |> Sexp.to_string |> text