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
//! HTML to Markdown/Djot conversion functions.
//!
//! This module provides HTML to Markdown and Djot conversion using the `html-to-markdown-rs` library.
//! It supports inline image extraction and YAML frontmatter parsing for HTML metadata.
//!
//! # Features
//!
//! - **HTML to Markdown/Djot conversion**: Clean, readable Markdown or Djot output
//! - **Inline image extraction**: Extract base64 and data URI images
//! - **YAML frontmatter**: Parse YAML metadata from Markdown output
//! - **Customizable conversion**: Full access to `html-to-markdown-rs` options
//! - **Output format selection**: Choose between Markdown and Djot formats
//!
//! # Example
//!
//! ```rust
//! use kreuzberg::extraction::html::convert_html_to_markdown;
//! use kreuzberg::core::config::OutputFormat;
//!
//! # fn example() -> kreuzberg::Result<()> {
//! let html = r#"<h1>Title</h1><p>This is <strong>bold</strong> text.</p>"#;
//!
//! // Convert to Markdown (default)
//! let markdown = convert_html_to_markdown(html, None, None)?;
//! assert!(markdown.contains("# Title"));
//! assert!(markdown.contains("**bold**"));
//!
//! // Convert to Djot
//! let djot = convert_html_to_markdown(html, None, Some(OutputFormat::Djot))?;
//! assert!(djot.contains("# Title"));
//! assert!(djot.contains("*bold*")); // Djot uses * for strong
//! # Ok(())
//! # }
//! ```
pub
// Public API re-exports
pub use convert_html_to_markdown;
pub use convert_html_to_markdown_with_metadata;
pub use convert_html_to_markdown_with_tables;
pub use map_output_format;
pub use ;
pub use ;
// Re-export from html-to-markdown-rs for convenience
pub use ConversionOptions;