1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! Markdown parsing, frontmatter extraction, and content utilities.
//!
//! This crate provides generic content processing utilities used by all Fabryk
//! domains. It has no domain-specific logic — each domain defines its own
//! metadata types and uses these utilities for parsing.
//!
//! # Modules
//!
//! - [`markdown`]: Markdown parsing and frontmatter extraction
//! - [`markdown::frontmatter`]: YAML frontmatter extraction
//! - [`markdown::parser`]: Heading, paragraph, text extraction
//! - [`markdown::helpers`]: List and section extraction
//!
//! # Design Philosophy
//!
//! **Generic utilities, domain-specific types.** This crate provides:
//!
//! - YAML frontmatter extraction → returns `serde_yaml::Value`
//! - Markdown structure parsing → returns strings and enums
//! - Content helpers → returns strings and lists
//!
//! Domain crates (music-theory, math, etc.) define their own structs and
//! deserialize from the generic types.
//!
//! # Example
//!
//! ```rust
//! use fabryk_content::markdown::{extract_frontmatter, FrontmatterResult};
//! use serde::Deserialize;
//!
//! // Your domain-specific frontmatter
//! #[derive(Deserialize)]
//! struct MyMeta {
//! title: String,
//! category: Option<String>,
//! }
//!
//! let content = "---\ntitle: Hello\n---\n\nBody";
//! let result = extract_frontmatter(content).unwrap();
//! let meta: Option<MyMeta> = result.deserialize().unwrap();
//! assert_eq!(meta.unwrap().title, "Hello");
//! ```
// Re-export commonly used types
pub use ;
// Re-export HeadingLevel for convenience
pub use HeadingLevel;