Skip to main content

Module document

Module document 

Source
Expand description

Parsing and typed in-memory model for Quillmark card-yaml documents.

A Document holds a root Card plus ordered composable cards; each card carries a Payload, source-ordered items (PayloadItem: $quill/$kind/$id metadata, user fields, and comments, in the order they appear in the block’s YAML content), and a Markdown body. Document::parse returns errors for malformed YAML, unclosed fences, a missing root $quill, or unknown $-prefixed system keys.

See markdown-spec.md for the card-yaml format specification.

Re-exports§

pub use dto::peek_schema_version;
pub use dto::StorageError;
pub use dto::StoredDocument;
pub use dto::SCHEMA_V0_93_0;
pub use edit::EditError;
pub use meta::is_valid_kind_name;
pub use meta::validate_composable_kind;
pub use meta::CardKindError;
pub use payload::MetaKey;
pub use payload::Payload;
pub use payload::PayloadItem;
pub use prescan::CommentPathSegment;
pub use wire::CardWire;
pub use wire::PayloadItemWire;
pub use wire::WireError;

Modules§

assemble
Assembly of card-yaml blocks into a Document.
dto
Versioned, storage-stable serialization for Document.
edit
Typed mutators for Document and Card with invariant enforcement.
emit
Canonical Markdown emission for Document.
fences
Line-oriented fence scanner for Quillmark card-yaml blocks.
limits
Nesting-depth budget for document parsing.
meta
Validation helpers for card-yaml $-prefixed system metadata.
payload
Unified payload representation.
wire
Canonical live wire form of a Card for language-binding APIs.

Structs§

Card
A single card-yaml block (root or composable). body is the content (Content) form of the prose after the closing fence: the empty content when none follows; check card.body().is_blank(). Markdown is a projection: Card::body_markdown re-emits it.
Document
A fully-parsed Quillmark document. Serde routes through StoredDocument; for the plate wire shape see Document::to_plate_json.
NestedComment
A comment inside a nested mapping or sequence.
Parsed
The record of one parse: the Document and any non-fatal warnings. Returned by Document::parse, the single parse entry. Warnings live here and only here: Document is the value (equality, the storage DTO, and mutators all exclude warnings); Parsed is the parse event. A caller that wants only the document writes Document::parse(md)?.document.
SeedOverlay
A parsed, per-kind seed overlay: the sparse fields (and optional body) a newly-added card of a given kind starts with. Built from a $seed[<kind>] entry of the main card’s Card::seed map via SeedOverlay::from_json, and layered over the quill’s schema-example seed by crate::Quill::seed_card (overlay › example › absent). The reserved inner key $body carries the body override; every other user field becomes an entry, while any other $-prefixed key is reserved and dropped.

Enums§

RichtextDecodeError
Which encoding a decode_richtext_value failure came from, so a call site can prefix its diagnostic per encoding without re-deriving the dispatch. Surfaced publicly as the error of Card::field_richtext.

Constants§

FORMAT_RULES
Authoring-format rules for the ~~~ card-yaml markdown surface.

Functions§

blueprint_instruction
Render the blueprint-instruction header with quill_name substituted in. Single source of truth for the prose so every binding shows identical text.