Skip to main content

oxipdf_html/
lib.rs

1//! `oxipdf-html` — HTML+CSS → `StyledTree` adapter for oxipdf.
2//!
3//! Parses HTML5 documents and CSS stylesheets, resolves the cascade,
4//! and produces a `StyledTree` that the oxipdf engine can render to PDF.
5//!
6//! # Example
7//!
8//! ```ignore
9//! use oxipdf_html::html_to_tree;
10//!
11//! let html = r#"<h1>Hello</h1><p>World</p>"#;
12//! let tree = html_to_tree(html).unwrap();
13//! ```
14//!
15//! This crate is a consumer of `oxipdf-ir`, not part of the core engine.
16//! It sits in the same position as `oxidoc-export` — building a `StyledTree`
17//! from an input format.
18
19#[path = "convert/mod.rs"]
20mod convert;
21#[path = "css/mod.rs"]
22mod css;
23mod elements;
24mod error;
25
26pub use convert::{ConvertOptions, html_to_tree, html_to_tree_with_css, html_to_tree_with_options};
27pub use error::HtmlError;