Skip to main content

Module document

Module document 

Source
Expand description

Structured display blocks used as the boundary between formatting and terminal rendering.

This module exists so higher-level code can describe what should be shown without deciding how it should be painted in a terminal. Formatters build documents out of semantic blocks, and the renderer later turns those blocks into themed terminal text.

In practice, this keeps rendering bugs easier to localize:

  • if the document shape is wrong, the formatter is wrong
  • if the document is right but the terminal output is wrong, the renderer is wrong

Contract:

  • document types may carry semantic styling hints and layout intent
  • they should not depend on terminal width probing, theme resolution, or config precedence
  • block variants are intentionally higher-level than raw ANSI/text spans so multiple renderers can share the same model

Structs§

CodeBlock
Fenced code block with optional language metadata.
Document
Renderable document composed of high-level display blocks.
JsonBlock
JSON payload block.
LineBlock
Single rendered line composed of independently styled parts.
LinePart
Fragment of a rendered line with optional semantic styling.
MregBlock
MREG-style hierarchical key/value block.
MregEntry
Key/value entry inside an MREG row.
MregRow
One row inside an MREG-style block.
PanelBlock
Framed panel containing a nested document.
TableBlock
Tabular document block.
ValueBlock
Block representing a simple ordered list of scalar values.

Enums§

Block
Top-level document block variants understood by the renderer.
MregValue
Rendered value kinds supported by MREG output.
PanelRules
Rule placement policy for panel chrome.
TableAlign
Column alignment hint for table rendering.
TableStyle
Table presentation style.
ValueLayout
Layout policy for scalar value blocks.