Expand description
HTML document rendering for Cadmus.
This module provides two concrete document types that share a common
rendering pipeline through HtmlBase:
-
HtmlDocument— backed by the hand-rolledXmlParser. Node offsets are exact byte positions in the source string, which is required when reading positions, bookmarks, and annotations are persisted to disk. Used for standalone HTML files and EPUB spine chapters. -
Html5Document— backed by html5ever. Node offsets are synthetic. Used for ephemeral rendering (e.g. the dictionary view) where HTML5 conformance matters more than offset precision.
The shared HtmlBase struct holds the parsed XmlTree, the layout
Engine, the page cache, and stylesheet paths. Both document types
compose it and delegate all rendering operations to it.
Re-exports§
pub use html5::Html5Document;
Modules§
- css
- dom
- engine
- html5
Html5Document— an HTML document backed by the html5ever parser.- layout
- parse
- style
- xml
- HTML and XML parsers that produce an
XmlTree.
Structs§
- Html
Base 🔒 - Parser-independent rendering state shared by
HtmlDocumentandHtml5Document. - Html
Document - HTML document backed by the hand-rolled
XmlParser.
Constants§
- USER_
STYLESHEET 🔒 - Path to the user-editable stylesheet overlaid on top of the viewer styles.
- VIEWER_
STYLESHEET 🔒 - Path to the viewer stylesheet applied to all HTML documents.
Type Aliases§
- UriCache 🔒
- Map from URI fragment strings (e.g.
"chapter.html#section-2") to the document offset of the element with the matchingidattribute.