package cmarkit

  1. Overview
  2. Docs

Tables.

type align = [
  1. | `Left
  2. | `Center
  3. | `Right
]

The type for column alignments.

type sep = align option * Layout.count

The type for separators. The column aligment and the number of - for layout preservation.

type cell_layout = Layout.blanks * Layout.blanks

The type for cell layout, initial and trailing blanks.

type row = [
  1. | `Header of (Inline.t * cell_layout) list
  2. | `Sep of sep node list
  3. | `Data of (Inline.t * cell_layout) list
]

The type for rows. The lists only have entries for columns as found in rows in the document. You need to pad them on the right with more columns to reach the table's col_count.

type t

The type for tables.

val make : ?indent:Layout.indent -> (row node * Layout.blanks) list -> t

make rows is a table row rows.

val indent : t -> Layout.indent

indent t is the indentation to the first pipe found on the first row.

val col_count : t -> int

col_count t is the number of columns in the table.

val rows : t -> (row node * Layout.blanks) list

rows t are the table's rows.

OCaml

Innovation. Community. Security.