Expand description
§Quillmark Core
Foundational types and traits for the Quillmark schema-driven document
engine: card-yaml block parsing (~~~ metadata blocks), the Quill
format bundle and its in-memory file tree, the Backend trait for output
backends, and structured diagnostics with source-location tracking.
use quillmark_core::Document;
// Parse markdown with a card-yaml metadata block
let markdown = "~~~\n$quill: my_quill\n$kind: main\ntitle: Example\n~~~\n\n# Content";
let doc = Document::parse(markdown).unwrap().document;
let title = doc.main()
.payload()
.get("title")
.and_then(|v| v.as_str())
.unwrap_or("Untitled");
assert_eq!(title, "Example");§Further Reading
- markdown-spec.md - Quillmark Markdown parsing specification
- Examples - Working examples
Re-exports§
pub use document::Card;pub use document::CardWire;pub use document::Document;pub use document::EditError;pub use document::Parsed;pub use document::Payload;pub use document::PayloadItem;pub use document::PayloadItemWire;pub use document::RichtextDecodeError;pub use document::SeedOverlay;pub use document::WireError;pub use writer::CardWriter;pub use writer::TypedWriter;pub use reader::CardReader;pub use reader::ReadValue;pub use reader::TypedReader;pub use backend::formats_support_canvas;pub use backend::Backend;pub use error::Diagnostic;pub use error::Location;pub use error::ParseError;pub use error::RenderError;pub use error::RenderResult;pub use error::Severity;pub use types::Artifact;pub use types::OutputFormat;pub use types::RenderOptions;pub use region::field_boxes;pub use region::ContentHit;pub use region::HitGranularity;pub use region::RenderedRegion;pub use session::ChangeSet;pub use session::LiveSession;pub use quill::zero_value;pub use quill::FileTreeNode;pub use quill::Quill;pub use quill::QuillIgnore;pub use quill::STANDARD_METADATA_KEYS;pub use value::json_depth_exceeds;pub use value::PathSegment;pub use value::QuillValue;pub use version::quill_ref_hint;pub use version::QuillReference;pub use version::Version;pub use version::VersionSelector;
Modules§
- backend
- Backend trait for output backends.
- document
- Parsing and typed in-memory model for Quillmark card-yaml documents.
- error
- Error Handling
- normalize
- Document Normalization
- quill
- The
Quilltype — portable, validated quill data. - reader
- Schema-bound typed reader — the read twin of
TypedWriter. - region
- Schema-field geometry, queried from a compiled
LiveSessionviaregionsandfield_at. - session
- types
- Core types for rendering and output formats.
- value
- Value type for unified representation of TOML/YAML/JSON values.
- version
- Version Management
- writer
- Schema-bound typed writer — the front door for typed field writes.
Structs§
- Content
- The canonical content model — re-exported so consumers of the
document mutators (
Card::install_body,Card::apply_body_change) can name the type without depending onquillmark-contentdirectly. One content field as a content: the text plus the structure that rides on it. - Delta
- A per-field edit against a base content. Ops apply left-to-right, consuming
base positions;
Retain/Deleteadvance the base cursor,Insertadds new text. USV throughout.
Enums§
- Apply
Error - Why an apply failed — range or line index out of bounds, or invariants broken before normalization could repair them.
- Assoc
- Which side of a same-position insertion a mapped point lands on. Serializes
as
"before"/"after". - LineOp
- A line/block edit. Split/join splice
\nintext; set ops touch metadata only. - MarkOp
- A mark edit in final-text coordinates (post-delta, post-line-op).
- Op
- One delta operation. Serializes externally-tagged with a lowercase key
(
{"retain": 5},{"insert": "x"},{"delete": 2}).