Expand description
Content: the canonical content model for Quillmark.
One model::Content per content field: a single text sequence carrying
line attributes, anchored marks, and embedded islands, over one coordinate
space of Unicode scalar values. Markdown is a projection
(import::from_markdown, export::to_markdown), so every edit is a
splice and all structure moves with it. serial is the canonical,
byte-deterministic JSON that storage, the render seam and the binding seam
all carry; delta and ops are the per-field edit surface.
Modules§
- delta
- The per-field edit surface: a
Deltaof text splices over the USV content, plus the stale-text writer path, cold-parse a full new markdown document, char-diff it against the base, and rebase the base’s non-formatting marks (anchors/comments) through the diff so annotations survive an LLM full-document rewrite with no preservation contract on the LLM. - export
- Markdown export: content → markdown, per island type.
- import
- Markdown import (cold):
normalize → pulldown → content. - island
- Island types: the dispatch authority over
Island::island_type. - model
- The
Contentcontent model: one text sequence per field carrying line attributes, anchored marks, and embedded islands, over a single coordinate space of Unicode scalar values (Rustchar). - normalize
- Markdown-string preprocessing run before parsing, at the
from_markdownboundary. - ops
- Island, line and mark op channels: structural edits separate from text
splices. All three apply after
Content::apply_text_deltain oneChangeBundle, in that order; mark ranges are in final-text coordinates. - serial
- Canonical JSON serialization: the freeze.
- traverse
- The loops that group adjacent lines: by container, applying the rule
Container::same_runstates, and by continuation. - usv
- USV → UTF-8 byte conversion:
Contentpositions count Unicode scalar values, Rust slicing needs byte offsets.
Constants§
- MAX_
JSON_ DEPTH - Maximum nesting depth of an opaque JSON payload (an island’s
props), in container levels from the bag. - MAX_
NESTING_ DEPTH - Maximum container nesting depth the markdown codecs accept before erroring.
The import guard (
import::from_markdown) and the typst backend’s markup converter share this one limit, so a document that imports also renders.