zig langref cli nate.tngl.io/zigman
0

Configure Feed

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

zigman / www / index.html
3.0 kB 66 lines
1<!doctype html> 2<html lang="en"> 3<head> 4<meta charset="utf-8"> 5<meta name="viewport" content="width=device-width, initial-scale=1"> 6<title>zigman — the zig language reference in your terminal</title> 7<style> 8 :root { color-scheme: light dark; } 9 body { max-width: 44rem; margin: 4rem auto; padding: 0 1.25rem; 10 font: 16px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; } 11 h1 { font-size: 1.7rem; } h2 { margin-top: 2.5rem; } h3 { opacity: .85; } 12 pre { padding: 1rem; border-radius: .5rem; overflow-x: auto; background: #8881; } 13 code { background: #8881; padding: .1em .3em; border-radius: .25rem; } 14 pre code { background: none; padding: 0; } 15 a { color: inherit; } ul { padding-left: 1.2rem; } 16</style> 17</head> 18<body> 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. it fetches the reference once, caches it, and prints any section as clean markdown.</p> 21<p>source: <a href="https://tangled.org/zzstoatzz.io/zigman">tangled.org/zzstoatzz.io/zigman</a> · MIT</p> 22<h2>install</h2> 23<pre><code>curl -fsSL https://nate.tngl.io/zigman/install.sh | sh 24</code></pre> 25<p>macos and linux, aarch64 and x86_64. installs to <code>$ZIGMAN_INSTALL</code> or <code>~/.local/bin</code>.</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> 28<pre><code>zigman comptime # opens the comptime section 29zigman error # several match, so it lists them 30zigman -l # the whole table of contents 31zigman -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 37cd zigman 38zig build -Doptimize=ReleaseSafe 39</code></pre> 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> 45<pre><code># ~/.zshrc (after compinit) 46eval &quot;$(zigman --completions zsh)&quot; 47 48# ~/.bashrc 49eval &quot;$(zigman --completions bash)&quot; 50 51# ~/.config/fish/config.fish 52zigman --completions fish | source 53</code></pre> 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> 65</body> 66</html>