versioned-content
Version-scoped content region
pure 1.0.0 Apache-2.0
Install
docsloth component add @docsloth/versioned-content@1.0.0 \
--registry https://registry.docsloth.devRun it in a project that has a docsloth.config.json (docsloth init writes one). The docsloth CLI is not on npm yet: it runs from a checkout of the Docsloth engine, and the quickstart shows the setup. Every official component already renders in Docsloth sites; installing one vendors its props schema and specification and pins this exact version and digest.
What the CLI checks
docsloth component add reads this entry from index.json, recomputes the package digest from the manifest and the digest of every file, and writes nothing if one differs.
index.json, lines 961–978961 {962 "name": "@docsloth/versioned-content",963 "version": "1.0.0",964 "kind": "block",965 "description": "Version-scoped content region",966 "license": "Apache-2.0",967 "engine": ">=1 <2",968 "publisher": "docsloth",969 "digest": "sha256:1e23f883a5debc8a859214dc206755936b9b9541f764618c5c1c7aea4ac88d9c",970 "blocks": [971 "versioned-content"972 ],973 "capabilities": [974 "render.html"975 ],976 "manifest_path": "packages/@docsloth/versioned-content/1.0.0/manifest.json",977 "files_base": "packages/@docsloth/versioned-content/1.0.0/files"978 },Trust signals
- Runtime trust class (catalog)
- pure. Renders content only: no side effects, no network access and no permission prompts.
- Install trust class
- interactive, derived from the declared
render.html. This is the classdocsloth component addanddocsloth component listreport; it installs under the default policy, with no trust policy. - Package
@docsloth/versioned-content, version1.0.0- Package digest
sha256:1e23f883a5debc8a859214dc206755936b9b9541f764618c5c1c7aea4ac88d9c- Files
- 2 files, each pinned by its own sha256 digest (listed under Package files)
- Capabilities declared
render.html. A declaration, never a grant; every official package declares the same.- Publisher
docsloth, a publisher id rather than a verified identity- Licence
Apache-2.0- Engine range
>=1 <2- Index signature
- Not signed. Digests prove the bytes match the index, not who published them.
- Tools
- none
- Built from
packages/contracts/component-props/versioned-content.schema.jsonandpackages/contracts/component-specs/versioned-content.mdin docsloth-registry
Props
The props schema is packages/contracts/component-props/versioned-content.schema.json; props it does not list are rejected.
| Prop | Type | Required | Notes |
|---|---|---|---|
version | string | number | yes | |
label | string | no | maxLength: 200 |
content | string | no | maxLength: 20000 |
Required: version.
Example props generated from the schema
{
"version": "2.0",
"label": "Applies to v2",
"content": "Use the v2 client."
}Preview
Rendered by @docsloth/renderer from the example document block in the specification.
Document block
{
"type": "versioned-content",
"props": {
"version": "2.0",
"label": "Applies to v2",
"content": "Use the v2 client."
}
}Version 2.0
This is the renderer's real HTML with this registry's styles. Links and controls in the preview are inactive.
Rendered HTML
<section class="ds-versioned" data-component="versioned-content" data-version="2.0" aria-label="Applies to v2, version 2.0">
<p class="ds-version-label">Version 2.0</p>
<div class="ds-version-content">Use the v2 client.</div>
</section>Specification
From packages/contracts/component-specs/versioned-content.md.
Contract
Packaged: this block ships as @docsloth/versioned-content@1.0.0 — an installable component package (kind block, capability render.html, Apache-2.0) whose production props schema is packages/contracts/component-props/versioned-content.schema.json and whose catalog entry is in packages/contracts/component-catalog.json. No protocol manifest fixture is published (manifest_fixture: null): the fixture models a packaged protocol runtime this block does not have.
Intended behavior
Scope content to a product or API version with an explicit visible label. The AI-native rule is stronger than for visual chrome: Markdown must never hide content, so the version is carried as a > Version: <version> blockquote followed by the full body regardless of which version a host page chooses to display.
Failure and fallback
A missing/empty version, or a body that has neither non-empty content nor child blocks, degrades the block to the labelled fallback. A non-string label is ignored (the version text remains). Content is never dropped: the fallback and the Markdown twin both keep the body.
Required acceptance cases
A version-scoped block must not silently disappear from the Markdown twin or the JSON view, and switching versions must not change content meaning. Also test empty data, loading, denied access, browser without JS, mobile 360px, keyboard navigation, dark mode and an explicit constrained agent tool call. The server independently authorizes capability requests; a package manifest cannot grant authority.
Data and maintenance
Data bindings resolve from a specific publication/release vector and permitted fact/evidence graph. Configuration edits create versioned component patches. Update invalidation uses dependency IDs, never indiscriminate whole-page regeneration. Human-owned props survive automatic updates unless invalidated with an explicit conflict. Missing optional resources leave an honest inert/readable fallback, not a broken page or fake success.
Cost and tools
Pure/local interaction must never invoke a model by accident. Any model, remote query or executor call must reserve approved budget before dispatch. Public visitors do not inherit owner resources. The component may call only named tools in its signed manifest with valid typed inputs. A cancelled job stops polling and closes resources. No component gets platform administration, raw credentials or an unlimited execution loop.
Native renderer block
packages/renderer renders a versioned-content block as a <section data-version="…"> with a visible Version <version> label and an accessible region name. props.label joins the accessible name (aria-label) rather than replacing the visible version text, so HTML and Markdown always expose the same version tokens. Markdown emits > Version: <version> followed by the content, and children stay visible after it.
Native block props
| prop | type | required | behaviour |
|---|---|---|---|
version | string | number | yes | Visible version value, also written to data-version. Empty/non-finite values degrade to the fallback. |
label | string | no | Accessible region name (e.g. "Applies to v2"); it does not replace the visible version. |
content | string | no | Body text rendered as a paragraph; escaped in HTML, never hidden in Markdown. |
children | DocBlock[] | no | Additional body blocks; the block needs content or at least one child. |
Example
{
"type": "versioned-content",
"props": { "version": "2.0", "label": "Applies to v2", "content": "Use the v2 client." }
}
Package files
Served under packages/@docsloth/versioned-content/1.0.0/. The package digest covers manifest.json, which lists each file with its digest.
| File | sha256 digest | Bytes |
|---|---|---|
props.schema.json | sha256:ada5de7457ac0622968da5bba8ad97ad7a4eee061832b97c646debc1c06dd93c | 765 |
spec.md | sha256:fb7dcf24a22bb6aa1daa2f57d91987f1ed283d0ffe763000e5b589d6e2722915 | 3664 |
Sources
| Source | Location |
|---|---|
| Markdown twin | https://registry.docsloth.dev/docs/versioned-content.md |
| JSON metadata | https://registry.docsloth.dev/api/v1/components/versioned-content.json |
| Specification | packages/contracts/component-specs/versioned-content.md |
| Props schema | packages/contracts/component-props/versioned-content.schema.json |
| Catalog | packages/contracts/component-catalog.json |