pub fn compile_html(
html: &str,
author_stylesheets: &[(Stylesheet, Origin)],
) -> ChapterExpand description
Compile HTML content to IR.
This is the main entry point for the compiler pipeline. Automatically detects XHTML and uses the appropriate parser.
§Arguments
html- The HTML content to parsestylesheets- Author stylesheets with their origins (user-agent stylesheet is added automatically)
§Returns
A Chapter containing the normalized content tree.
§Example
use boko::{compile_html, Stylesheet, Origin};
let html = "<p class='intro'>Welcome!</p>";
let css = ".intro { font-weight: bold; }";
let author = Stylesheet::parse(css);
let chapter = compile_html(html, &[(author, Origin::Author)]);