Expand description
The text level: a shared, source-independent semantics for written documents — sections, paragraphs, quotes, lists, and verbatim blocks — produced by format crates and served by this crate’s single adapter.
The block model follows the atrep markup language (litogramma’s
koine core): every block is (kind, taxis?, lemma?, body, hypograph?) — the lemma is the head or title, the hypograph the
footer or attribution, and a paragraph is the degenerate
lemma-less, hypograph-less block. Producers (quarb-text-html,
quarb-text-markdown, the built-in plain-text reader) lower
their format into the Block event stream; this crate derives
the section tree and implements the adapter once, so
//section[::lemma ...], //paragraph, and //blockquote read
identically over any text substrate — including an atrep
document mounted by quarb-atrep.
- Node names are the structural kinds:
section,paragraph,blockquote,unordered-list,ordered-list,unordered-item,ordered-item,verbatim. ::lemma,::hypograph, and::taxisare properties; bare::(and::text) is the flattened prose of the subtree, lemma first, hypograph last.::::levelon a section is the source heading level;::::langon a verbatim block is its declared language.- Sections are derived from the flat heading stream by the outline rule: a heading closes every open section at its level or deeper, then opens a section under the nearest shallower one. Content before the first heading belongs to the document root. A heading inside an open container (blockquote, list) is decorative, not sectioning: it lowers to a paragraph of its text.
- Every kind admits
::lemma,::taxis, and::hypograph— the atrep model, where these are universal affordances of a block rather than privileges of particular kinds. - Tables denormalize into nested lists: an
ordered-listcarrying the<table>trait (::lemma= the caption), oneordered-itemper row (::taxis= row number,<row>trait), oneunordered-itemper cell (<cell>trait) whose::lemmais the column name — from the header row in grids, from the row’sthlabel otherwise; headerless cells carry no lemma. A lemma’d item flattens aslemma: prose, so a row exists, the bare cell text otherwise. Empty cells are skipped.
Modules§
- render
- Re-export of the koine renderer, which moved into the engine
core when
| markdown/| html/| atrepbecame pipeline stages (the stage and the export button are the same verb). The extension, the wasm builds, and the notebook exporters keep theirquarb_text::render_*paths through this shim.
Structs§
- Cell
- One table cell as a producer hands it over: the text, plus the
label a row-shaped dialect attaches directly (an infobox row’s
th). Grid dialects leavelabelempty and let the lowering zip the header row on by position. - Text
Model - A Quarb adapter over a text-level document.
Enums§
- Block
- A block-level event in the text-level vocabulary — what a format producer emits. Headings arrive flat; the section tree is derived here, once, for every producer.
- Container
- The nesting containers a producer opens and closes explicitly.
- Render
- The output markup of a render call.
Functions§
- normalize_
ws - Collapse whitespace runs to single spaces and trim — the prose normalization producers apply to inline content. Verbatim text is the exception: it is kept as authored.
- render_
node - Render one subtree. For litogramma the document opens with
its dialektos declaration, so every rendered subtree is a
valid
.atdfrom byte one. - render_
nodes - Render each node’s subtree in order, blank-line separated.