Skip to main content

Crate quillmark

Crate quillmark 

Source
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();

Re-exports§

pub use orchestration::Quillmark;

Modules§

orchestration
Orchestration

Structs§

Artifact
An artifact produced by rendering.
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.
CardReader
A single composable card bound to its CardSchema, from TypedReader::card. Same get / get_body verbs as TypedReader, reading the card at its bound index.
CardSchema
Schema definition for a card kind (composable content blocks)
ChangeBundle
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.
ChangeSet
What a committed LiveSession::apply changed.
Content
One content field as a content: the text plus the structure that rides on it.
ContentHit
A resolved point → content position: the schema field a click landed in and the USV offset into that field’s Content. The forward position_at direction, paired with locate (content position → caret rect).
Delta
A per-field edit against a base content. Ops apply left-to-right, consuming base positions; Retain/Delete advance the base cursor, Insert adds new text. USV throughout.
Diagnostic
Structured diagnostic information.
Document
A fully-parsed Quillmark document. Serde routes through StoredDocument; for the plate wire shape see Document::to_plate_json.
FieldSchema
Schema definition for a template field.
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 apply. Reads between edits see a stable document (apply is transactional, swapping the compile only on success) so immutability is an invariant between commits, not a type.
Location
Parsed
The record of one load: the Document and any non-fatal warnings. Returned by both doors, the quill-free Document::parse and the bound Quill::parse, whose warnings carry the parse’s plus the conform::* ones. Warnings live here and only here: Document is the value (equality, the storage DTO, and mutators all exclude warnings); Parsed is the load event. A caller that wants only the document writes Document::parse(md)?.document.
Quill
Portable, validated quill data: the file bundle, parsed config, and metadata of an authored quill, tagged with its declared backend id.
QuillConfig
Top-level configuration for a Quillmark project
QuillIgnore
Simple gitignore-style pattern matcher for .quillignore
QuillReference
Complete reference to a Quill template with name and version selector.
QuillValue
Unified value type: an annotated tree of JSON-shaped data where every node additionally records whether it was tagged !must_fill.
RenderError
Main error type for rendering operations: a non-empty collection of Diagnostics.
RenderOptions
Internal rendering options.
RenderResult
RenderedRegion
One schema field placement’s extent on a rendered page.
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.

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.
EditError
Errors returned by document and card mutators.
FieldType
Field type hint enum for type-safe field type definitions.
FileTreeNode
A node in the file tree structure
HitGranularity
How precisely a ContentHit::pos resolved: the marker a caret UI reads to decide whether to trust the offset. The value is never sub-cluster; the two variants distinguish the finest this API offers from the segment floor it degrades to.
OutputFormat
Output formats supported by backends.
ParseError
ReadValue
The interpreted value at a field address: the output of TypedReader::get. A content field decodes to its codec’s projection (richtext to markdown, plaintext to literal text); every other declared type carries its canonical value verbatim (the transport read, reached through the schema). Absence is the None of the enclosing Option, not a variant here.
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.
ValidationError
Validation error with a structured field path.

Traits§

Backend
Backend trait for rendering different output formats.

Functions§

quill_from_path
Load a quill from a filesystem directory. Honours a root .quillignore, else a default ignore set. (The fs walk lives here; core stays fs-agnostic.)
quill_from_path_with_warnings
quill_from_path, keeping the config’s advisory diagnostics rather than dropping them: the door for a caller that reports them (quillmark validate -v).
tree_from_path
Walk a filesystem path into an in-memory FileTreeNode: the tree half of quill_from_path, for a caller that wants to edit the tree before Quill::from_tree reads it.