package cmarkit

  1. Overview
  2. Docs

Module Block.TableSource

Tables.

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

The type for column alignments.

Sourcetype sep = align option * Layout.count

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

Sourcetype cell_layout = Layout.blanks * Layout.blanks

The type for cell layout, initial and trailing blanks.

Sourcetype 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.

Sourcetype t

The type for tables.

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

make rows is a table row rows.

Sourceval indent : t -> Layout.indent

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

Sourceval col_count : t -> int

col_count t is the number of columns in the table.

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

rows t are the table's rows.