SemText

Showcase

Documentation that keeps its provenance

A documentation page is prose plus evidence: callouts that keep the quick answer close, listings that carry their filename, asides that stay out of the way until asked for, citations a reader can check. Every one of those is an element, not a plugin — and each one is also a record an extractor can quote back.

The document

The collapsed note teases ten words and expands on click; the listing gets copy and wrap controls with line 2 marked; the aside occludes its highlight in quiz views; the citation previews on hover with a backlink.

documentation example

documentation.md · authored SemText
source
<sem-enhanced-document>
<h1 data-kind="title">Rotation keys</h1>
<sem-note variant="tip" collapsed>Rotate per session — the short version is two lines of config.</sem-note>
<h2>Key lifetime</h2>
<p>Short-lived access tokens are paired with a refresh grant that issues a new pair<a href="#r-oauth">[1]</a>.</p>
<sem-code lang="yaml" filename="config/auth.yaml" mark="2" controls="copy,wrap">
<pre><code>access_ttl: 15m
refresh_rotation: per-use</code></pre>
</sem-code>
<sem-details>
<sem-detail>
Why rotation matters: a token copied from <highlight>localStorage</highlight> outlives its session unless the grant rotates it.
</sem-detail>
</sem-details>
<sem-references kind="bibliography" role="list">
<sem-reference id="r-oauth" role="listitem" href="https://datatracker.ietf.org/doc/html/rfc6749" cite="RFC 6749">The OAuth 2.0 Authorization Framework.</sem-reference>
</sem-references>
</sem-enhanced-document>
render

Render view: this block wires to the SemText runtime bundle in the full example viewer (port-reference lane) — the source beside it is the same file, byte for byte.

Why this works

  • sem-code keeps its source verbatim — extraction returns the listing byte-identical, so a model can quote the config, not a rendering of it.
  • sem-references mints nothing: the numbering is CSS, the citation is an attribute, and the record survives scripts-off.
  • Every hide rule is gated on the script having run — with no JavaScript the note is open, the aside is visible, and the document reads whole.

Elements used: sem-note, sem-code, sem-details, sem-references. Their contracts live on the reference pages .