Skip to main content

Crate vertext_html

Crate vertext_html 

Source
Expand description

The shared Layout → HTML renderer.

Every HTML-producing host — the CLI today, vertext-wasm tomorrow — goes through this crate, so the slot-to-class mapping and the mode protocol are defined exactly once. The crate is wasm32-clean: no I/O, strings in, strings out.

Structs§

RenderOptions

Constants§

CELL_SEP
CODE_LATIN_CAP
MAX_HEADING_LEVEL
MODE_CODE
Reserved private-use markers that the Quarto filter inserts around a segment so a single invocation can switch mid-stream between rule sets. Source authors never type these, which is why they live in the Unicode Private Use Area.
MODE_HEADING_BASE
Heading levels 1–6 occupy U+E002–U+E007.
MODE_LIST
One list item. Each item is its own segment: flattening a whole list into a single blob welds the items together and mixes their scripts, so a list of mostly-CJK items with Latin terms in them gets classified by the aggregate rather than item by item.
MODE_LIST_ORDERED
One item of a numbered list. Ordered items already carry their number in the text, so they must not also be given a bullet; a marker of their own is what lets the stylesheet tell them apart.
MODE_PROSE
MODE_TABLE
A table segment. Within it, cells are separated by CELL_SEP and rows by ROW_SEP; a table is 2-D and the wire is a flat string, so the structure needs separators rather than a mode alone.
PROSE_LATIN_CAP
Single source of truth for the Latin slot caps. The renderer publishes them to CSS as custom properties on the root element, so the stylesheet never hardcodes a width that could drift from the layout.
RESERVED_END
One past the last reserved codepoint. The filter strips this whole range from author text; keep the two in step.
ROW_SEP

Functions§

code_config
column_advance
Exposes the advance keyword for hosts that render their own shell.
escape
heading_marker
The marker introducing a heading of level (clamped to 1–6).
prose_config
render_document
Renders one .vertext strip to HTML.