<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>gtroff on gtroff — Work in progress</title><link>https://arran4.github.io/golang-gtroff/</link><description>Recent content in gtroff on gtroff — Work in progress</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://arran4.github.io/golang-gtroff/index.xml" rel="self" type="application/rss+xml"/><item><title>Portable agent recipes</title><link>https://arran4.github.io/golang-gtroff/docs/reference/agent-skills/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/agent-skills/</guid><description>&lt;h1 id="portable-agent-recipes"&gt;Portable agent recipes&lt;a class="anchor" href="#portable-agent-recipes"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;&lt;code&gt;gtroff skills&lt;/code&gt; exposes static, versioned instructions for locating, citing and&#10;extracting roff/man documentation. The bundled &lt;code&gt;gtroff-query-extract&lt;/code&gt; skill uses&#10;the existing stateless query and extraction interfaces. It is not a runtime&#10;extension; other installed commands remain discoverable through generated help&#10;and &lt;code&gt;gtroff commands --format json&lt;/code&gt;.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff skills list --format json&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff skills show gtroff-query-extract&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff skills show --format json gtroff-query-extract&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff help skills export&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;list&lt;/code&gt; reports schemaVersion 1, name, version, description and manifest SHA-256.&#10;Text &lt;code&gt;show&lt;/code&gt; writes SKILL.md; JSON &lt;code&gt;show&lt;/code&gt; writes the complete deterministic manifest.&#10;Neither command opens files. The portable entrypoint links to its focused&#10;&lt;code&gt;references/query-extract.md&lt;/code&gt;; no vendor-specific UI files or invocation protocol&#10;are required.&lt;/p&gt;</description></item><item><title>Explain document features</title><link>https://arran4.github.io/golang-gtroff/docs/reference/analyze/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/analyze/</guid><description>&lt;h1 id="explain-document-features"&gt;Explain document features&lt;a class="anchor" href="#explain-document-features"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;&lt;code&gt;gtroff analyze&lt;/code&gt; inventories roff syntax, source relationships and processing&#10;requirements without executing macros or rendering. Its primary result is a&#10;classification with evidence, not a document-quality score.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff analyze examples/man-tool.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff analyze --details document.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff analyze --format json document.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff analyze --no-includes --format jsonl document.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff analyze --rules questions.json document.1&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Options precede the optional file. Omit the file, or use &lt;code&gt;-&lt;/code&gt;, for stdin. Named&#10;files use the &lt;a href="../sources/"&gt;shared bounded source policy&lt;/a&gt;: local includes resolve&#10;by default beneath the input directory or an explicit &lt;code&gt;--root&lt;/code&gt;. &lt;code&gt;--no-includes&lt;/code&gt;&#10;retains references without loading. Stdin needs an explicit root to load anything.&#10;No system macro path, network fetch or external formatter is used.&lt;/p&gt;</description></item><item><title>Argument source, decoded values and checked formatting</title><link>https://arran4.github.io/golang-gtroff/docs/reference/arguments/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/arguments/</guid><description>&lt;h1 id="argument-source-decoded-values-and-checked-formatting"&gt;Argument source, decoded values and checked formatting&lt;a class="anchor" href="#argument-source-decoded-values-and-checked-formatting"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;&lt;code&gt;ParseArguments(source)&lt;/code&gt; returns an &lt;code&gt;ArgumentList&lt;/code&gt; containing the original&#10;argument string, decoded lexemes and byte spans. It returns a non-nil snapshot&#10;on a malformed quote, so callers can inspect successful arguments and the exact&#10;unparsed tail. It does not evaluate roff escapes, definitions or includes.&#10;See the &lt;a href="https://github.com/arran4/golang-gtroff/blob/main/arguments_example_test.go"&gt;executable example&lt;/a&gt;.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;arguments&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;:=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;groff&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;ParseArguments&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;` café\ mocha &amp;#34;世界&amp;#34; \&amp;#34; comment`&lt;/span&gt;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;// arguments.Source() retains the complete string, even if err is non-nil.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;lexemes&lt;/span&gt; &lt;span style="color:#f92672"&gt;:=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;arguments&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Lexemes&lt;/span&gt;()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;spans&lt;/span&gt; &lt;span style="color:#f92672"&gt;:=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;arguments&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;ByteSpans&lt;/span&gt;()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;// lexemes[0].Value == &amp;#34;café mocha&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;// spans[0] == groff.ArgumentSpan{Start: 2, End: 14} // bytes&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;// lexemes[0].Start == 2 &amp;amp;&amp;amp; lexemes[0].End == 13 // runes&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;_&lt;/span&gt; = &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;_&lt;/span&gt; = &lt;span style="color:#a6e22e"&gt;lexemes&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;_&lt;/span&gt; = &lt;span style="color:#a6e22e"&gt;spans&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;Source()&lt;/code&gt; includes original whitespace, quotes, escapes, comments and malformed&#10;or invalid UTF-8 bytes. &lt;code&gt;ArgumentLexeme.Raw&lt;/code&gt; is the original byte slice for that&#10;argument, not a reconstruction from runes. Invalid UTF-8 and NUL bytes are also&#10;retained in decoded values; this scanner does not validate encoding. The AST&amp;rsquo;s&#10;separate invalid-UTF-8 diagnostic/opaque-source policy is unchanged.&lt;/p&gt;</description></item><item><title>Source-aware AST</title><link>https://arran4.github.io/golang-gtroff/docs/reference/ast/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/ast/</guid><description>&lt;h1 id="source-aware-ast"&gt;Source-aware AST&lt;a class="anchor" href="#source-aware-ast"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;&lt;code&gt;ParseAST(io.Reader, ...Option)&lt;/code&gt; creates a source snapshot for inspection and&#10;selection. It shares generated line-token types with &lt;code&gt;ParseLine&lt;/code&gt;, and inline&#10;syntax with &lt;code&gt;ParseInline&lt;/code&gt;. &lt;code&gt;ParseDocument&lt;/code&gt;, &lt;code&gt;Document.Tokens&lt;/code&gt;, the existing &lt;code&gt;Node&lt;/code&gt;&#10;metadata interface, and generated APIs remain available. This API does not&#10;execute macros, expand references, fetch files, or resolve includes, even when&#10;&lt;code&gt;WithIncludeResolver&lt;/code&gt; is supplied.&lt;/p&gt;&#10;&lt;h2 id="structure-and-identity"&gt;Structure and identity&lt;a class="anchor" href="#structure-and-identity"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;The root contains physical lines, section/subsection groups, and block groups.&#10;A line contains inline syntax spans. A line&amp;rsquo;s &lt;code&gt;Attributes&lt;/code&gt; expose its normalized&#10;control name, token kind, package, and argument lexemes. &lt;code&gt;Token()&lt;/code&gt; returns a&#10;caller-owned copy of its concrete generated token for type switches. Opaque&#10;lines and delimiter lines have no generated token. &lt;code&gt;Inline()&lt;/code&gt; returns a copied&#10;inline token. Group attributes expose headings and explicit block terminators.&lt;/p&gt;</description></item><item><title>Create small man documents from Go</title><link>https://arran4.github.io/golang-gtroff/docs/reference/author/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/author/</guid><description>&lt;h1 id="create-small-man-documents-from-go"&gt;Create small man documents from Go&lt;a class="anchor" href="#create-small-man-documents-from-go"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;The &lt;code&gt;author&lt;/code&gt; package is a small façade for new canonical man documents. It offers&#10;constructors, mutable Page/Section Add/Append methods, typed literal blocks and&#10;variadic functional options. It reuses the existing semantic model, canonical&#10;man writer and bounded parser validation. It has no dependency on query, includes,&#10;editing, scripting or a CLI command.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;page&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;:=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;author&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;NewManPage&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#34;mytool&amp;#34;&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#34;1&amp;#34;&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;author&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;WithDate&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#34;2026-11-04&amp;#34;&lt;/span&gt;))&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;!=&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;nil&lt;/span&gt; { &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;_&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;:=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;page&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;AddSection&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#34;NAME&amp;#34;&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;author&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Paragraph&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#34;mytool - example&amp;#34;&lt;/span&gt;)); &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;!=&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;nil&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;options&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;:=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;page&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;AddSection&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#34;OPTIONS&amp;#34;&lt;/span&gt;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;author&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Definition&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#34;--verbose&amp;#34;&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#34;Enable verbose output&amp;#34;&lt;/span&gt;))&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;!=&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;nil&lt;/span&gt; { &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;:=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;options&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;AddDefinition&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#34;--quiet&amp;#34;&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#34;Reduce output&amp;#34;&lt;/span&gt;); &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;!=&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;nil&lt;/span&gt; { &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;page&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;WriteRoff&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;writer&lt;/span&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Complete executable external-package examples are in &lt;code&gt;author/example_test.go&lt;/code&gt;.&#10;Output goes only to an explicit &lt;code&gt;io.Writer&lt;/code&gt;; the package opens no files and reads&#10;no ambient clock, date, configuration, macro package or network resource.&lt;/p&gt;</description></item><item><title>Bounded block capture</title><link>https://arran4.github.io/golang-gtroff/docs/reference/blocks/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/blocks/</guid><description>&lt;h1 id="bounded-block-capture"&gt;Bounded block capture&lt;a class="anchor" href="#bounded-block-capture"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;&lt;code&gt;ParseDocument&lt;/code&gt; captures &lt;code&gt;.de&lt;/code&gt;, &lt;code&gt;.am&lt;/code&gt;, &lt;code&gt;.de1&lt;/code&gt;, &lt;code&gt;.dei&lt;/code&gt;, &lt;code&gt;.dei1&lt;/code&gt;, &lt;code&gt;.am1&lt;/code&gt;,&#10;&lt;code&gt;.ami&lt;/code&gt;, &lt;code&gt;.ami1&lt;/code&gt;, &lt;code&gt;.ig&lt;/code&gt;, &lt;code&gt;.TS&lt;/code&gt;/&lt;code&gt;.TE&lt;/code&gt;, &lt;code&gt;.EQ&lt;/code&gt;/&lt;code&gt;.EN&lt;/code&gt;,&#10;&lt;code&gt;.PS&lt;/code&gt;/&lt;code&gt;.PE&lt;/code&gt; (also &lt;code&gt;.PF&lt;/code&gt;) and &lt;code&gt;.[&lt;/code&gt;/&lt;code&gt;.]&lt;/code&gt; as logical source blocks. Registrations&#10;come from &lt;code&gt;Block&lt;/code&gt; declarations in &lt;code&gt;cmd/gen/in.json&lt;/code&gt;; capture and token factories&#10;are handwritten. Parsing does not execute definitions, ending macros, includes&#10;inside a block, preprocessors or external programs.&lt;/p&gt;&#10;&lt;p&gt;For every captured block, &lt;code&gt;DocumentToken.Block&lt;/code&gt; exposes a &lt;code&gt;BlockSource&lt;/code&gt; with an&#10;exact header, physical body lines, outer terminator, declared rule and spans.&#10;&lt;code&gt;Source()&lt;/code&gt; reproduces the captured bytes, including CRLF, missing final LF,&#10;quoted header spelling, terminator arguments, unknown requests and invalid UTF-8.&#10;&lt;code&gt;BodySource()&lt;/code&gt; excludes header/outer terminator. On terminal input/resource&#10;failure, &lt;code&gt;Tail&lt;/code&gt; separately retains buffered but unparsed bytes; &lt;code&gt;Source()&lt;/code&gt; includes&#10;it, while &lt;code&gt;BodySource()&lt;/code&gt; does not classify it as body syntax. &lt;code&gt;Closed&lt;/code&gt; records an&#10;observed outer terminator; it does not imply the block was valid.&lt;/p&gt;</description></item><item><title>Catalogue syntax support</title><link>https://arran4.github.io/golang-gtroff/docs/reference/catalogue-support/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/catalogue-support/</guid><description>&lt;h1 id="catalogue-syntax-support"&gt;Catalogue syntax support&lt;a class="anchor" href="#catalogue-syntax-support"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;&lt;a href="https://github.com/arran4/golang-gtroff/blob/main/docs/generated/catalogue-support.json"&gt;&lt;code&gt;generated/catalogue-support.json&lt;/code&gt;&lt;/a&gt; lists all&#10;518 current canonical records by index, type, package and token. It is generated&#10;from &lt;code&gt;cmd/gen/in.json&lt;/code&gt; and the same definition/dispatch plan used by the Go&#10;templates. &lt;code&gt;go generate ./...&lt;/code&gt; refreshes it; normal tests do not rewrite it.&#10;Review its diff when approving catalogue or classification changes.&lt;/p&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Parse status&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th style="text-align: right"&gt;Current records&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Evidence&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;supported_generated&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;330&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Generated line parser, concrete token type and metadata&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;supported_custom&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;17&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Generated line token plus handwritten document/block route&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;syntactically_preserved&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;171&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;String/register reference kind, name and exact raw spelling&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;unimplemented&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;0&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Missing definition/dispatch/custom route or invalid classification&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;ambiguous&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;0&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Duplicate dispatch or incorrect package-specific parser&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;&lt;code&gt;TestCatalogueSupportRoutes&lt;/code&gt; executes every row, using explicit package context&#10;and an isolated registry. The examples probe dispatch with required arguments;&#10;they are not comprehensive grammar fixtures. For custom block/definition routes,&#10;the test also parses the complete example and checks its concrete handwritten&#10;token/body. Indirect variants use a default-end example; explicit/unresolved&#10;indirect boundaries are verified separately in the block scenarios. A missing&#10;handwritten implementation cannot satisfy that check by falling back to an ordinary generated token. Includes remain syntax-only in these tests.&lt;/p&gt;</description></item><item><title>Headless CLI</title><link>https://arran4.github.io/golang-gtroff/docs/reference/cli/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/cli/</guid><description>&lt;h1 id="headless-cli"&gt;Headless CLI&lt;a class="anchor" href="#headless-cli"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Build &lt;code&gt;go build -o gtroff ./cmd/gtroff&lt;/code&gt; or install with&#10;&lt;code&gt;go install github.com/arran4/golang-gtroff/cmd/gtroff@latest&lt;/code&gt;. The new command has&#10;no groff, browser, font, terminal, GUI or CGO requirement. The existing &lt;code&gt;cmd/lex&lt;/code&gt;&#10;command is preserved as a compatibility token-dump utility.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff help&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff version&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff validate --strict testdata/simple.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff validate --format json testdata/simple.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff ast --select section:OPTIONS --format text testdata/simple.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff ast --select section:OPTIONS testdata/simple.1 &amp;gt; options.json&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;printf &lt;span style="color:#e6db74"&gt;&amp;#39;.B fragment\n&amp;#39;&lt;/span&gt; | ./gtroff validate --format json -&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Flags precede FILE. FILE is optional and defaults to stdin; &lt;code&gt;-&lt;/code&gt; explicitly means&#10;stdin. Use &lt;code&gt;--&lt;/code&gt; before a filename that begins with a dash. Exactly one input is&#10;accepted. Named input is opened explicitly and closed before output; stdin,&#10;stdout and stderr remain owned by the caller. No include targets or other files&#10;are opened from document content, and no macro or external command is executed.&lt;/p&gt;</description></item><item><title>Scope, limitations and release status</title><link>https://arran4.github.io/golang-gtroff/docs/reference/compatibility/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/compatibility/</guid><description>&lt;h1 id="scope-limitations-and-release-status"&gt;Scope, limitations and release status&lt;a class="anchor" href="#scope-limitations-and-release-status"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;&lt;strong&gt;Work in progress:&lt;/strong&gt; gtroff implements a subset of roff and Linux man-page behaviour. It is &lt;strong&gt;not&lt;/strong&gt; a full GNU groff clone, nor a stable substitute for the GNU formatter.&lt;/p&gt;&#10;&lt;h2 id="current-merged-functionality"&gt;Current merged functionality&lt;a class="anchor" href="#current-merged-functionality"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Area&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Scope&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Source parser&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Typed requests and man/ms macros, source positions and diagnostics&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;AST&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Original source and line endings, traversal, search and selection&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;CLI&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;validate&lt;/code&gt;, &lt;code&gt;ast&lt;/code&gt;, &lt;code&gt;render&lt;/code&gt;, &lt;code&gt;convert&lt;/code&gt;, &lt;code&gt;help&lt;/code&gt; and &lt;code&gt;version&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Semantic man&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Supported headings, paragraphs, tags and preformatted text&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;HTML export&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Standalone HTML for the documented semantic subset&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Conversion&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Semantic HTML/man profile, not arbitrary HTML or lossless conversion&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Build&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Pure-Go headless CLI, no system groff or CGO&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;The capabilities available on your installation depend on the specific revision. Check the &lt;a href="https://github.com/arran4/golang-gtroff"&gt;default branch&lt;/a&gt; and its open PRs.&lt;/p&gt;</description></item><item><title>Semantic HTML/man conversion</title><link>https://arran4.github.io/golang-gtroff/docs/reference/convert/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/convert/</guid><description>&lt;h1 id="semantic-htmlman-conversion"&gt;Semantic HTML/man conversion&lt;a class="anchor" href="#semantic-htmlman-conversion"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Use &lt;code&gt;gtroff convert --from html --to roff -i article.html -o article.1&lt;/code&gt;, or&#10;&lt;code&gt;gtroff convert --from roff --to html -i article.1 -o article.html&lt;/code&gt;. Both default&#10;to stdin/stdout (&lt;code&gt;-&lt;/code&gt;). HTML uses the same self-contained output and bundled Go&#10;Regular/Bold/Italic/Mono fonts as &lt;code&gt;render&lt;/code&gt;; &lt;code&gt;--fragment&lt;/code&gt; and &lt;code&gt;--assets omit-fonts&lt;/code&gt;&#10;are available for HTML output. Use &lt;code&gt;render&lt;/code&gt; for selection, custom fonts and&#10;appearance options. No groff, browser, network or installed font discovery runs.&lt;/p&gt;</description></item><item><title>Development and verification</title><link>https://arran4.github.io/golang-gtroff/docs/reference/development/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/development/</guid><description>&lt;h1 id="development-and-verification"&gt;Development and verification&lt;a class="anchor" href="#development-and-verification"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;This is an actively developed Go library with stacked PRs and generated parser code.&lt;/p&gt;&#10;&lt;h2 id="repository-layout"&gt;Repository layout&lt;a class="anchor" href="#repository-layout"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Module root: parser, AST, generated token catalogue and document/evaluator APIs.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;cmd/gtroff/&lt;/code&gt;: headless executable; &lt;code&gt;cmd/lex/&lt;/code&gt;: compatibility lexer.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;cmd/gen/&lt;/code&gt;: catalogue schema, templates and generator.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;internal/cli/&lt;/code&gt;: testable CLI command logic.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;man/&lt;/code&gt;, &lt;code&gt;renderhtml/&lt;/code&gt; and &lt;code&gt;convert/&lt;/code&gt;: semantics and outputs.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;testdata/&lt;/code&gt;: readable and TXTAR scenario fixtures.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;docs/*.md&lt;/code&gt;: maintained documentation, staged for Hugo at build time.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="verify-before-review"&gt;Verify before review&lt;a class="anchor" href="#verify-before-review"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Use Go 1.26 or later and check the repository&amp;rsquo;s actual module toolchain:&lt;/p&gt;</description></item><item><title>Document reader and source preservation</title><link>https://arran4.github.io/golang-gtroff/docs/reference/document/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/document/</guid><description>&lt;h1 id="document-reader-and-source-preservation"&gt;Document reader and source preservation&lt;a class="anchor" href="#document-reader-and-source-preservation"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;&lt;code&gt;ParseDocument(io.Reader, ...Option)&lt;/code&gt; parses line tokens and handwritten logical&#10;blocks. &lt;code&gt;ParseLine&lt;/code&gt; remains the single-line API; &lt;code&gt;ParseAST&lt;/code&gt; provides an independent&#10;structural tree. The document reader does not evaluate macros or read includes&#10;unless a resolver is explicitly supplied.&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;Document.Source()&lt;/code&gt; contains the exact bytes read from that document&amp;rsquo;s reader.&#10;&lt;code&gt;SourceName&lt;/code&gt; identifies that stream and &lt;code&gt;SourceComplete&lt;/code&gt; is true only after its&#10;reader reported EOF. These are source facts, not a claim that the syntax is valid.&#10;On success with observed EOF, source includes original LF/CRLF, tabs, blank&#10;lines, comments, Unicode/invalid UTF-8, unknown controls and a missing final LF.&lt;/p&gt;</description></item><item><title>GitHub Pages: Actions artifact deployment</title><link>https://arran4.github.io/golang-gtroff/docs/reference/documentation-site/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/documentation-site/</guid><description>&lt;h1 id="github-pages-actions-artifact-deployment"&gt;GitHub Pages: Actions artifact deployment&lt;a class="anchor" href="#github-pages-actions-artifact-deployment"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;This site is built using Hugo Book, based on the site in &lt;a href="https://github.com/arran4/go-subcommand"&gt;go-subcommand&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="documentation-is-maintained-in-one-place"&gt;Documentation is maintained in one place&lt;a class="anchor" href="#documentation-is-maintained-in-one-place"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Edit &lt;code&gt;docs/*.md&lt;/code&gt;. The &lt;code&gt;docs/scripts/stage-docs.py&lt;/code&gt; script builds derived Hugo pages into &lt;code&gt;docs/content/docs/reference/&lt;/code&gt; and adjusts links to other guides or GitHub source artifacts. The generated files are not committed.&lt;/p&gt;&#10;&lt;p&gt;The homepage and section indices are maintained separately under &lt;code&gt;docs/content/&lt;/code&gt;. The Hugo Book theme is a pinned Git submodule.&lt;/p&gt;&#10;&lt;h2 id="test-locally"&gt;Test locally&lt;a class="anchor" href="#test-locally"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;git submodule update --init --recursive&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python3 docs/scripts/stage-docs.py&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;hugo --source docs --minify --baseURL &lt;span style="color:#e6db74"&gt;&amp;#39;https://arran4.github.io/golang-gtroff/&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The generated &lt;code&gt;docs/public/&lt;/code&gt; directory is ignored. Check navigation, images, code blocks and project-prefix links.&lt;/p&gt;</description></item><item><title>Opt-in evaluation and resource limits</title><link>https://arran4.github.io/golang-gtroff/docs/reference/evaluation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/evaluation/</guid><description>&lt;h1 id="opt-in-evaluation-and-resource-limits"&gt;Opt-in evaluation and resource limits&lt;a class="anchor" href="#opt-in-evaluation-and-resource-limits"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;&lt;code&gt;Evaluate(tokens, env)&lt;/code&gt; interprets the integer evaluator profile described below.&#10;&lt;code&gt;EvaluateContext(ctx, tokens, env)&lt;/code&gt; adds cancellation. Parsing, AST construction,&#10;text extraction, semantic conversion, rendering and serving do not enable it.&#10;Keep the parsed &lt;code&gt;Document&lt;/code&gt; or &lt;code&gt;AST&lt;/code&gt; for source representation; evaluation returns&#10;semantic output and does not promise a source round trip.&lt;/p&gt;&#10;&lt;p&gt;Use &lt;code&gt;NewEnvironment()&lt;/code&gt; or a zero-value &lt;code&gt;Environment&lt;/code&gt;. A nil environment selects&#10;private default state. Reuse an environment to carry registers, strings,&#10;macro definitions and aliases between calls. Do not mutate it or use it&#10;concurrently during a call. Public setters copy macro body slices but do not enforce evaluation&#10;budgets; evaluation validates caller-supplied state before interpreting tokens.&#10;Caller-provided custom Go tokens and their metadata methods are trusted code.&lt;/p&gt;</description></item><item><title>Extract selected documentation</title><link>https://arran4.github.io/golang-gtroff/docs/reference/extract/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/extract/</guid><description>&lt;h1 id="extract-selected-documentation"&gt;Extract selected documentation&lt;a class="anchor" href="#extract-selected-documentation"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Query locates objects. Extraction constructs records and exports content in a&#10;representation suited to the next task. It uses the same stateless selector IR,&#10;source set and optional man model as &lt;code&gt;query&lt;/code&gt;; there is no second document parser.&#10;The initial API/JSON schema is version 1, with no general format-conversion or&#10;stable-API promise.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff extract &lt;span style="color:#e6db74"&gt;&amp;#39;section[name=&amp;#34;ENVIRONMENT&amp;#34;] definition&amp;#39;&lt;/span&gt; page.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff extract --format csv --fields term,description,file,line &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;section[name=&amp;#34;ENVIRONMENT&amp;#34;] definition&amp;#39;&lt;/span&gt; page.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff extract --format raw &lt;span style="color:#e6db74"&gt;&amp;#39;definition[term=&amp;#34;TOOL_HOME&amp;#34;]&amp;#39;&lt;/span&gt; page.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff extract --format text --normalize &lt;span style="color:#e6db74"&gt;&amp;#39;section[name=&amp;#34;DESCRIPTION&amp;#34;]&amp;#39;&lt;/span&gt; page.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff extract --format grep &lt;span style="color:#e6db74"&gt;&amp;#39;definition&amp;#39;&lt;/span&gt; page.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff extract --format html -o environment.html &lt;span style="color:#ae81ff"&gt;\&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;section[name=&amp;#34;ENVIRONMENT&amp;#34;]&amp;#39;&lt;/span&gt; page.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff extract --view syntax --format raw &lt;span style="color:#e6db74"&gt;&amp;#39;macro[macro=&amp;#34;.B&amp;#34;]&amp;#39;&lt;/span&gt; page.1&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Flags precede the selector and optional input filename. Omit FILE or use &lt;code&gt;-&lt;/code&gt; for&#10;borrowed stdin. A named root resolves literal local includes through the shared&#10;source loader, relative to each referring file and confined to &lt;code&gt;--root&lt;/code&gt; (default:&#10;input directory). &lt;code&gt;--no-includes&lt;/code&gt; retains a single-source snapshot and references;&#10;stdin needs an explicit root for includes. No system macro search, network fetch&#10;or roff execution occurs. One invocation has one root source set, which can contain&#10;many explicit include occurrences. Enumerating unrelated collection roots remains&#10;a host/shell workflow rather than an implicit directory crawl.&lt;/p&gt;</description></item><item><title>Reproducible generation</title><link>https://arran4.github.io/golang-gtroff/docs/reference/generation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/generation/</guid><description>&lt;h1 id="reproducible-generation"&gt;Reproducible generation&lt;a class="anchor" href="#reproducible-generation"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;The parser generator owns &lt;code&gt;macros.go&lt;/code&gt;, &lt;code&gt;parseline.go&lt;/code&gt;, &lt;code&gt;catalogue.go&lt;/code&gt; and&#10;&lt;code&gt;docs/generated/catalogue-support.json&lt;/code&gt;. Its inputs are the embedded canonical&#10;&lt;code&gt;cmd/gen/in.json&lt;/code&gt;, normalized schema, generation plan and &lt;code&gt;*.template&lt;/code&gt; files.&#10;Handwritten parser/handler code stays outside those outputs.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Read-only: validate inputs, render candidates, compare committed bytes.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;go run ./cmd/gen -check&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Explicitly regenerate parser files, check examples, and refresh CLI docs.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;go generate ./...&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;go generate ./...&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;git diff --exit-code&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When changing a template/schema intentionally, regeneration will produce a diff;&#10;review and commit that change, then run the clean-tree check. Do not repair a&#10;generated Go file by hand. Go outputs have standard leading generated-file&#10;headers and pass through &lt;code&gt;go/format&lt;/code&gt;. Sorted plans and stable JSON avoid dates,&#10;temporary names and machine paths in emitted bytes. Runtime route tests are&#10;separate evidence from generation determinism.&lt;/p&gt;</description></item><item><title>Getting started</title><link>https://arran4.github.io/golang-gtroff/docs/reference/getting-started/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/getting-started/</guid><description>&lt;h1 id="getting-started"&gt;Getting started&lt;a class="anchor" href="#getting-started"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;&lt;strong&gt;Work in progress:&lt;/strong&gt; gtroff is a pure-Go toolkit for a documented subset of roff/man, not a full GNU groff replacement or a stable binary release.&lt;/p&gt;&#10;&lt;h2 id="requirements-and-installation"&gt;Requirements and installation&lt;a class="anchor" href="#requirements-and-installation"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Use Go 1.26 or later (the project currently specifies Go 1.26.10). The headless command does not require a C toolchain, system groff, browser or installed font package.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;git clone https://github.com/arran4/golang-gtroff.git&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cd golang-gtroff&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;go build -o /tmp/gtroff ./cmd/gtroff&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;/tmp/gtroff help&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;/tmp/gtroff version&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Go developers can also install the development version with &lt;code&gt;go install github.com/arran4/golang-gtroff/cmd/gtroff@latest&lt;/code&gt;. There is no compatibility promise for untagged development code.&lt;/p&gt;</description></item><item><title>Go library API examples</title><link>https://arran4.github.io/golang-gtroff/docs/reference/go-api/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/go-api/</guid><description>&lt;h1 id="go-library-api-examples"&gt;Go library API examples&lt;a class="anchor" href="#go-library-api-examples"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;gtroff&amp;rsquo;s Go packages can be used without invoking its CLI. The source AST, semantic man model and conversion APIs have deliberately different fidelity guarantees.&lt;/p&gt;&#10;&lt;h2 id="inspect-a-source-aware-ast"&gt;Inspect a source-aware AST&lt;a class="anchor" href="#inspect-a-source-aware-ast"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;package&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;main&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; (&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;fmt&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;log&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;strings&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;groff&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;github.com/arran4/golang-gtroff&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;func&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;main&lt;/span&gt;() {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;source&lt;/span&gt; &lt;span style="color:#f92672"&gt;:=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;.TH HELLO 1\n.SH NAME\nhello sample\n&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;tree&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;:=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;groff&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;ParseAST&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;strings&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;NewReader&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;source&lt;/span&gt;), &lt;span style="color:#a6e22e"&gt;groff&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;WithPackage&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#34;man&amp;#34;&lt;/span&gt;))&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;!=&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;nil&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;log&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Fatal&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;err&lt;/span&gt;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;_&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;section&lt;/span&gt; &lt;span style="color:#f92672"&gt;:=&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;range&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;tree&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Root&lt;/span&gt;().&lt;span style="color:#a6e22e"&gt;FindSection&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#34;NAME&amp;#34;&lt;/span&gt;, &lt;span style="color:#66d9ef"&gt;false&lt;/span&gt;) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;fmt&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Println&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;section&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Text&lt;/span&gt;())&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;fmt&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Println&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;section&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Raw&lt;/span&gt;())&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;Raw()&lt;/code&gt; returns the original source spelling; &lt;code&gt;Text()&lt;/code&gt; extracts parsed text. Nodes also expose source positions, document-local IDs, and navigation/search capabilities such as &lt;code&gt;FindMacro&lt;/code&gt;, &lt;code&gt;FindKind&lt;/code&gt;, &lt;code&gt;FindText&lt;/code&gt; and &lt;code&gt;FindSpan&lt;/code&gt;. The AST does not execute roff input or open include files.&lt;/p&gt;</description></item><item><title>Self-contained HTML export</title><link>https://arran4.github.io/golang-gtroff/docs/reference/html/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/html/</guid><description>&lt;h1 id="self-contained-html-export"&gt;Self-contained HTML export&lt;a class="anchor" href="#self-contained-html-export"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;&lt;code&gt;gtroff render --format html&lt;/code&gt; turns the common Linux man semantic model into a&#10;standalone page. The default output includes responsive CSS, Go Regular/Bold/&#10;Italic/Mono fonts, a title, semantic content and stable section permalinks. It&#10;requires no installed groff, browser, fontconfig, fonts or external rendering&#10;utility to generate the page. Open the output in a browser to read it.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;go build -o gtroff ./cmd/gtroff&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff render --format html -o page.html examples/man-tool.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff render --section OPTIONS --theme dark -o options.html examples/man-tool.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff render --section OPTIONS --fragment examples/man-tool.1 &amp;gt; fragment.html&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;printf &lt;span style="color:#e6db74"&gt;&amp;#39;.SH NAME\nhello\n&amp;#39;&lt;/span&gt; | ./gtroff render - &amp;gt; stdin.html&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;a href="https://github.com/arran4/golang-gtroff/blob/main/examples/man-tool.html"&gt;committed example&lt;/a&gt; is generated by the CLI and&#10;verified byte-for-byte in tests against the API and source scenario. Download&#10;it with its embedded fonts, then open it locally; no font installation or server&#10;is needed. &lt;a href="https://github.com/arran4/golang-gtroff/blob/main/examples/man-tool.1"&gt;Source&lt;/a&gt; remains separate and unchanged.&lt;/p&gt;</description></item><item><title>Paginated PNG/JPEG export</title><link>https://arran4.github.io/golang-gtroff/docs/reference/images/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/images/</guid><description>&lt;h1 id="paginated-pngjpeg-export"&gt;Paginated PNG/JPEG export&lt;a class="anchor" href="#paginated-pngjpeg-export"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff render --format png -o page.png examples/man-tool.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff render --format jpg --theme dark --quality &lt;span style="color:#ae81ff"&gt;90&lt;/span&gt; -o page.jpg examples/man-tool.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff render --format png --section OPTIONS --single -o options.png examples/man-tool.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff render --format png --width &lt;span style="color:#ae81ff"&gt;800&lt;/span&gt; --page-height &lt;span style="color:#ae81ff"&gt;1000&lt;/span&gt; -o page.png long-page.1&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A single page writes &lt;code&gt;page.png&lt;/code&gt;; multiple pages write &lt;code&gt;page-001.png&lt;/code&gt;,&#10;&lt;code&gt;page-002.png&lt;/code&gt;, etc. The base file is not a stitched/cropped substitute. Standard&#10;output accepts exactly one image and rejects a multi-page plan before writing.&#10;&lt;code&gt;--single&lt;/code&gt; derives a content-sized height within &lt;code&gt;--max-height&lt;/code&gt; and &lt;code&gt;--max-pixels&lt;/code&gt;;&#10;it errors if the whole document cannot fit. &lt;code&gt;--node&lt;/code&gt; selects the AST ID shown by&#10;&lt;code&gt;gtroff ast&lt;/code&gt;, mapping to its complete semantic block, as for HTML.&lt;/p&gt;</description></item><item><title>Library guide</title><link>https://arran4.github.io/golang-gtroff/docs/reference/library/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/library/</guid><description>&lt;h1 id="library-guide"&gt;Library guide&lt;a class="anchor" href="#library-guide"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Install the root module with &lt;code&gt;go get github.com/arran4/golang-gtroff&lt;/code&gt;.&#10;Use a reviewed feature revision while the roadmap remains unreleased.&#10;The following snippets illustrate the APIs; complete executable examples live&#10;in &lt;code&gt;ast_example_test.go&lt;/code&gt; and the individual packages.&lt;/p&gt;&#10;&lt;h3 id="extract-semantic-man-page-content"&gt;Extract semantic man-page content&lt;a class="anchor" href="#extract-semantic-man-page-content"&gt;#&lt;/a&gt;&lt;/h3&gt;&#10;&lt;p&gt;The &lt;code&gt;man&lt;/code&gt; package groups physical source lines into styled paragraphs,&#10;sections, tagged items, indented blocks and preformatted examples. It keeps&#10;source provenance and warns about unsupported semantics.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;// Imports: groff &amp;#34;github.com/arran4/golang-gtroff&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;// &amp;#34;github.com/arran4/golang-gtroff/man&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;tree&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;:=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;groff&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;ParseAST&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;strings&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;NewReader&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;source&lt;/span&gt;), &lt;span style="color:#a6e22e"&gt;groff&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;WithPackage&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#34;man&amp;#34;&lt;/span&gt;))&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;!=&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;nil&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;log&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Fatal&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;err&lt;/span&gt;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;document&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;:=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;man&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Build&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;tree&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;man&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Options&lt;/span&gt;{&lt;span style="color:#a6e22e"&gt;Strict&lt;/span&gt;: &lt;span style="color:#66d9ef"&gt;true&lt;/span&gt;})&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;!=&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;nil&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;log&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Fatal&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;err&lt;/span&gt;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;options&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;:=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;document&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;SelectSection&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#34;OPTIONS&amp;#34;&lt;/span&gt;, &lt;span style="color:#66d9ef"&gt;false&lt;/span&gt;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;!=&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;nil&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;log&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Fatal&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;err&lt;/span&gt;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;fmt&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Print&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;options&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Text&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;man&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;TextOptions&lt;/span&gt;{}))&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Selections retain title metadata and inherited font/indent state. Use&#10;&lt;code&gt;Raw: true&lt;/code&gt; for original source slices or &lt;code&gt;Normalize: true&lt;/code&gt; for folded display&#10;text. The &lt;a href="https://github.com/arran4/golang-gtroff/blob/main/examples/man-tool.1"&gt;representative man page&lt;/a&gt; and its&#10;&lt;a href="https://github.com/arran4/golang-gtroff/blob/main/examples/man-tool.semantic.json"&gt;tested semantic JSON&lt;/a&gt; demonstrate the supported&#10;subset. See &lt;a href="../man/"&gt;semantic contracts and scenarios&lt;/a&gt; for details.&lt;/p&gt;</description></item><item><title>Licensing and Provenance</title><link>https://arran4.github.io/golang-gtroff/docs/reference/licensing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/licensing/</guid><description>&lt;h1 id="licensing-and-provenance"&gt;Licensing and Provenance&lt;a class="anchor" href="#licensing-and-provenance"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;blockquote class='book-hint '&gt;&#10;&lt;p&gt;&lt;strong&gt;Publication review:&lt;/strong&gt; This records the maintainer&amp;rsquo;s mixed-license choice; it is not by itself a completed copyright-source audit or approval to make the repository public. The remaining checks are tracked by &lt;a href="https://github.com/arran4/golang-gtroff/issues/67"&gt;#67&lt;/a&gt;.&lt;/p&gt;&#10;&lt;/blockquote&gt;&lt;p&gt;The license of a component is determined by its own copyright grant, not merely by its location in this repository. No third-party material is relicensed by this project.&lt;/p&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Component&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;License / distribution terms&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Provenance&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Independently authored Go implementation, CLI, tooling and project-authored tests&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;GPL-3.0-or-later&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://github.com/arran4/golang-gtroff/blob/main/LICENSE"&gt;Root GPL license&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;GNU groff-derived macro definitions and descriptions in &lt;code&gt;cmd/gen/in.json&lt;/code&gt;, &lt;code&gt;catalogue.go&lt;/code&gt; and generated Go comments&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Use &lt;strong&gt;GPL-3.0-or-later only for passages covered by GNU groff&amp;rsquo;s upstream GPL grant or explicit dual-license permission&lt;/strong&gt;; retain copyright attribution. Any unmatched GFDL-only passages require separation, replacement or permission before public redistribution as part of compiled Go.&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;GNU groff man-page and GNU troff manual sources, detailed below&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Independent GNU groff reference documentation (&lt;code&gt;groff.txt&lt;/code&gt;, &lt;code&gt;groff_man.txt&lt;/code&gt;, &lt;code&gt;groff_ms.txt&lt;/code&gt;)&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Original source-specific GNU license terms, including &lt;strong&gt;GFDL-1.3-or-later&lt;/strong&gt; where applicable, and any upstream GPL or permissive alternative&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;GNU groff 1.23.0 reference renders&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Bundled Go Fonts and independently exported font data&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;BSD-3-Clause&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://github.com/arran4/golang-gtroff/blob/main/fontset/LICENSE-Go-Fonts.txt"&gt;Go Fonts license notice&lt;/a&gt;, &lt;code&gt;fontset.License()&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;testdata/environ_snippet.7&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;GPL-2.0-or-later&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Adapted Linux &lt;code&gt;environ(7)&lt;/code&gt; manual page, © 1993 Michael Haardt and Andries Brouwer&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;h2 id="gnu-upstream-licensing-and-generated-code"&gt;GNU upstream licensing and generated code&lt;a class="anchor" href="#gnu-upstream-licensing-and-generated-code"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;The catalogue contains prose derived from the GNU groff 1.23.0 man-page reference material. The upstream GNU groff project&amp;rsquo;s &lt;code&gt;LICENSES&lt;/code&gt; statement grants GPLv3-or-later for its distribution, and explicitly provides an FDL/GPL dual-license pathway for the GNU troff Texinfo manual. This is &lt;strong&gt;permission from upstream&lt;/strong&gt;, not a purported relicensing by this project. The original GNU manual is also available under GFDL 1.3 or later (without invariant sections or cover texts in the cited modern edition).&lt;/p&gt;</description></item><item><title>Structural documentation policy</title><link>https://arran4.github.io/golang-gtroff/docs/reference/lint/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/lint/</guid><description>&lt;h1 id="structural-documentation-policy"&gt;Structural documentation policy&lt;a class="anchor" href="#structural-documentation-policy"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;&lt;code&gt;gtroff lint&lt;/code&gt; applies conventions to explicit roff source snapshots. It reports&#10;policy findings separately from parser diagnostics and the &lt;code&gt;analyze&lt;/code&gt; capability&#10;inventory. It does not execute macros, render pages, fix files, or inspect paths&#10;that were not explicitly loaded. The API and JSON schema are version 1; this is&#10;an initial policy vocabulary, not a promise of complete groff understanding.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff lint page.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff lint --strict page.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff lint --required NAME,DESCRIPTION,ENVIRONMENT page.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff lint --format json --fail-on warning page.1 other.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff lint --closed-world page.1 other.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gtroff lint --no-includes page.1&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Flags precede positional filenames. No filenames means borrowed stdin; &lt;code&gt;-&lt;/code&gt; is&#10;accepted at most once. Named files use the shared bounded source loader, with&#10;local includes relative to the referring file and confined to &lt;code&gt;--root&lt;/code&gt; (default:&#10;each root input&amp;rsquo;s directory). Stdin needs an explicit root for includes. No&#10;system macro search, network fetch, or arbitrary filesystem traversal is enabled.&#10;The original immutable AST and exact captured bytes remain available through&#10;&lt;code&gt;source.Set&lt;/code&gt;. Lint does not serialize a replacement roff document.&lt;/p&gt;</description></item><item><title>Semantic Linux man-page model</title><link>https://arran4.github.io/golang-gtroff/docs/reference/man/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/man/</guid><description>&lt;h1 id="semantic-linux-man-page-model"&gt;Semantic Linux man-page model&lt;a class="anchor" href="#semantic-linux-man-page-model"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;The &lt;code&gt;man&lt;/code&gt; package turns a source-aware AST into explicit content for future&#10;renderers, servers and extraction tools. It is separate from the syntax AST and&#10;has no layout, HTML, image or GUI dependency. It never expands macros, evaluates&#10;requests, follows references, opens include targets or accesses a man database.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;tree&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;:=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;groff&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;ParseAST&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;strings&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;NewReader&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;source&lt;/span&gt;), &lt;span style="color:#a6e22e"&gt;groff&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;WithPackage&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#34;man&amp;#34;&lt;/span&gt;))&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;!=&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;nil&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;// Resource or reader failure: the tree contains only the collected snapshot.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;document&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;:=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;man&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Build&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;tree&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;man&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Options&lt;/span&gt;{&lt;span style="color:#a6e22e"&gt;Strict&lt;/span&gt;: &lt;span style="color:#66d9ef"&gt;true&lt;/span&gt;})&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;!=&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;nil&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;// The document and diagnostics remain available for inspection.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;options&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;:=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;document&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;SelectSection&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#34;OPTIONS&amp;#34;&lt;/span&gt;, &lt;span style="color:#66d9ef"&gt;false&lt;/span&gt;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt; &lt;span style="color:#f92672"&gt;!=&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;nil&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;err&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;fmt&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Print&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;options&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Text&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;man&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;TextOptions&lt;/span&gt;{}))&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;See the executable &lt;code&gt;man.ExampleBuild&lt;/code&gt;, &lt;a href="https://github.com/arran4/golang-gtroff/blob/main/examples/man-tool.1"&gt;representative source&lt;/a&gt;&#10;and its &lt;a href="https://github.com/arran4/golang-gtroff/blob/main/examples/man-tool.semantic.json"&gt;tested semantic JSON&lt;/a&gt;. The expected&#10;JSON uses the scenario source label &lt;code&gt;input.1&lt;/code&gt; for deterministic provenance.&lt;/p&gt;</description></item><item><title>Stateless structural queries</title><link>https://arran4.github.io/golang-gtroff/docs/reference/query/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/query/</guid><description>&lt;h1 id="stateless-structural-queries"&gt;Stateless structural queries&lt;a class="anchor" href="#stateless-structural-queries"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;&lt;code&gt;gtroff query&lt;/code&gt; selects source-aware roff syntax or an optional man hierarchy.&#10;The &lt;code&gt;query&lt;/code&gt; Go package compiles selectors and typed builders into one immutable&#10;representation and evaluates it without changing documents, opening files or&#10;retaining procedural state. Tengo sessions and editing are separate workstreams.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff query &lt;span style="color:#e6db74"&gt;&amp;#39;section[name=&amp;#34;ENVIRONMENT&amp;#34;] definition&amp;#39;&lt;/span&gt; document.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff query --format csv --fields term,file,line &lt;span style="color:#e6db74"&gt;&amp;#39;definition&amp;#39;&lt;/span&gt; document.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff query --view syntax --format raw &lt;span style="color:#e6db74"&gt;&amp;#39;macro[macro=&amp;#34;.B&amp;#34;][arg.0=&amp;#34;TOOL_HOME&amp;#34;]&amp;#39;&lt;/span&gt; document.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff query --no-includes --format grep &lt;span style="color:#e6db74"&gt;&amp;#39;section[name=&amp;#34;DESCRIPTION&amp;#34;] paragraph&amp;#39;&lt;/span&gt; document.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff query --view syntax &lt;span style="color:#e6db74"&gt;&amp;#39;inline[inline-kind=&amp;#34;StringRef&amp;#34;]&amp;#39;&lt;/span&gt; document.1&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Options precede the selector and optional file. Omit the file, or use &lt;code&gt;-&lt;/code&gt;, for&#10;stdin. Quote the selector as one shell argument; use &lt;code&gt;--&lt;/code&gt; for a selector or path&#10;that would otherwise look like a flag. Invalid selectors/options are rejected&#10;before input is opened. A complete query with no matches succeeds.&lt;/p&gt;</description></item><item><title>Building, installing and releasing gtroff</title><link>https://arran4.github.io/golang-gtroff/docs/reference/releasing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/releasing/</guid><description>&lt;h1 id="building-installing-and-releasing-gtroff"&gt;Building, installing and releasing gtroff&lt;a class="anchor" href="#building-installing-and-releasing-gtroff"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;The feature stack is unreleased. This guide describes the implemented candidate&#10;pipeline, not an assertion that a GitHub release or native CI pass already exists.&#10;Download published assets from &lt;a href="https://github.com/arran4/golang-gtroff/releases"&gt;GitHub Releases&lt;/a&gt;&#10;when available, or use the feature revision in the &lt;a href="https://github.com/arran4/golang-gtroff/blob/main/readme.md"&gt;user guide&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="distributions-and-installation"&gt;Distributions and installation&lt;a class="anchor" href="#distributions-and-installation"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Distribution&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Targets&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Contents / runtime&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Headless &lt;code&gt;gtroff&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Linux, Windows, macOS; amd64 and arm64&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;CGO=0, bundled fonts, executable, README, licenses, command docs and realistic examples&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Linux packages&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;amd64 and arm64; deb, rpm, apk, Arch&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;/usr/bin/gtroff&lt;/code&gt;, man pages, completions, README, licenses, example source&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Optional &lt;code&gt;gtroff-view&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Linux amd64 / X11&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Separate archive; CGO=0, display required; native pixel/input smoke required before including it&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;The six headless targets are built and inspected in every candidate build. Full&#10;native tests and archived-binary smoke are release requirements, with one runner&#10;for each OS/architecture. Configuring a lane is not evidence that it has passed.&#10;Linux amd64 has local runtime evidence; Linux arm64 has QEMU execution and&#10;scenario evidence, including exact example image bytes. Windows amd64 has Wine&#10;10.0 compatibility execution of its archived CLI and root/CLI test suites. Wine&#10;does not establish native Windows filesystem or desktop support. Native&#10;Windows/macOS remain pending while&#10;hosted jobs fail before execution. The viewer&amp;rsquo;s Windows source cross-build and&#10;Apple backend remain preview work; neither is shipped by the viewer config.&lt;/p&gt;</description></item><item><title>Roadmap verification record</title><link>https://arran4.github.io/golang-gtroff/docs/reference/roadmap-verification/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/roadmap-verification/</guid><description>&lt;h1 id="roadmap-verification-record"&gt;Roadmap verification record&lt;a class="anchor" href="#roadmap-verification-record"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;This is an evidence map for the feature series under issue #31. Implementation&#10;and local verification are recorded separately from native/hosted acceptance.&#10;It is not a declaration that the roadmap, parent parser backlog or release gate&#10;has passed. The issue bodies and live PR state remain authoritative.&lt;/p&gt;&#10;&lt;h2 id="branch-and-review-boundaries"&gt;Branch and review boundaries&lt;a class="anchor" href="#branch-and-review-boundaries"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;As checked on 2026-11-13, historical PR #19 and the feature/correction series&#10;#32–#41 and #43–#57 are merged into the intermediate history. Their original&#10;review boundaries are listed below; they are not currently open Draft PRs.&#10;The remaining main integration is &lt;a href="https://github.com/arran4/golang-gtroff/pull/77"&gt;#77&lt;/a&gt;,&#10;followed by generated CLI &lt;a href="https://github.com/arran4/golang-gtroff/pull/64"&gt;#64&lt;/a&gt;.&#10;Neither has been merged into main at this checkpoint. Later workbench PRs are&#10;reviewed against their own named parents; current PR metadata remains authoritative.&lt;/p&gt;</description></item><item><title>Shared scenarios and reproducible examples</title><link>https://arran4.github.io/golang-gtroff/docs/reference/scenarios/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/scenarios/</guid><description>&lt;h1 id="shared-scenarios-and-reproducible-examples"&gt;Shared scenarios and reproducible examples&lt;a class="anchor" href="#shared-scenarios-and-reproducible-examples"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;&lt;code&gt;TestIntegrationScenarios&lt;/code&gt; walks embedded &lt;code&gt;testdata/scenarios&lt;/code&gt; with &lt;code&gt;fs.WalkDir&lt;/code&gt;,&#10;sorts paths, and runs named subtests. The existing &lt;code&gt;ast&lt;/code&gt;, &lt;code&gt;cli&lt;/code&gt;, &lt;code&gt;man&lt;/code&gt;,&#10;&lt;code&gt;render/html&lt;/code&gt;, &lt;code&gt;convert&lt;/code&gt;, &lt;code&gt;image&lt;/code&gt;, &lt;code&gt;serve&lt;/code&gt; and &lt;code&gt;viewer&lt;/code&gt; suites keep detailed&#10;feature contracts. This shared suite checks that those public boundaries agree.&lt;/p&gt;&#10;&lt;h2 id="archive-vocabulary"&gt;Archive vocabulary&lt;a class="anchor" href="#archive-vocabulary"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Every archive has a comment explaining intent, &lt;code&gt;options.json&lt;/code&gt;, and exactly one&#10;of &lt;code&gt;input.1&lt;/code&gt;, &lt;code&gt;input.html&lt;/code&gt;, or &lt;code&gt;&amp;quot;example&amp;quot;:true&lt;/code&gt;. The example option selects only&#10;the fixed embedded &lt;code&gt;examples/man-tool.1&lt;/code&gt;; it cannot open an arbitrary filename.&#10;Unknown members, duplicate names and unknown options fail. Missing input fails;&#10;empty input is valid. Missing &lt;code&gt;expected-diagnostics.json&lt;/code&gt; means no diagnostics&#10;at any recorded stage, rather than an assertion being skipped.&lt;/p&gt;</description></item><item><title>Read-only man-page HTTP library</title><link>https://arran4.github.io/golang-gtroff/docs/reference/serve/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/serve/</guid><description>&lt;h1 id="read-only-man-page-http-library"&gt;Read-only man-page HTTP library&lt;a class="anchor" href="#read-only-man-page-http-library"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;go build -o gtroff ./cmd/gtroff&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff serve --root examples --listen 127.0.0.1:8080&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# gtroff: serving 2 pages at http://127.0.0.1:8080 (read-only snapshot)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Open &lt;code&gt;http://127.0.0.1:8080&lt;/code&gt;, search for &lt;code&gt;man-tool&lt;/code&gt;, and follow its section links.&#10;The same command works with provided collections on Linux, Windows and macOS.&#10;No installed &lt;code&gt;man&lt;/code&gt; command or database is required. On Linux, explicitly select&#10;an installed collection, for example &lt;code&gt;--root /usr/share/man/man1&lt;/code&gt;. Repeat &lt;code&gt;--root&lt;/code&gt;&#10;for other collections. Nothing scans host man directories implicitly. Port &lt;code&gt;0&lt;/code&gt;&#10;chooses an available port; the actual address is printed to stderr. Ctrl-C stops&#10;the server. Stdout is unused.&lt;/p&gt;</description></item><item><title>Bounded source sets</title><link>https://arran4.github.io/golang-gtroff/docs/reference/sources/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/sources/</guid><description>&lt;h1 id="bounded-source-sets"&gt;Bounded source sets&lt;a class="anchor" href="#bounded-source-sets"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;&lt;code&gt;source.Load(ctx, fsys, name, options)&lt;/code&gt; loads a named document from an explicit&#10;&lt;code&gt;fs.FS&lt;/code&gt;. &lt;code&gt;source.Read(ctx, reader, name, options)&lt;/code&gt; parses a borrowed reader and&#10;loads includes only when &lt;code&gt;options.FS&lt;/code&gt; is supplied. Neither calls external tools,&#10;fetches network resources nor evaluates macros. &lt;code&gt;groff.ParseAST&lt;/code&gt; continues to&#10;parse one source without any implicit filesystem access.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff sources document.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff sources --format text --root docs docs/document.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff sources --no-includes document.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff sources --root docs - &amp;lt; fragment.roff&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;These are real generated commands. &lt;code&gt;sources&lt;/code&gt; exposes the shared input layer for&#10;the implemented &lt;a href="../query/"&gt;query command&lt;/a&gt;, &lt;a href="../analyze/"&gt;analysis command&lt;/a&gt;,&#10;and &lt;a href="../extract/"&gt;extraction command&lt;/a&gt;. The separate lint command may follow.&#10;Source inspection itself does not perform those operations. Existing &lt;code&gt;ast&lt;/code&gt;,&#10;&lt;code&gt;validate&lt;/code&gt;, rendering and conversion behavior stays&#10;syntax-only with respect to include loading. The legacy opt-in&#10;&lt;code&gt;ParseDocument&lt;/code&gt; resolver remains supported separately.&lt;/p&gt;</description></item><item><title>Optional Shiny desktop viewer</title><link>https://arran4.github.io/golang-gtroff/docs/reference/viewer/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/viewer/</guid><description>&lt;h1 id="optional-shiny-desktop-viewer"&gt;Optional Shiny desktop viewer&lt;a class="anchor" href="#optional-shiny-desktop-viewer"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;The desktop program lives in a separate Go module. The root parser, CLI, HTML,&#10;images and HTTP server do not import Shiny, X11, GLFW or native GUI libraries.&#10;Ordinary root &lt;code&gt;CGO_ENABLED=0 go test ./...&lt;/code&gt; and &lt;code&gt;go build ./...&lt;/code&gt; remain headless.&lt;/p&gt;&#10;&lt;p&gt;Build from a complete checkout:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cd desktop&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;CGO_ENABLED&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;0&lt;/span&gt; go build -o gtroff-view ./cmd/gtroff-view&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff-view ../examples/man-tool.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff-view --section OPTIONS ../examples/man-tool.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./gtroff-view --width &lt;span style="color:#ae81ff"&gt;800&lt;/span&gt; --page-height &lt;span style="color:#ae81ff"&gt;700&lt;/span&gt; ../examples/man-tool.1&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;On Windows, build with &lt;code&gt;go build -o gtroff-view.exe ./cmd/gtroff-view&lt;/code&gt; from&#10;&lt;code&gt;desktop&lt;/code&gt;, then pass a local source file. On macOS, the actual GUI backend needs a&#10;native Apple toolchain with &lt;code&gt;CGO_ENABLED=1&lt;/code&gt;; a Linux cross-build cannot supply&#10;Apple frameworks. The nested module&amp;rsquo;s local &lt;code&gt;replace ..&lt;/code&gt; deliberately uses the&#10;same checkout&amp;rsquo;s renderer. It is a source-checkout build, not a claimed&#10;&lt;code&gt;go install ...@latest&lt;/code&gt; distribution contract.&lt;/p&gt;</description></item><item><title>Practical command-line workflows</title><link>https://arran4.github.io/golang-gtroff/docs/reference/workflows/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://arran4.github.io/golang-gtroff/docs/reference/workflows/</guid><description>&lt;h1 id="practical-command-line-workflows"&gt;Practical command-line workflows&lt;a class="anchor" href="#practical-command-line-workflows"&gt;#&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;The examples describe the currently merged &lt;strong&gt;headless&lt;/strong&gt; CLI. Build the executable from the repository root:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;go build -o /tmp/gtroff ./cmd/gtroff&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="validate-source-in-automation"&gt;Validate source in automation&lt;a class="anchor" href="#validate-source-in-automation"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;/tmp/gtroff validate --strict testdata/simple.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;/tmp/gtroff validate --format json testdata/simple.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;printf &lt;span style="color:#e6db74"&gt;&amp;#39;.SH NAME\nexample\n&amp;#39;&lt;/span&gt; | /tmp/gtroff validate --format json -&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Documented exit codes: &lt;strong&gt;0&lt;/strong&gt; accepted syntax, &lt;strong&gt;1&lt;/strong&gt; invalid syntax, &lt;strong&gt;2&lt;/strong&gt; usage/selection error, &lt;strong&gt;3&lt;/strong&gt; input/output/resource failure. Distinguish process exit code from a diagnostic&amp;rsquo;s human-readable description. Strict mode rejects warnings; permissive mode preserves unfamiliar syntax where possible.&lt;/p&gt;</description></item></channel></rss>