Skip to main content

Crate pathland_render_html

Crate pathland_render_html 

Source
Expand description

§pathland-render-html

A Pathland renderer that maps opcode frames onto declarative HTML elements. Like every Pathland renderer it is a pure function of the opcode stream: it retains only its own decoded output tree (a cache), never application state, and emits WHAT the UI is — never layout rects. Native browser layout does the positioning.

This is the “server-side render” / remote-projection target (Goal #15): the same opcode stream that drives a native backend drives this HTML document.

Frames are self-contained: apply(opcodes, strings) resolves SET_TEXT by a relative offset into the frame’s own string section (no mirrored arena), and every rendered element carries a stable data-pathland-id so a client can hydrate it and apply later deltas in place.

Modules§

icons
icons — this renderer’s canonical ICON_NAME → glyph mapping
role_spec
Canonical ROLE → semantic HTML element mapping (spec/OPCODE.md §semantic properties) + typography-driven heading levels, shared with the TypeScript DOM client: the Rust renderer consumes these tables directly, and pathland-ts-codegen emits the TS equivalents into generated/role-spec.ts — so the semantic-tag / ARIA / heading mapping cannot drift between the renderers.
token_spec
Canonical design-token conventions (spec/TOKENS.md), shared with the TypeScript DOM client: the Rust renderer consumes these tables directly, and pathland-ts-codegen emits the TS equivalents from them — so the --pl-* naming, the dark. scheme prefix, the generative space.<N> family, and the length-token rules cannot drift between the renderers.

Structs§

HtmlRenderer
A stateless, streaming HTML renderer. Each render call decodes a self-contained snapshot batch into a transient map, walks it once, and streams HTML text out — zero state retained across calls. A pure function of the opcode stream (Renderer Statelessness).
Node
A decoded node in the retained description.