Expand description
§Quillmark
Quillmark is a schema-driven document engine that turns Markdown with card-yaml metadata blocks into a fully typeset document (PDF, SVG, PNG).
Markdown enters through the bound door: Quill::parse conforms the
document against the quill that will render it.
use quillmark::{quill_from_path, OutputFormat, Quillmark, RenderOptions};
let quill = quill_from_path("path/to/quill").unwrap();
let engine = Quillmark::new();
let doc = quill.parse("~~~\n$quill: my_quill\n$kind: main\ntitle: Hello\n~~~\n\n# Hello World").unwrap().document;
let result = engine.render(&quill, &doc, &RenderOptions::default().with_output_format(OutputFormat::Pdf)).unwrap();Or no Markdown at all: a blank canvas and the schema-bound writer.
use quillmark::{quill_from_path, Document};
let quill = quill_from_path("path/to/quill").unwrap();
let mut doc = Document::new("my_quill".parse().unwrap());
let mut writer = quill.writer(&mut doc);
writer.set("title", "Hello").unwrap();Structs§
- Artifact
- An artifact produced by rendering.
- Card
- A single card-yaml block (root or composable).
bodyis the content (Content) form of the prose after the closing fence: the empty content when none follows; checkcard.body().is_blank(). Markdown is a projection:Card::body_markdownre-emits it. - Card
Reader - A single composable card bound to its
CardSchema, fromTypedReader::card. Sameget/body_markdownverbs asTypedReader, reading the card at its bound index. - Card
Schema - Schema definition for a card kind (composable content blocks)
- Change
Bundle - One committed field edit: a text delta and the three op channels, applied in
field order (delta → islands → lines → marks) by
Content::apply_field_change.Defaultis the identity bundle, so a caller names only the channels it uses:ChangeBundle { delta, ..Default::default() }. - Change
Set - What a committed
LiveSession::updatechanged. - Content
- The canonical content model, the pre-built value the document mutators accept, and the canonical-form token every content read answers in. One content field as a content: the text plus the structure that rides on it.
- Content
Hit - A resolved point → content position: the schema field a click landed in and
the USV offset into that field’s
Content. The forwardposition_atdirection, paired withlocate(content position → caret rect). - 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. - Diagnostic
- Structured diagnostic information.
- Document
- A fully-parsed Quillmark document. Serde routes through
StoredDocument. - Field
Schema - Schema definition for a template field.
default:answers both the value axis and the obligation one (must_fill);SCHEMAS.md§“Value and obligation: one declaration” is the rule. - Live
Session - Opaque, backend-backed live render session: a persistent compiler that
serves reads (
render,paintseams,regions) from its current compile and takes edits viaupdate. Reads between edits see a stable document (updateis transactional, swapping the compile only on success) so immutability is an invariant between commits, not a type. - Location
- Normalized
- The canonical content model, the pre-built value the document mutators
accept, and the canonical-form token every content read answers in.
A
ContentthatContent::normalizehas run on: the precondition both projections carry. Minted only byContent::into_normalized, which the codecs decode through; a mutation that does not re-establish the invariant takesinto_contentand mints again. - Parsed
- The record of one load: the
Documentand any non-fatal warnings. Returned by bothDocument::parseand the boundQuill::parse, whosewarningsalso carry theconform::*ones. Warnings live here and only here:Documentis the value,Parsedthe load event. - Quill
- Portable, validated quill data: the file bundle and parsed config of an authored quill, tagged with its declared backend id.
- Quill
Config - Top-level configuration for a Quillmark project
- Quill
Ignore - Quill
Reference - Complete reference to a Quill template with name and version selector.
- Quill
Value - Unified value type: JSON-shaped data beside the paths of the nodes tagged
!must_fill. - Quillmark
- A backend registry and render dispatcher: the sole home of
backend-dependent surface, resolving a
Quill’s declared backend at render time. Quill loading needs no engine — seeQuill::from_treeorquill_from_path. - Render
Error - Main error type for rendering operations: a non-empty collection of
Diagnostics. - Render
Options - Internal rendering options.
- Render
Result - Rendered
Region - One schema field placement’s extent on a rendered page.
- Typed
Reader - A
Documentbound to itsQuillConfigfor typed reads. Construct withQuill::reader. Reads target the main card; usecardfor a composable card. The read twin ofTypedWriter. - Typed
Writer - A
Documentbound to itsQuillConfigfor typed writes. Construct withQuill::writer. Writes target the main card; usecardfor a composable card.
Enums§
- Bound
Parse Error - The failure of the bound door (
Quill::parse): the markdown did not parse, or it parsed under a$quillthis quill does not answer to. Nothing conforms under the wrong schema, so the mismatch is an error and not a warning;to_diagnosticsflattens either half for a consumer that only routes on codes. - Edit
Error - Errors returned by document and card mutators.
- Field
Type - A field’s declared
type:. Each type’s meaning and grammar is theSCHEMAS.md§“Quill.yaml DSL” table. - File
Tree Node - A node in a quill bundle’s file tree. Out-of-crate callers build these;
Quill::from_treetakes one. Symlinks are refused at the loader rather than modelled here. - HitGranularity
- How precisely a
ContentHit::posresolved. Never sub-cluster. - Import
Error - Carried by
EditError::Import, so nameable from here. Import errors: just the nesting guard. - Output
Format - Parse
Error - Path
Segment - One step of a path into a value tree: an object key or an array index. The canonical path-segment type for the whole crate, covering nested-comment and nested-fill paths alike.
- Severity
- Fatality is this two-value ladder and nothing else:
Errorblocks the stage that emits it,Warningnever does. There is no lint-level configuration and no warning-to-error promotion; an informational aside is aDiagnostic::hint, not a severity. - Validation
Error - Validation error with a structured field path. A variant carries enough for
Displayto render the uniform messageERROR.md§ “Validation message contract” describes.
Traits§
- Backend
- Backend trait for rendering different output formats.
Functions§
- quill_
from_ path - Load a quill from a filesystem directory, skipping what
QuillIgnoreexcludes. - tree_
from_ path - Walk a filesystem path into an in-memory
FileTreeNode, for a caller that wants to edit the tree beforeQuill::from_treereads it. Skips whatQuillIgnoreexcludes.