Skip to main content

Module structured

Module structured 

Source
Expand description

Structured conversion: emit the page as an ordered list of typed blocks, serialized to JSON. Links are preserved as reference indices (same scheme as the text path), so structured output is both machine-parseable and token-frugal inline.

Blocks carry the kind they came from — heading (with its level), list item, code, quote, table row, paragraph — so a consumer can reconstruct document shape. Reading it back off flat text could not tell a heading from a sentence, which made “structured” no more structured than text.

Structs§

Block
StructuredDoc

Enums§

BlockKind

Functions§

html_to_structured
structured for callers holding raw HTML.
structured
Build a structured document from a parsed page.
to_json