Expand description
§Quillmark
Quillmark is a schema-driven document framework that turns Markdown with card-yaml metadata blocks into a fully typeset document (PDF, SVG, PNG).
Quill::parse reads Markdown and conforms it to the quill’s schema.
use quillmark::{quill_from_path, CalendarDate, Engine, OutputFormat, RenderOptions};
let quill = quill_from_path("path/to/quill").unwrap();
let engine = Engine::new();
let today = CalendarDate::new(2026, 3, 14).unwrap(); // the host's local date
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, today, &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();Modules§
- typst_
workspace - The files Typst’s own tooling needs to compile a plate outside Quillmark.
Structs§
- Anchor
Read - Answered by
Card::annotatedand the content crate’s anchor reads, so nameable from here. One anchor of anAnnotatedread. - Anchor
Selector - A prose anchor’s context at its address: the selector a host stores beside
a comment thread, flat as
DocumentAnchoris. - Annotated
- Answered by
Card::annotatedand the content crate’s anchor reads, so nameable from here. Ato_markdown_annotatedread. - Annotated
Markdown - The read
Document::to_markdown_annotatedreturns. - Artifact
- An artifact produced by rendering.
- Calendar
Date - A calendar date: the render date a host supplies to a compile.
- Card
- A single card-yaml block (root or composable).
bodyis theContentof the prose after the closing fence: the empty content when none follows. Markdown is a projection:Card::body_markdownre-emits it. - Card
Added - What
TypedWriter::add_cardanswers: the placed card’s$idand the warnings its fields and body raised. - CardMut
- The mutable handle on a card already placed in a
Document: every&mut selfverbCardcarries, forwarded, and no way to replace the card itself. Reads arrive throughDeref. - Card
Reader - A single card bound to its
CardSchema, fromTypedReader::cardorTypedReader::at. Same verbs asTypedReader, reading the card it binds. - Card
Schema - Schema definition for a card kind (composable content blocks)
- Change
- An edit of a value: steps applied in turn, all or none.
- Change
Set - What a committed
LiveSession::updatechanged. - Content
- The content model: the value every body and content field holds, and what every content read answers and every content write takes. One content field.
- Content
Hit - A resolved point → content position: the schema field a click landed in and
the scalar offset into that field’s
Content. The forwardposition_atdirection, paired withlocate(content position → caret rect). - Diagnostic
- Structured diagnostic information.
- DocPath
- A canonical document-model path: an ordered
DocSeglist with oneDisplayserializer and oneFromStrparser. The grammar is in the module docs. - Document
- A fully-parsed Quillmark document. Serde routes through
StoredDocument. - Document
Anchor - One anchor of an
AnnotatedMarkdownread. - Document
Revised - The receipt of
Document::revise. - Dropped
- An anchor a change dropped: its context as it read before, and the slot that held it.
- Engine
- 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. - Field
Coverage - One schema address a compiled document fills, and the region address a click reaches it through.
- Field
Schema - Schema definition for a template field.
- Font
Face - One face a session sets text in, with what an editor needs to draw text in it: its family, its variant, and the file holding it.
- Font
Library - The faces a host supplies, every one readable. Frozen at construction: a session sees the library as it was when the engine was built.
- 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. - Located
- Where an offset sits: the block holding it, by id and index, and that block’s container path, outermost first.
- Location
- Moved
- A surviving anchor a change moved: the text it covered before and after, and what moved.
- Parse
Date Error - A string that is not a
CalendarDate: malformed, orYYYY-MM-DDnaming a day the calendar lacks (2026-02-30). - 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 - A
$quillreference:[<collection>.]<name>[@<selector>]. - Quill
Value - Unified value type for JSON-shaped data.
- Reattached
- Returned by
Document::reattach, so nameable from here. The receipt of a re-attachment, over whichever selector type the caller gave: each selector in the order given, reattached with its refreshed context or orphaned as it came. - Receipt
- What a write did.
- Render
Error - Main error type for rendering operations: a non-empty collection of
Diagnostics, the first an error. ASeverity::Warningafter the errors is one the failing stage raised before it failed, carried because it can explain the failure. - Render
Options - Options for one render.
- Render
Result - Rendered
Region - One schema field placement’s extent on a rendered page.
- Stale
Base - A write refused by its base: the value no longer hashes to what the writer read. It carries the hash of the value stored now, which a writer checks its next read against; retrying the same write under it would land the revert the base refused.
- 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. - Unchecked
- The writes on a
Documentthat no quill schema checks, fromDocument::unchecked: a field stored with no type coercion, and a card placed whole. Each still holds every invariant the document does: names, the §8 bounds, card ids, and each content value decoded as a body write decodes one and stored in its canonical form, so==, the stored bytes and the markdown export agree for a field as they do for a body. The schema-checked writes areQuill::writer’s. - Write
Options - What a write reads besides its edit.
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
- How a write builds its change from the value its writer read.
- Edit
Error - Errors returned by document and card mutators.
- Field
Type - A field’s declared
type:. Each type’s meaning and grammar:docs/quills/quill-yaml-reference.md§ “Field Types”. - 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. Why an import refused its markdown. - Move
Reason - What moved about an anchor, the first of these that holds.
- 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.
- 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. - Target
- The value a write reaches on its card.
- Validation
Error - Validation error with a structured field path. A variant carries enough for
Displayto render one shape of message: the field’s path, the source token verbatim, the declared type and default, and both ways out.
Constants§
- BUNDLE_
EXTENSION - The extension a bundle’s file name ends in, without its dot.
- DOCUMENT_
FILE - The document a
ParseErrorpoints at. Markdown reaches core as a string, so the anchor names the input rather than a path on disk.
Traits§
- Backend
- Backend trait for rendering different output formats.
Functions§
- acroform_
check_ form - The refusal
openraises for the quill’sform.pdforForm.yaml, if any: each is present, the spec parses, and every widget binds against the schema and the background’s pages. Nothing is stamped or rendered. - coverage
- Each address of the plate JSON
data(asQuillConfig::compile_databuilds it underconfig) that a reader could want to click, with whatregions(the same compile’s) reaches it through: every declared leaf holding a non-blank value — scalars, dates, content and bodies, array elements, container properties, a variant’s discriminant — every roster member of a matrix, held or not, and each added item’s cells. In walk order: the main card’s fields in declaration order, its body, then each card. - plate_
addr_ to_ doc_ path - Translate a backend plate-space geometry address into a canonical
DocPath, resolving the per-kind ordinal to the absolute card index viacard_kinds. The grammar is what geometry emits:$body,<tail>(main), and$cards.<kind>.<ord>.<tail>.Nonefor an address outside it, or one naming a card the kind list cannot place. - quill_
from_ path - Load a quill from a filesystem directory, skipping what
QuillIgnoreexcludes, or from a.quillbundle file, read whole asQuill::from_bundlereads it. - 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. - typst_
plate_ file - The plate’s path from the quill root as a render reads it, or the refusal a
render’s
openraises for it:typst.plate_filewhere the quill declares it, elseplate.typ. - typst_
version - The release of the linked Typst compiler, which a plate reads as
sys.version.