Skip to main content

Module render

Module render 

Source
Available on crate feature render only.
Expand description

Render semantic documents through the ctl-layout widgets.

A Document becomes a tree of widgets, one per block:

  • Fields becomes a record, and Table a table.
  • A Section becomes its heading over its body.
  • A Notice and every paragraph become styled text.
  • A rule stays a rule, and verbatim text keeps its own lines.

The Theme turns each Role into a style on the way, so the widgets never see a role. The widgets lay the document out as plain lines of styled spans. Escape sequences are added only when ctl-term’s encoder writes the lines.

Structs§

RenderOptions
How a document renders: colour mode, width, theme, and styles.

Enums§

Frame
What a table draws around and between its columns.
RecordStyle
How a Record of key and value rows is drawn.
RowSeparation
What separates consecutive rows of a table.

Constants§

DEFAULT_COLUMN_BUFFERhelp or view
Default cells reserved from an automatically detected terminal width.
DEFAULT_COLUMN_BUFFER_ENVhelp or view
The environment variable that sets the automatic-width buffer, in cells, when the CLI has not: CTL_CORE_COLUMN_BUFFER.
DEFAULT_COLUMN_BUFFER_ENVShelp or view
The ordered list of variables read for the automatic-width buffer, holding only DEFAULT_COLUMN_BUFFER_ENV.
DEFAULT_FALLBACK_WIDTH
Width used when neither the terminal nor COLUMNS gives one.
DEFAULT_LIST_STYLE_ENV
The environment variable that sets the table frame when the CLI has not: CTL_CORE_LIST_STYLE. Its values are the Frame names grid, header-rule, and plain.
DEFAULT_LIST_STYLE_ENVS
The ordered list of variables read for the table frame, holding only DEFAULT_LIST_STYLE_ENV.
DEFAULT_MINIMUM_AUTOMATIC_WIDTHhelp or view
Default floor for an automatically detected effective width.
DEFAULT_RECORD_STYLE_ENV
The environment variable that sets the record style when the CLI has not: CTL_CORE_RECORD_STYLE. Its values are the RecordStyle names keys-right, keys-left, and boxed.
DEFAULT_RECORD_STYLE_ENVS
The ordered list of variables read for the record style, holding only DEFAULT_RECORD_STYLE_ENV.
DEFAULT_ROW_SEPARATION_ENV
The environment variable that sets the row separation when the CLI has not: CTL_CORE_ROW_SEPARATION. Its values are the RowSeparation names none, rule, and blank.
DEFAULT_ROW_SEPARATION_ENVS
The ordered list of variables read for the row separation, holding only DEFAULT_ROW_SEPARATION_ENV.