Skip to main content

Crate quillmark

Crate quillmark 

Source
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§

AnchorRead
Answered by Card::annotated and the content crate’s anchor reads, so nameable from here. One anchor of an Annotated read.
AnchorSelector
A prose anchor’s context at its address: the selector a host stores beside a comment thread, flat as DocumentAnchor is.
Annotated
Answered by Card::annotated and the content crate’s anchor reads, so nameable from here. A to_markdown_annotated read.
AnnotatedMarkdown
The read Document::to_markdown_annotated returns.
Artifact
An artifact produced by rendering.
CalendarDate
A calendar date: the render date a host supplies to a compile.
Card
A single card-yaml block (root or composable). body is the Content of the prose after the closing fence: the empty content when none follows. Markdown is a projection: Card::body_markdown re-emits it.
CardAdded
What TypedWriter::add_card answers: the placed card’s $id and the warnings its fields and body raised.
CardMut
The mutable handle on a card already placed in a Document: every &mut self verb Card carries, forwarded, and no way to replace the card itself. Reads arrive through Deref.
CardReader
A single card bound to its CardSchema, from TypedReader::card or TypedReader::at. Same verbs as TypedReader, reading the card it binds.
CardSchema
Schema definition for a card kind (composable content blocks)
Change
An edit of a value: steps applied in turn, all or none.
ChangeSet
What a committed LiveSession::update changed.
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.
ContentHit
A resolved point → content position: the schema field a click landed in and the scalar offset into that field’s Content. The forward position_at direction, paired with locate (content position → caret rect).
Diagnostic
Structured diagnostic information.
DocPath
A canonical document-model path: an ordered DocSeg list with one Display serializer and one FromStr parser. The grammar is in the module docs.
Document
A fully-parsed Quillmark document. Serde routes through StoredDocument.
DocumentAnchor
One anchor of an AnnotatedMarkdown read.
DocumentRevised
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 — see Quill::from_tree or quill_from_path.
FieldCoverage
One schema address a compiled document fills, and the region address a click reaches it through.
FieldSchema
Schema definition for a template field.
FontFace
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.
FontLibrary
The faces a host supplies, every one readable. Frozen at construction: a session sees the library as it was when the engine was built.
LiveSession
Opaque, backend-backed live render session: a persistent compiler that serves reads (render, paint seams, regions) from its current compile and takes edits via update. Reads between edits see a stable document (update is 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.
ParseDateError
A string that is not a CalendarDate: malformed, or YYYY-MM-DD naming a day the calendar lacks (2026-02-30).
Parsed
The record of one load: the Document and any non-fatal warnings. Returned by both Document::parse and the bound Quill::parse, whose warnings also carry the conform::* ones. Warnings live here and only here: Document is the value, Parsed the load event.
Quill
Portable, validated quill data: the file bundle and parsed config of an authored quill, tagged with its declared backend id.
QuillConfig
Top-level configuration for a Quillmark project
QuillIgnore
QuillReference
A $quill reference: [<collection>.]<name>[@<selector>].
QuillValue
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.
RenderError
Main error type for rendering operations: a non-empty collection of Diagnostics, the first an error. A Severity::Warning after the errors is one the failing stage raised before it failed, carried because it can explain the failure.
RenderOptions
Options for one render.
RenderResult
RenderedRegion
One schema field placement’s extent on a rendered page.
StaleBase
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.
TypedReader
A Document bound to its QuillConfig for typed reads. Construct with Quill::reader. Reads target the main card; use card for a composable card. The read twin of TypedWriter.
TypedWriter
A Document bound to its QuillConfig for typed writes. Construct with Quill::writer. Writes target the main card; use card for a composable card.
Unchecked
The writes on a Document that no quill schema checks, from Document::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 are Quill::writer’s.
WriteOptions
What a write reads besides its edit.

Enums§

BoundParseError
The failure of the bound door (Quill::parse): the markdown did not parse, or it parsed under a $quill this quill does not answer to. Nothing conforms under the wrong schema, so the mismatch is an error and not a warning; to_diagnostics flattens either half for a consumer that only routes on codes.
Edit
How a write builds its change from the value its writer read.
EditError
Errors returned by document and card mutators.
FieldType
A field’s declared type:. Each type’s meaning and grammar: docs/quills/quill-yaml-reference.md § “Field Types”.
FileTreeNode
A node in a quill bundle’s file tree. Out-of-crate callers build these; Quill::from_tree takes one. Symlinks are refused at the loader rather than modelled here.
HitGranularity
How precisely a ContentHit::pos resolved. Never sub-cluster.
ImportError
Carried by EditError::Import, so nameable from here. Why an import refused its markdown.
MoveReason
What moved about an anchor, the first of these that holds.
OutputFormat
ParseError
PathSegment
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: Error blocks the stage that emits it, Warning never does. There is no lint-level configuration and no warning-to-error promotion; an informational aside is a Diagnostic::hint, not a severity.
Target
The value a write reaches on its card.
ValidationError
Validation error with a structured field path. A variant carries enough for Display to 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 ParseError points 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 open raises for the quill’s form.pdf or Form.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 (as QuillConfig::compile_data builds it under config) that a reader could want to click, with what regions (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 via card_kinds. The grammar is what geometry emits: $body, <tail> (main), and $cards.<kind>.<ord>.<tail>. None for 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 QuillIgnore excludes, or from a .quill bundle file, read whole as Quill::from_bundle reads it.
tree_from_path
Walk a filesystem path into an in-memory FileTreeNode, for a caller that wants to edit the tree before Quill::from_tree reads it. Skips what QuillIgnore excludes.
typst_plate_file
The plate’s path from the quill root as a render reads it, or the refusal a render’s open raises for it: typst.plate_file where the quill declares it, else plate.typ.
typst_version
The release of the linked Typst compiler, which a plate reads as sys.version.