SemText

Reference · NPL

<npl-declaration>

NPL element

PromptLingo reference ↗

It renders the version line of an NPL document, such as [email protected], as a banner at the top. Extended documents are marked the same way.

Shows which version of a rules document you are reading. It renders the version line of an NPL document, such as [email protected], as a banner at the top. Extended documents are marked the same way. required; a missing version warns and the banner still renders, with the bare mark (`⌜NPL@⌝`). Rendered in the banner mark (`⌜NPL@<version>⌝`) and mirrored to `data-version` (dual-form contract; the mirror is deferred past parse via afterParse so a sem-source snapshot never sees runtime writes). one of `definition` | `extension`. Selects the banner mark (`⌜NPL@…⌝` vs `⌜extend:NPL@…⌝`) and mirrors the resolved kind to `data-type`. Any other value falls back to `definition`. optional; the vocabulary an extension extends, authored on `type="extension"` declarations. Rendered by `.npl-declaration-target` beside the mark whenever authored and mirrored to `data-extend-target` (absent when unauthored). per the global attribute catalog (conventions.md §2) per the global attribute catalog (conventions.md §2) per the global attribute catalog (conventions.md §2)

Example

npl-declaration.html
source
1 <npl-declaration version="0.6">Every response states its assumptions before its answer.</npl-declaration>
2 <npl-declaration version="0.6" type="extension" extend-target="npl-core">This extension adds the session-ledger contract on top of npl-core.</npl-declaration>
render

Live render boots with JavaScript — the authored source is alongside.

variant: type="extension"

An extension spells the extend mark and names the vocabulary it extends — the banner mark switches to ⌜extend:NPL@…⌝ and the target renders beside it.

variant: type="extension"
npl-declaration-extension.html
source
1 <npl-declaration version="0.6" type="extension" extend-target="npl-core">This extension adds the session-ledger contract on top of npl-core.</npl-declaration>
render

Live render boots with JavaScript — the authored source is alongside.

Source: spec/schema/npl/npl-declaration.md