Skip to main content

Crate ucp_translator_html

Crate ucp_translator_html 

Source
Expand description

HTML to UCM document translator.

This crate provides translation from HTML documents to UCM’s block-based document model. It extracts semantic structure from HTML elements and creates appropriate blocks with proper hierarchy.

§Example

use ucp_translator_html::{HtmlParser, HtmlParserConfig};

let html = r#"<html><body>
    <h1>Title</h1>
    <p>Some content here.</p>
</body></html>"#;

let parser = HtmlParser::new();
let doc = parser.parse(html).unwrap();

Structs§

HtmlParser
HTML to UCM document parser
HtmlParserConfig
Configuration for HTML parsing

Enums§

HeadingStrategy
Strategy for handling heading levels
HtmlError
HTML translation error

Functions§

parse_html
Parse HTML string into a UCM Document.

Type Aliases§

Result
Result type for HTML translation