quillmark_core/
lib.rs

1//! # Quillmark Core Overview
2//!
3//! Core types and functionality for the Quillmark template-first Markdown rendering system.
4//!
5//! ## Features
6//!
7//! This crate provides the foundational types and traits for Quillmark:
8//!
9//! - **Parsing**: YAML frontmatter extraction with Extended YAML Metadata Standard support
10//! - **Templating**: MiniJinja-based template composition with stable filter API
11//! - **Template model**: [`Quill`] type for managing template bundles with in-memory file system
12//! - **Backend trait**: Extensible interface for implementing output format backends
13//! - **Error handling**: Structured diagnostics with source location tracking
14//! - **Utilities**: TOML⇄YAML conversion helpers
15//!
16//! ## Quick Start
17//!
18//! ```no_run
19//! use quillmark_core::{ParsedDocument, Quill};
20//!
21//! // Parse markdown with frontmatter
22//! let markdown = "---\ntitle: Example\n---\n\n# Content";
23//! let doc = ParsedDocument::from_markdown(markdown);
24//!
25//! // Load a quill template
26//! let quill = Quill::from_path("path/to/quill").unwrap();
27//! ```
28//!
29//! ## Architecture
30//!
31//! The crate is organized into modules:
32//!
33//! - [`parse`]: Markdown parsing with YAML frontmatter support
34//! - [`templating`]: Template composition using MiniJinja
35//! - [`backend`]: Backend trait for output format implementations
36//! - [`error`]: Structured error handling and diagnostics
37//! - [`types`]: Core rendering types (OutputFormat, Artifact, RenderOptions)
38//! - [`quill`]: Quill template bundle and related types
39//!
40//! ## Further Reading
41//!
42//! - [PARSE.md](https://github.com/nibsbin/quillmark/blob/main/designs/PARSE.md) - Detailed parsing documentation
43//! - [Examples](https://github.com/nibsbin/quillmark/tree/main/examples) - Working examples
44
45pub mod parse;
46pub use parse::{ParsedDocument, BODY_FIELD};
47
48pub mod templating;
49pub use templating::{Glue, TemplateError};
50
51pub mod backend;
52pub use backend::Backend;
53
54pub mod error;
55pub use error::{
56    Diagnostic, Location, ParseError, RenderError, RenderResult, SerializableDiagnostic, Severity,
57};
58
59pub mod types;
60pub use types::{Artifact, OutputFormat, RenderOptions};
61
62pub mod quill;
63pub use quill::{FileTreeNode, Quill, QuillIgnore};
64
65pub mod value;
66pub use value::QuillValue;
67
68pub mod schema;