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//! - **Template model**: [`Quill`] type for managing template bundles with in-memory file system
11//! - **Backend trait**: Extensible interface for implementing output format backends
12//! - **Error handling**: Structured diagnostics with source location tracking
13//! - **Utilities**: TOML⇄YAML conversion helpers
14//!
15//! ## Quick Start
16//!
17//! ```no_run
18//! use quillmark_core::{ParsedDocument, Quill};
19//!
20//! // Parse markdown with frontmatter
21//! let markdown = "---\ntitle: Example\n---\n\n# Content";
22//! let doc = ParsedDocument::from_markdown(markdown);
23//!
24//! // Load a quill template
25//! let quill = Quill::from_path("path/to/quill").unwrap();
26//! ```
27//!
28//! ## Architecture
29//!
30//! The crate is organized into modules:
31//!
32//! - [`parse`]: Markdown parsing with YAML frontmatter support
33//! - [`backend`]: Backend trait for output format implementations
34//! - [`error`]: Structured error handling and diagnostics
35//! - [`types`]: Core rendering types (OutputFormat, Artifact, RenderOptions)
36//! - [`quill`]: Quill template bundle and related types
37//!
38//! ## Further Reading
39//!
40//! - [PARSE.md](https://github.com/nibsbin/quillmark/blob/main/designs/PARSE.md) - Detailed parsing documentation
41//! - [Examples](https://github.com/nibsbin/quillmark/tree/main/examples) - Working examples
42
43pub mod parse;
44pub use parse::{ParsedDocument, BODY_FIELD};
45
46pub mod backend;
47pub use backend::Backend;
48
49pub mod error;
50pub use error::{
51 Diagnostic, Location, ParseError, RenderError, RenderResult, SerializableDiagnostic, Severity,
52};
53
54pub mod types;
55pub use types::{Artifact, OutputFormat, RenderOptions};
56
57pub mod quill;
58pub use quill::{FileTreeNode, Quill, QuillIgnore};
59
60pub mod value;
61pub use value::QuillValue;
62
63pub mod schema;
64
65pub mod normalize;
66pub use normalize::{
67 normalize_document, normalize_fields, normalize_markdown, strip_bidi_formatting,
68 NormalizationError,
69};
70
71pub mod version;
72pub use version::{QuillReference, Version, VersionSelector};