Semantic templates

LZR templating

LZR is a semantic templating layer for addressable, provable, patchable hypertext. It stays close to explicit source and data while producing the sidecars that make Inspector and AX workflows reliable.

Source
<set key="campaign"
     value="{{ data://campaign.json }}" />

<h1 id="campaign-title">
  {{ campaign.client }} Campaign
</h1>
src://components/component-bound.html
Data
{
  "title": "Corpus Campaign",
  "client": "Corpus Client",
  "adCount": 2,
  "assets": [ ... ]
}
data://campaign.json
Rendered
<h1 id="campaign-title">
  Corpus Client Campaign
</h1>
rendered://public/components/component-bound.html

Addressable. Composable. Inspectable.

Example: concise, composable, inspectable src://tape/mini-a.html (builds in this project)
<set key="campaign" value="{{ data://tape-mini/a.json }}" />
<h1>{{ campaign.title }}</h1>
<tape-mini-card title="{{ campaign.title }}" tone="{{ campaign.tone }}">...</tape-mini-card>

Every read, scope, and expansion is recorded.

Every output token traces back to source and data.

Core constructs

1Protocols and data reads

Use addressable protocols to read data, content, and assets. Reads are explicit, cached, and tracked.

src://data://cache://rendered://
2Components and expansion

Components are reusable templates with inputs. Expansion is explicit and inspectable.

<tape-mini-status status="{{ item.status }}" label=... />
3Expressions and scope

Expressions are pure and scoped. Lookups resolve against the current scope chain, including bracket lookups.

{{ labels.statuses[item.status] }}
4Control flow and the tape

Control structures lower to tape frames with active branch and iteration provenance.

op 2 content lzr.publicDir op 8 content campaign.title = Spring Campaign op 12 content data://tape-mini/a.json#/items = [{"name":"H op 18 content campaign.tone = green

Real segments from this project’s example build — see the full stream.

5Whitespace and fidelity

Whitespace renders like browser HTML: editor indentation is noise, linebreaks in phrasing become spaces, block edges trim.

whitespace canaries ->
6Fragments, proofs, sidecars

Every rendered fragment produces sidecars for verification, navigation, and safe incremental edits.

  • Source maps
  • Scope maps
  • Data read sets
  • Edit maps

Deliberate limits

Inspect this page shell
hypermake explain rendered/public/docs/lzr-templating.html
hypermake affected-by src/docs/lzr-templating.html
hypermake diagnostics src/docs/lzr-templating.html