Skip to main content

Crate quillmark_content

Crate quillmark_content 

Source
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 Delta of 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 Content content model: one text sequence per field carrying line attributes, anchored marks, and embedded islands, over a single coordinate space of Unicode scalar values (Rust char).
normalize
Markdown-string preprocessing run before parsing, at the from_markdown boundary.
ops
Island, line and mark op channels: structural edits separate from text splices. All three apply after Content::apply_text_delta in one ChangeBundle, 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_run states, and by continuation.
usv
USV → UTF-8 byte conversion: Content positions 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.