prose-dev Atlas OpenProse docs bound to the contracts they describe
144 documents
packages/std/delivery/html-renderer.prose.md

name: html-renderer kind: function version: 0.15.0

Shape

  • self: render an HTML document from a template and structured data
  • delegates: none
  • prohibited:
    • 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