Reference¶
The complete public API, grouped by task. Types and signatures come from the turbohtml._html extension’s stub; the
prose is the C docstrings, so the reference cannot drift from the compiled core.
The pages group the same way the how-to guides and migration guides do, by the turbohtml namespace that owns each task:
Parse & DOM turns markup into a tree (Parsing), documents the node model with the navigation, query, and mutation methods every node shares (Nodes), and exposes the low-level token surface beneath it (Tokenizer). Detect sniffs the character encoding and language of raw bytes (Detect). Query searches a tree with CSS, XPath, and the soupsieve-shaped API (Query) and resolves the CSS cascade to a computed style (CSSOM). Clean sanitizes against an allowlist, rewrites bare URLs into links, and minifies (Clean). Convert & transform translates CSS selectors to XPath 1.0 (Convert) and applies an XSLT 1.0 stylesheet (Transform). Extract pulls the article and its metadata (Extract) and the JSON-LD, Microdata, and OpenGraph records (Structured data) out of a page. Build constructs a tree in code (Build), and Serialize renders one back to HTML, Markdown, or plain text (Serialize). Validate checks a document against an XSD 1.0 or RELAX NG schema (Validation) and runs the HTML5 authoring-conformance rules (Conformance). Command line wraps that surface for the shell, one subcommand per entry point (Command line).
- turbohtml.__version__ = '1.2.0'¶
The installed package version.
Detect
Query
Clean
Convert & transform
Extract
Build
Serialize
Validate
Command line