quillmark_core/lib.rs
1//! # Quillmark Core Overview
2//!
3//! Core types and functionality for the Quillmark format-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//! - **Format model**: [`Quill`] type for managing format 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;
19//!
20//! // Parse markdown with frontmatter
21//! let markdown = "---\ntitle: Example\n---\n\n# Content";
22//! let doc = ParsedDocument::from_markdown(markdown);
23//!
24//! ```
25//!
26//! ## Architecture
27//!
28//! The crate is organized into modules:
29//!
30//! - [`parse`]: Markdown parsing with YAML frontmatter support
31//! - [`backend`]: Backend trait for output format implementations
32//! - [`error`]: Structured error handling and diagnostics
33//! - [`types`]: Core rendering types (OutputFormat, Artifact, RenderOptions)
34//! - [`quill`]: Quill format bundle and related types
35//!
36//! ## Further Reading
37//!
38//! - [PARSE.md](https://github.com/nibsbin/quillmark/blob/main/designs/PARSE.md) - Detailed parsing documentation
39//! - [Examples](https://github.com/nibsbin/quillmark/tree/main/examples) - Working examples
40
41pub mod parse;
42pub use parse::{ParsedDocument, BODY_FIELD};
43
44pub mod backend;
45pub use backend::Backend;
46
47pub mod error;
48pub use error::{
49 Diagnostic, Location, ParseError, RenderError, RenderResult, SerializableDiagnostic, Severity,
50};
51
52pub mod types;
53pub use types::{Artifact, OutputFormat, RenderOptions};
54
55pub mod session;
56pub use session::RenderSession;
57
58pub mod quill;
59pub use quill::{FileTreeNode, Quill, QuillIgnore};
60
61pub mod value;
62pub use value::QuillValue;
63
64pub mod normalize;
65pub use normalize::{
66 normalize_document, normalize_fields, normalize_markdown, strip_bidi_formatting,
67 NormalizationError,
68};
69
70pub mod version;
71pub use version::{QuillReference, Version, VersionSelector};