zig langref cli nate.tngl.io/zigman
0

Configure Feed

Select the types of activity you want to include in your feed.

slim the README/landing page: drop the brag, collapse detail into <details>

- remove the "single static binary: no browser, no runtime, no services" line
- keep intro + install + a few usage examples visible; tuck build-from-source,
completion, and options into <details> blocks (scannable, punchline-first)
- md2html passes <details>/<summary> through verbatim and styles them

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

+81 -53
+35 -31
README.md
··· 2 2 3 3 read the [zig language reference](https://ziglang.org/documentation/master/) in your 4 4 terminal — for humans who don't want a browser tab, and for agents that can't render one. 5 - 6 - the reference is one big HTML page with a stable anchor per section. zigman fetches it 7 - once, caches it, and prints any section as clean markdown with code, tables, and lists 8 - intact. it's a single static binary: no browser, no runtime, no services. 5 + it fetches the reference once, caches it, and prints any section as clean markdown. 9 6 10 7 source: [tangled.org/zzstoatzz.io/zigman](https://tangled.org/zzstoatzz.io/zigman) · MIT 11 8 12 9 ## install 13 - 14 - ### build from source 15 - 16 - requires zig 0.16+. 17 - 18 - ``` 19 - git clone https://tangled.org/zzstoatzz.io/zigman 20 - cd zigman 21 - zig build -Doptimize=ReleaseSafe 22 - ./zig-out/bin/zigman comptime 23 - ``` 24 - 25 - ### or grab a prebuilt binary 26 10 27 11 ``` 28 12 curl -fsSL https://nate.tngl.io/zigman/install.sh | sh ··· 30 14 31 15 macos and linux, aarch64 and x86_64. installs to `$ZIGMAN_INSTALL` or `~/.local/bin`. 32 16 33 - ## usage 17 + ## use 34 18 35 19 type any part of a section's name. a unique match opens it; an ambiguous one lists the 36 - candidates, so you can narrow down. there are no subcommands to learn. 20 + candidates. 37 21 38 22 ``` 39 23 zigman comptime # opens the comptime section 40 24 zigman error # several match, so it lists them 41 25 zigman -l # the whole table of contents 42 - zigman -l pointer # list sections matching "pointer" 43 - zigman -V 0.15.1 comptime # read a specific langref version (default: master) 26 + zigman -V 0.15.1 comptime # read a specific langref version 44 27 ``` 45 28 46 - output is plain markdown. on a terminal it pages through `$PAGER` (default `less -FRX`); 47 - piped, it stays raw — so `zigman comptime | glow -` and `zigman -l | fzf` both just work. 29 + <details> 30 + <summary>build from source</summary> 48 31 49 - ### shell completion 32 + requires zig 0.16+. 50 33 51 - add one line to your shell's startup file — no directories to create: 34 + ``` 35 + git clone https://tangled.org/zzstoatzz.io/zigman 36 + cd zigman 37 + zig build -Doptimize=ReleaseSafe 38 + ``` 39 + 40 + the parser and renderer are a reusable zig module (`src/root.zig`, exported as `zigman`). 41 + `zig build test` runs the unit tests. 42 + 43 + </details> 44 + 45 + <details> 46 + <summary>shell completion</summary> 47 + 48 + add one line to your shell's startup file: 52 49 53 50 ``` 54 51 # ~/.zshrc (after compinit) ··· 61 58 zigman --completions fish | source 62 59 ``` 63 60 64 - completes the query from the live section list. 61 + </details> 65 62 66 - ## library 63 + <details> 64 + <summary>options &amp; paging</summary> 67 65 68 - the parser and renderer are a reusable zig module (`src/root.zig`, exported as `zigman`). 69 - `zig build test` runs the unit tests. 66 + ``` 67 + -l, --list list section names instead of rendering 68 + -V, --version <ver> langref version to read (default: master) 69 + -r, --refresh bypass the cache and refetch 70 + --no-pager don't page output on a terminal 71 + -h, --help show help 72 + ``` 70 73 71 - ## license 74 + output is plain markdown. on a terminal it pages through `$PAGER` (default `less -FRX`); 75 + piped, it stays raw — so `zigman comptime | glow -` and `zigman -l | fzf` both work. 72 76 73 - MIT. 77 + </details>
+19
tools/md2html.zig
··· 25 25 \\ code { background: #8881; padding: .1em .3em; border-radius: .25rem; } 26 26 \\ pre code { background: none; padding: 0; } 27 27 \\ a { color: inherit; } ul { padding-left: 1.2rem; } 28 + \\ details { margin: 1rem 0; border-top: 1px solid #8883; padding-top: .6rem; } 29 + \\ summary { cursor: pointer; opacity: .8; } 28 30 \\</style> 29 31 \\</head> 30 32 \\<body> ··· 80 82 }.call; 81 83 82 84 while (lines.next()) |line| { 85 + // pass raw <details>/<summary> block tags through untouched 86 + if (rawBlock(std.mem.trim(u8, line, " \t"))) { 87 + try flush(w, &para, &in_list); 88 + try w.writeAll(line); 89 + try w.writeByte('\n'); 90 + continue; 91 + } 92 + 83 93 if (std.mem.startsWith(u8, line, "```")) { 84 94 try flush(w, &para, &in_list); 85 95 try w.writeAll("<pre><code>"); ··· 163 173 if (close + 1 >= s.len or s[close + 1] != '(') return null; 164 174 const paren = std.mem.indexOfScalarPos(u8, s, close + 2, ')') orelse return null; 165 175 return .{ .text = s[1..close], .url = s[close + 2 .. paren], .len = paren + 1 }; 176 + } 177 + 178 + /// lines that are a raw <details>/<summary> tag are emitted verbatim so the 179 + /// README's collapsible sections render in both the repo view and the page. 180 + fn rawBlock(line: []const u8) bool { 181 + for ([_][]const u8{ "<details", "</details", "<summary", "</summary" }) |tag| { 182 + if (std.mem.startsWith(u8, line, tag)) return true; 183 + } 184 + return false; 166 185 } 167 186 168 187 fn headingLevel(line: []const u8) u8 {
+27 -22
www/index.html
··· 17 17 </head> 18 18 <body> 19 19 <h1>zigman</h1> 20 - <p>read the <a href="https://ziglang.org/documentation/master/">zig language reference</a> in your terminal — for humans who don't want a browser tab, and for agents that can't render one.</p> 21 - <p>the reference is one big HTML page with a stable anchor per section. zigman fetches it once, caches it, and prints any section as clean markdown with code, tables, and lists intact. it's a single static binary: no browser, no runtime, no services.</p> 20 + <p>read the <a href="https://ziglang.org/documentation/master/">zig language reference</a> in your terminal — for humans who don't want a browser tab, and for agents that can't render one. it fetches the reference once, caches it, and prints any section as clean markdown.</p> 22 21 <p>source: <a href="https://tangled.org/zzstoatzz.io/zigman">tangled.org/zzstoatzz.io/zigman</a> · MIT</p> 23 22 <h2>install</h2> 24 - <h3>build from source</h3> 25 - <p>requires zig 0.16+.</p> 26 - <pre><code>git clone https://tangled.org/zzstoatzz.io/zigman 27 - cd zigman 28 - zig build -Doptimize=ReleaseSafe 29 - ./zig-out/bin/zigman comptime 30 - </code></pre> 31 - <h3>or grab a prebuilt binary</h3> 32 23 <pre><code>curl -fsSL https://nate.tngl.io/zigman/install.sh | sh 33 24 </code></pre> 34 25 <p>macos and linux, aarch64 and x86_64. installs to <code>$ZIGMAN_INSTALL</code> or <code>~/.local/bin</code>.</p> 35 - <h2>usage</h2> 36 - <p>type any part of a section's name. a unique match opens it; an ambiguous one lists the candidates, so you can narrow down. there are no subcommands to learn.</p> 26 + <h2>use</h2> 27 + <p>type any part of a section's name. a unique match opens it; an ambiguous one lists the candidates.</p> 37 28 <pre><code>zigman comptime # opens the comptime section 38 29 zigman error # several match, so it lists them 39 30 zigman -l # the whole table of contents 40 - zigman -l pointer # list sections matching &quot;pointer&quot; 41 - zigman -V 0.15.1 comptime # read a specific langref version (default: master) 31 + zigman -V 0.15.1 comptime # read a specific langref version 32 + </code></pre> 33 + <details> 34 + <summary>build from source</summary> 35 + <p>requires zig 0.16+.</p> 36 + <pre><code>git clone https://tangled.org/zzstoatzz.io/zigman 37 + cd zigman 38 + zig build -Doptimize=ReleaseSafe 42 39 </code></pre> 43 - <p>output is plain markdown. on a terminal it pages through <code>$PAGER</code> (default <code>less -FRX</code>); piped, it stays raw — so <code>zigman comptime | glow -</code> and <code>zigman -l | fzf</code> both just work.</p> 44 - <h3>shell completion</h3> 45 - <p>add one line to your shell's startup file — no directories to create:</p> 40 + <p>the parser and renderer are a reusable zig module (<code>src/root.zig</code>, exported as <code>zigman</code>). <code>zig build test</code> runs the unit tests.</p> 41 + </details> 42 + <details> 43 + <summary>shell completion</summary> 44 + <p>add one line to your shell's startup file:</p> 46 45 <pre><code># ~/.zshrc (after compinit) 47 46 eval &quot;$(zigman --completions zsh)&quot; 48 47 ··· 52 51 # ~/.config/fish/config.fish 53 52 zigman --completions fish | source 54 53 </code></pre> 55 - <p>completes the query from the live section list.</p> 56 - <h2>library</h2> 57 - <p>the parser and renderer are a reusable zig module (<code>src/root.zig</code>, exported as <code>zigman</code>). <code>zig build test</code> runs the unit tests.</p> 58 - <h2>license</h2> 59 - <p>MIT.</p> 54 + </details> 55 + <details> 56 + <summary>options &amp; paging</summary> 57 + <pre><code>-l, --list list section names instead of rendering 58 + -V, --version &lt;ver&gt; langref version to read (default: master) 59 + -r, --refresh bypass the cache and refetch 60 + --no-pager don't page output on a terminal 61 + -h, --help show help 62 + </code></pre> 63 + <p>output is plain markdown. on a terminal it pages through <code>$PAGER</code> (default <code>less -FRX</code>); piped, it stays raw — so <code>zigman comptime | glow -</code> and <code>zigman -l | fzf</code> both work.</p> 64 + </details> 60 65 </body> 61 66 </html>
www/release/aarch64-linux.tar.gz

This is a binary file and will not be displayed.

www/release/aarch64-macos.tar.gz

This is a binary file and will not be displayed.

www/release/x86_64-linux.tar.gz

This is a binary file and will not be displayed.

www/release/x86_64-macos.tar.gz

This is a binary file and will not be displayed.