lend

created pr with lend/style-docs.1 on 2026-11-25T02:22:29Z · by c8ef7d19
cmds
checkout latest patchset:
ssh pr.pico.sh pull lend:style-docs | git am -3
checkout specific patchset revision:
ssh pr.pico.sh pull lend:style-docs [rev] | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh lend:style-docs
add comment to patch request:
ssh pr.pico.sh comment lend:style-docs "lgtm!"

Patchset lend/style-docs.1 on 2026-11-25T02:22:29Z · commit 4a88592

style(docs): tweak terminal design
Eric Bower 2026-11-25T02:19:44Z
Diff stat
10 files changed, 282 insertions(+), 67 deletions(-)
Semantic diff summary
1 added, 1 modified, 0 signature changed, 0 removed across 1 analyzed file (9 files skipped: unsupported file type)
+24 -1 docs/cmd/main.go #
......@@ -1,6 +1,8 @@
11 package main
22
33 import (
4+ "crypto/sha256"
5+ "encoding/hex"
46 "encoding/json"
57 "flag"
68 "fmt"
......@@ -89,9 +91,13 @@ func generate() error {
8991 reference := sitemap.Children[len(sitemap.Children)-2]
9092 reference.Children = append(reference.Children, item)
9193 }
94+ cacheID, err := staticHash()
95+ if err != nil {
96+ return err
97+ }
9298 config := &pdocs.DocConfig{
9399 Logger: slog.Default(), Sitemap: sitemap, Out: output,
94- Tmpl: "tmpl", PageTmpl: "post.page.tmpl",
100+ Tmpl: "tmpl", PageTmpl: "post.page.tmpl", CacheId: cacheID,
95101 }
96102 if err := config.GenSite(); err != nil {
97103 return err
......@@ -108,6 +114,23 @@ func generate() error {
108114 return os.Rename(output, "public")
109115 }
110116
117+func staticHash() (string, error) {
118+ files, err := filepath.Glob("static/*")
119+ if err != nil {
120+ return "", err
121+ }
122+ h := sha256.New()
123+ for _, f := range files {
124+ data, err := os.ReadFile(f)
125+ if err != nil {
126+ return "", err
127+ }
128+ h.Write([]byte(f))
129+ h.Write(data)
130+ }
131+ return hex.EncodeToString(h.Sum(nil))[:8], nil
132+}
133+
111134 func copyTree(source, destination string) error {
112135 return filepath.WalkDir(source, func(path string, entry fs.DirEntry, err error) error {
113136 if err != nil {
+166 -9 docs/static/main.css #
......@@ -8,24 +8,116 @@
88 color: var(--visited);
99 }
1010
11-.sitemap {
11+.sidebar-header {
12+ padding-bottom: var(--grid-height);
13+ border-bottom: 1px dashed var(--grey-light);
14+ margin-bottom: var(--grid-height);
15+ text-transform: uppercase;
16+}
17+
18+.sitemap-pane,
19+.toc-pane {
1220 width: 250px;
13- flex: 0 0 250px;
21+}
22+
23+.toc {
24+ padding: 0;
25+ width: 100%;
26+ height: calc(100vh - 3px - 5 * var(--line-height));
27+ overflow-y: auto;
28+ font-family: var(--font-mono);
29+ font-size: 0.85rem;
30+}
31+
32+.toc ul {
33+ list-style: none;
34+ padding-left: 0;
35+ margin: 0;
36+}
37+
38+.toc > ul > li > a {
39+ font-weight: bold;
40+}
41+
42+.toc ul ul {
43+ padding-left: 1.5ch;
44+ margin: var(--grid-height) 0;
45+}
46+
47+.toc ul ul li {
48+ margin: calc(var(--grid-height) / 2) 0;
49+}
50+
51+.toc ul ul li::before {
52+ content: "> ";
53+}
54+
55+.toc a {
56+ color: var(--text-color);
57+ text-decoration: none;
58+}
59+
60+.toc a:hover {
61+ background-color: var(--link-color);
62+ color: var(--bg-color);
63+ text-decoration: none;
64+}
65+
66+.sitemap {
67+ width: 100%;
1468 margin: 0;
69+ padding: 0;
1570 padding-bottom: 2rem !important;
71+ height: calc(100vh - 3px - 5 * var(--line-height));
1672 overflow-y: auto;
17- height: calc(100vh - 3px - (3 * var(--line-height)));
73+ font-family: var(--font-mono);
74+ font-size: 0.85rem;
75+}
76+
77+.sitemap a {
78+ color: var(--text-color);
79+ text-decoration: none;
80+}
81+
82+.sitemap a:hover {
83+ background-color: var(--link-color);
84+ color: var(--bg-color);
85+ text-decoration: none;
86+}
87+
88+.sitemap .active,
89+.sitemap .active a {
90+ color: var(--green);
91+}
92+
93+.sidebar-sublist {
94+ padding-left: 1.5ch;
95+ margin: var(--grid-height) 0;
96+}
97+
98+.sidebar-sublist li {
99+ margin: calc(var(--grid-height) / 2) 0;
100+}
101+
102+.sidebar-section {
103+ margin-bottom: var(--line-height);
18104 }
19105
20106 .post {
21- max-width: 650px;
22- height: calc(100vh - 3px - (3 * var(--line-height)));
107+ max-width: 800px;
108+ height: calc(100vh - 3px - 3 * var(--line-height));
23109 overflow-y: auto;
24- padding-right: 20px;
110+ padding: 0 2rem;
111+ border-left: 1px dashed var(--grey-light);
112+ border-right: 1px dashed var(--grey-light);
113+}
114+
115+.post .md {
116+ margin-top: var(--line-height);
25117 }
26118
27119 .post-container {
28- max-width: 60rem;
120+ max-width: 100%;
29121 }
30122
31123 .container-xs {
......@@ -61,18 +153,72 @@
61153
62154 .sitemap-grid {
63155 display: grid;
64- grid-template-columns: repeat(2, 1fr);
156+ grid-template-columns: repeat(2, minmax(0, 1fr));
65157 gap: 1rem;
66158 }
67159
160+.sitemap-card {
161+ min-width: 0;
162+ width: 100%;
163+ border: 1px dashed var(--grey-light);
164+ background-color: var(--pre);
165+ padding: var(--grid-height);
166+ font-family: var(--font-mono);
167+ font-size: 0.85rem;
168+}
169+
170+.sitemap-card .sidebar-header {
171+ margin-bottom: var(--grid-height);
172+}
173+
174+.sitemap-page-item {
175+ margin-bottom: var(--grid-height);
176+}
177+
178+.sitemap-page-item > a {
179+ color: var(--text-color);
180+ text-decoration: none;
181+}
182+
183+.sitemap-page-item > a:hover {
184+ background-color: var(--link-color);
185+ color: var(--bg-color);
186+ text-decoration: none;
187+}
188+
189+.sitemap-heading-list {
190+ padding-left: 1.5ch;
191+ margin: calc(var(--grid-height) / 2) 0 0 0;
192+}
193+
194+.sitemap-heading-list li {
195+ margin: 2px 0;
196+ font-size: 0.8rem;
197+}
198+
199+.sitemap-heading-list a {
200+ text-decoration: none;
201+}
202+
203+.sitemap-heading-list a:hover {
204+ background-color: var(--link-color);
205+ color: var(--bg-color);
206+ text-decoration: none;
207+}
208+
68209 .sidebar-list {
69210 padding: 0 0 0 var(--line-height);
70211 }
71212
213+.sidebar-list li {
214+ margin: 5px 0;
215+}
216+
72217 .post-group {
73218 display: flex;
74219 gap: 1rem;
75220 flex-direction: row-reverse;
221+ justify-content: center;
76222 }
77223
78224 @media only screen and (max-width: 800px) {
......@@ -91,12 +237,23 @@
91237 .post {
92238 height: 100%;
93239 overflow-y: unset;
94- padding-right: 0;
240+ padding: 0;
241+ border-left: none;
242+ border-right: none;
243+ }
244+
245+ .toc-pane {
246+ display: none;
247+ }
248+
249+ .sitemap-pane {
250+ width: 100%;
95251 }
96252
97253 .sitemap {
98254 column-count: 2;
99255 width: 100%;
256+ height: auto;
100257 margin-bottom: calc(2 * var(--line-height));
101258 }
102259
+4 -0 docs/static/smol.css #
......@@ -100,6 +100,7 @@ pre > code {
100100 }
101101
102102 code {
103+ font-size: 85%;
103104 border-radius: 0.3rem;
104105 padding: 0.025rem 0.3rem;
105106 }
......@@ -319,6 +320,9 @@ li pre {
319320 table {
320321 border-collapse: collapse;
321322 margin: var(--line-height) 0;
323+ max-width: 100%;
324+ overflow-x: auto;
325+ display: block;
322326 }
323327
324328 th,
+4 -4 docs/tmpl/base.layout.tmpl #
......@@ -8,10 +8,10 @@
88 <meta name="keywords" content="lend, ssh, agent, approval, mcp, touch id" />
99 <meta name="description" content="{{.Data.Description}}" />
1010 <link href="/favicon.svg" rel="icon" type="image/svg+xml"/>
11- <link rel="stylesheet" href="/syntax.css" />
12- <link rel="stylesheet" href="/smol.css" />
13- <link rel="stylesheet" href="/theme.css" />
14- <link rel="stylesheet" href="/main.css" />
11+ <link rel="stylesheet" href="/syntax.css?v={{.CacheId}}" />
12+ <link rel="stylesheet" href="/smol.css?v={{.CacheId}}" />
13+ <link rel="stylesheet" href="/theme.css?v={{.CacheId}}" />
14+ <link rel="stylesheet" href="/main.css?v={{.CacheId}}" />
1515 </head>
1616
1717 <body {{template "attrs" .}}>
+32 -22 docs/tmpl/home.page.tmpl #
......@@ -9,53 +9,63 @@
99
1010 <main id="main">
1111 <div class="flex flex-col gap-2">
12- <div class="flex items-center justify-center hero">
13- <div class="flex flex-col items-center gap-2">
14- <h1 class="logo-header text-2xl">lend</h1>
15- <div class="text-center text-lg">Remote commands, approved on your laptop</div>
16- <a href="/getting-started.html" class="btn-link">GET STARTED</a>
12+ <div class="hero">
13+ <div class="box">
14+ <div class="text-sm mono text-grey mb">lend: ~</div>
15+ <h1 class="m-0"><span class="text-green">$</span> lend ssh</h1>
16+ <p class="mono mt">Remote commands, approved on your laptop</p>
17+ <div class="flex items-center gap my mono">
18+ <a href="/getting-started.html">[get started]</a>
19+ <a href="/sitemap.html">[docs]</a>
20+ </div>
1721 </div>
1822 </div>
1923
2024 <article class="features">
2125 <div class="box">
22- <h2 class="m-0 p-0 text-lg">
26+ <h3 class="m-0">
2327 Commands on your laptop
24- </h2>
25- <p>Keep tools such as <code>gh</code> and <code>op</code> local. Remote requests get the output and exit code back, under your <a href="/command-policy.html">command policy</a>.</p>
28+ </h3>
29+ <p class="my">Keep tools such as <code>gh</code> and <code>op</code> local. Remote requests get the output and exit code back, under your <a href="/command-policy.html">command policy</a>.</p>
2630 </div>
2731
2832 <div class="box">
29- <h2 class="m-0 p-0 text-lg">
33+ <h3 class="m-0">
3034 Your SSH agent, with approval
31- </h2>
32- <p>Choose which <a href="/ssh-keys.html">SSH keys</a> are visible and how they can sign. Each request is checked before it reaches your existing agent.</p>
35+ </h3>
36+ <p class="my">Choose which <a href="/ssh-keys.html">SSH keys</a> are visible and how they can sign. Each request is checked before it reaches your existing agent.</p>
3337 </div>
3438
3539 <div class="box">
36- <h2 class="m-0 p-0 text-lg">
40+ <h3 class="m-0">
3741 Review access locally
38- </h2>
39- <p>Use Touch ID on macOS or a local prompt on Linux. See the request, its reason, and its <a href="/approval.html">caller context</a> before you allow it.</p>
42+ </h3>
43+ <p class="my">Use Touch ID on macOS or a local prompt on Linux. See the request, its reason, and its <a href="/approval.html">caller context</a> before you allow it.</p>
4044 </div>
4145 </article>
4246
43- <article>
44- <pre><code># On your laptop
47+ <div>
48+ <hr />
49+ </div>
50+
51+ <div class="group-2 home-features">
52+ <div class="box">
53+ <pre><code># On your laptop
4554 lend ssh --config ./policy.json -- agent-vm
4655
4756 # On the remote host
4857 lend exec --reason "Inspect the pull request" -- \
4958 gh pr view 123 --repo example/project</code></pre>
59+ </div>
5060
51- <div class="flex justify-center">
52- <a href="/how-it-works.html" class="mt-4 btn-link">LEARN MORE</a>
61+ <div class="text-center mono my">
62+ <a href="/how-it-works.html">[learn more]</a>
5363 </div>
54- </article>
55- </div>
64+ </div>
5665
57- <hr class="my-4" />
66+ <hr class="my-4" />
5867
59- {{template "footer" .}}
68+ {{template "footer" .}}
69+ </div>
6070 </main>
6171 {{end}}
+8 -2 docs/tmpl/nav.partial.tmpl #
......@@ -1,15 +1,21 @@
11 {{define "nav"}}
22 <nav class="mk-nav">
3- <div class="flex flex-wrap items-center justify-center gap-2">
3+ <div class="flex flex-wrap items-center justify-center gap mono text-sm">
44 <a href="/" class="link-alt">
5- lend
5+ <strong>lend</strong>
66 </a>
7+ <span class="text-grey">/</span>
78 <a href="/sitemap.html" class="link-alt">
89 sitemap
910 </a>
11+ <span class="text-grey">/</span>
1012 <a href="https://github.com/antoniomika/lend" class="link-alt">
1113 github
1214 </a>
15+ <span class="text-grey">/</span>
16+ <a href="/getting-started.html" class="link-alt-hover">
17+ [get started]
18+ </a>
1319 </div>
1420 </nav>
1521 {{end}}
+14 -3 docs/tmpl/post.page.tmpl #
......@@ -8,11 +8,20 @@
88 {{template "nav" .}}
99
1010 <div class="post-group">
11+ <aside class="toc-pane">
12+ {{if .Data.TocHtml}}
13+ <div class="sidebar-header mono text-sm text-grey">[OUTLINE]</div>
14+ <div class="toc">
15+ {{.Data.TocHtml}}
16+ </div>
17+ {{end}}
18+ </aside>
19+
1120 <main class="post" id="main">
12- <h1 class="text-2xl text-hdr m-0 flex items-center">
21+ <h1 class="m-0 flex items-center">
1322 {{.Data.Title}}
1423 </h1>
15- <p class="m-0">{{.Data.Description}}</p>
24+ <p class="m-0 mono">{{.Data.Description}}</p>
1625
1726 <hr />
1827
......@@ -24,7 +33,9 @@
2433 {{template "footer" .}}
2534 </main>
2635
27- {{template "sitemap-footer" .}}
36+ <aside class="sitemap-pane">
37+ {{template "sitemap-footer" .}}
38+ </aside>
2839 </div>
2940
3041 {{end}}
+15 -15 docs/tmpl/sitemap-footer.partial.tmpl #
......@@ -1,27 +1,27 @@
11 {{define "sitemap-footer"}}
2- <ul class="sitemap list-none sidebar-list">
2+ <div class="sidebar-header mono text-sm text-grey">[NAV]</div>
3+ <ul class="sitemap mb-4 list-none">
34 {{range .Sitemap.Children}}
4- {{if .Href}}
5- <li>
6- <span class="font-bold">
5+ <li class="sidebar-section">
6+ {{if .Href}}
77 {{if (eq $.Href .GenHref)}}
8- <a href="{{.GenHref}}" class="link-alt-hover">{{.Text}}</a>
8+ <span class="active font-bold"><span class="text-green">></span> <a href="{{.GenHref}}">{{.Text}}</a></span>
99 {{else}}
10- <a href="{{.GenHref}}" class="link-alt">{{.Text}}</a>
10+ <a href="{{.GenHref}}" class="font-bold">{{.Text}}</a>
1111 {{end}}
12- </span>
13- {{else}}
14- <li>
15- <span class="font-bold">{{.Text}}</span>
16- {{end}}
12+ {{else}}
13+ <div class="text-grey font-bold">{{.Text}}</div>
14+ {{end}}
1715
1816 {{if .Children}}
19- <ul class="list-square sidebar-list">
17+ <ul class="list-none sidebar-sublist">
2018 {{range .Children}}
2119 <li>
22- <a href="{{.GenHref}}" class="link-alt{{if (eq $.Href .GenHref)}}-hover{{end}}">
23- {{.Text}}
24- </a>
20+ {{if (eq $.Href .GenHref)}}
21+ <span class="active font-bold"><span class="text-green">></span> <a href="{{.GenHref}}">{{.Text}}</a></span>
22+ {{else}}
23+ <span class="text-grey">•</span> <a href="{{.GenHref}}">{{.Text}}</a>
24+ {{end}}
2525 </li>
2626 {{end}}
2727 </ul>
+6 -4 docs/tmpl/sitemap.page.tmpl #
......@@ -2,18 +2,20 @@
22
33 {{define "title"}}{{.Data.Title}}{{end}}
44
5-{{define "attrs"}}class="container-sm"{{end}}
5+{{define "attrs"}}class="container"{{end}}
66
77 {{define "body"}}
88 {{template "nav" .}}
99
1010 <main id="main">
11- <h1 class="text-2xl text-underline-hdr text-hdr inline-block">{{.Data.Title}}</h1>
12- <h2 class="text-xl">{{.Data.Description}}</h2>
11+ <h1 class="m-0">{{.Data.Title}}</h1>
12+ <p class="m-0 mono text-grey"># {{.Data.Description}}</p>
1313
14- <hr />
14+ <hr class="dashed" />
1515
1616 {{template "toc" .}}
17+
18+ <hr class="dashed" />
1719 </main>
1820
1921 {{template "footer" .}}
+9 -7 docs/tmpl/toc.partial.tmpl #
......@@ -2,20 +2,22 @@
22 <div class="sitemap-grid">
33 {{range .Sitemap.Children -}}
44 {{if .Children}}
5- <div class="box my">
6- <h2 class="text-xl text-underline inline-block">{{.Text}}</h2>
7- <ul class="list-none" style="padding-left: 0;">
5+ <div class="sitemap-card">
6+ <div class="sidebar-header mono text-sm text-grey font-bold">[{{.Text}}]</div>
7+ <ul class="sitemap-tree mono list-none" style="padding-left: 0; margin: 0;">
88 {{range .Children -}}
9- <li>
10- <a href="{{.GenHref}}">{{.Text}}</a>
9+ <li class="sitemap-page-item">
10+ <span class="text-grey">></span> <a href="{{.GenHref}}" class="font-bold">{{.Text}}</a>
1111
12- <ul class="list-disc" style="padding-left: 2rem;">
12+ {{if .Children}}
13+ <ul class="list-none sitemap-heading-list">
1314 {{range .Children}}
1415 <li>
15- <a href="{{.GenHref}}">{{.Text}}</a>
16+ <span class="text-grey">#</span> <a href="{{.GenHref}}">{{.Text}}</a>
1617 </li>
1718 {{end}}
1819 </ul>
20+ {{end}}
1921 </li>
2022 {{- end}}
2123 </ul>
Back to top