mirror of
https://github.com/openprose/prose.git
synced 2026-09-19 05:55:05 +08:00
f12dcda4d8
Ships @openprose/reactor 0.3.0, @openprose/reactor-cli 0.2.0, @openprose/reactor-devtools 0.2.0: the Reactor harness (compile-once-intelligent then dumb reconciler, content-addressed receipts, cost scales with surprise) with the distilled ideal public API — curated front door, full @openai/agents passthrough, one typed handle, one Substrate, unified observe, branded ids, and additive forward seams for the fixpoint.
1.6 KiB
1.6 KiB
name, kind
| name | kind |
|---|---|
| html-renderer | function |
Shape
self: render an HTML document from a template and structured datadelegates: noneprohibited:- fetching external data
- modifying the data — you render what you're given
Parameters
- template: path to an HTML template with placeholder markers
- data: structured output from services or systems
- output_path: where to write the rendered HTML
- strict: (optional, default false) boolean — if true, error on missing data fields; if false, use "data pending" markers for missing fields
Returns
- rendered: confirmation the file was written successfully
- html_path: the output file path
Every template placeholder is resolved to a data value, or marked "data pending" in non-strict mode, before the rendered file path is returned.
Errors
- template-not-found: the template path does not exist or is not readable
- data-incomplete: (strict mode only) one or more template placeholders have no corresponding data field
Invariants
- template structure, styling, and layout are preserved exactly — only placeholder markers are replaced
- output HTML is valid if the input template was valid
Strategies
- when rendering: replace all placeholder markers in the template with corresponding values from the data. Preserve the template's structure, styling, and layout.
- when strict is true and a data field is missing: signal data-incomplete error listing all unresolved placeholders
- when strict is false and a data field is missing: insert a visible "data pending" marker in place of the missing value