Up

module Ascii_table

: sig
#
module Align : sig
#
type t
#
val left : t
#
val right : t
#
val center : t
end
#
module Display : sig
#
type t
#
val short_box : t
#
val tall_box : t
#
val line : t
#
val blank : t
#
val column_titles : t
end
#
module Column : sig
#
type 'a t
#
val create : ?align:Align.t -> ?min_width:int -> ?max_width:int -> ?show:[
| `Yes
| `No
| `If_not_empty
] -> string -> ('a -> string) -> 'a t

creates a column given the header and the to-string function

#
val create_attr : ?align:Align.t -> ?min_width:int -> ?max_width:int -> ?show:[
| `Yes
| `No
| `If_not_empty
] -> string -> ('a -> Console.Ansi.attr list * string) -> 'a t

like create, except that the to_string function must provide a list of attributes.

end
#
type ('row, 'rest) renderer = ?display:Display.t -> ?spacing:int -> ?limit_width_to:int -> ?header_attr:Console.Ansi.attr list -> ?bars:[
| `Ascii
| `Unicode
] -> 'row Column.t list -> 'row list -> 'rest
#
val output : (_, oc:Core.Std.Out_channel.t -> unit) renderer

The idea is that you have a Column.t list and a list of rows, where each row contains the data for each column. So e.g. 'a could be a record type CUSTOM(col_1) : int; col_2 : string , where the first column pulls out col_1 and the second column pulls out col_2. *

#
val to_string_noattr : (_, string) renderer
#
val to_string : (_, string) renderer
#
val simple_list_table : ?index:bool -> ?limit_width_to:int -> ?oc:Core.Std.Out_channel.t -> ?display:Display.t -> string list -> string list list -> unit
#
module Table_char : sig
#
type t = {
# ascii
: char;
# utf8
: string;
}
#
val connect : ?top:unit -> ?bottom:unit -> ?left:unit -> ?right:unit -> unit -> t
end
end