Mead.Table (mead_pdf v0.1.0)

Copy Markdown View Source

Desugars :table trees into plain view trees before layout.

The table model is "measure globally, split locally": column tracks are fixed once for the whole table and identical on every row, so fragments produced by the paginator can never disagree about column widths. Tracks are frozen by construction rather than by a measurement pass:

  • a fixed track (40) becomes width: 40 with flex_grow: 0 / flex_shrink: 0 on the cell;
  • a fractional track ({:fr, n}) becomes flex_grow: n with flex_basis: 0, so every row distributes the remaining width in the same proportions.

Content-measured ("auto") tracks need a min/max-content pass and are deliberately not supported yet.

Structure mapping: the table becomes a column view whose children are the header group (repeat: true), the body rows (bodies are dissolved; rows are atomic wrap: false row-views of cells), and the footer group (repeat_after: true). Groups are atomic. The paginator's generic repeat/repeat_after machinery then provides the WeasyPrint header/footer repetition rules (see TESTING.md).

Summary

Functions

Recursively desugars every :table in the tree; other nodes pass through.

Functions

desugar(table)

@spec desugar(Mead.Node.t()) :: Mead.Node.t()

Recursively desugars every :table in the tree; other nodes pass through.