lend
created pr with
lend/style-docs.1
cmds
checkout latest patchset:
ssh pr.pico.sh pull lend:style-docs | git am -3checkout specific patchset revision:
ssh pr.pico.sh pull lend:style-docs [rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh lend:style-docsadd comment to patch request:
ssh pr.pico.sh comment lend:style-docs "lgtm!"
Patchset
lend/style-docs.1
style(docs): tweak terminal design
Eric Bower
2026-11-25T02:19:44ZDiff 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
#
| ... | ... | @@ -89,9 +91,13 @@ func generate() error { | |
| 89 | 91 | reference := sitemap.Children[len(sitemap.Children)-2] | |
| 90 | 92 | reference.Children = append(reference.Children, item) | |
| 91 | 93 | } | |
| 94 | + | cacheID, err := staticHash() | |
| 95 | + | if err != nil { | |
| 96 | + | return err | |
| 97 | + | } | |
| 92 | 98 | config := &pdocs.DocConfig{ | |
| 93 | 99 | Logger: slog.Default(), Sitemap: sitemap, Out: output, | |
| 94 | - | Tmpl: "tmpl", PageTmpl: "post.page.tmpl", | |
| 100 | + | Tmpl: "tmpl", PageTmpl: "post.page.tmpl", CacheId: cacheID, | |
| 95 | 101 | } | |
| 96 | 102 | if err := config.GenSite(); err != nil { | |
| 97 | 103 | return err |
| ... | ... | @@ -108,6 +114,23 @@ func generate() error { | |
| 108 | 114 | return os.Rename(output, "public") | |
| 109 | 115 | } | |
| 110 | 116 | ||
| 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 | + | ||
| 111 | 134 | func copyTree(source, destination string) error { | |
| 112 | 135 | return filepath.WalkDir(source, func(path string, entry fs.DirEntry, err error) error { | |
| 113 | 136 | if err != nil { |
+166
-9
docs/static/main.css
#
| ... | ... | @@ -8,24 +8,116 @@ | |
| 8 | 8 | color: var(--visited); | |
| 9 | 9 | } | |
| 10 | 10 | ||
| 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 { | |
| 12 | 20 | 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%; | |
| 14 | 68 | margin: 0; | |
| 69 | + | padding: 0; | |
| 15 | 70 | padding-bottom: 2rem !important; | |
| 71 | + | height: calc(100vh - 3px - 5 * var(--line-height)); | |
| 16 | 72 | 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); | |
| 18 | 104 | } | |
| 19 | 105 | ||
| 20 | 106 | .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)); | |
| 23 | 109 | 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); | |
| 25 | 117 | } | |
| 26 | 118 | ||
| 27 | 119 | .post-container { | |
| 28 | - | max-width: 60rem; | |
| 120 | + | max-width: 100%; | |
| 29 | 121 | } | |
| 30 | 122 | ||
| 31 | 123 | .container-xs { |
| ... | ... | @@ -61,18 +153,72 @@ | |
| 61 | 153 | ||
| 62 | 154 | .sitemap-grid { | |
| 63 | 155 | display: grid; | |
| 64 | - | grid-template-columns: repeat(2, 1fr); | |
| 156 | + | grid-template-columns: repeat(2, minmax(0, 1fr)); | |
| 65 | 157 | gap: 1rem; | |
| 66 | 158 | } | |
| 67 | 159 | ||
| 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 | + | ||
| 68 | 209 | .sidebar-list { | |
| 69 | 210 | padding: 0 0 0 var(--line-height); | |
| 70 | 211 | } | |
| 71 | 212 | ||
| 213 | + | .sidebar-list li { | |
| 214 | + | margin: 5px 0; | |
| 215 | + | } | |
| 216 | + | ||
| 72 | 217 | .post-group { | |
| 73 | 218 | display: flex; | |
| 74 | 219 | gap: 1rem; | |
| 75 | 220 | flex-direction: row-reverse; | |
| 221 | + | justify-content: center; | |
| 76 | 222 | } | |
| 77 | 223 | ||
| 78 | 224 | @media only screen and (max-width: 800px) { |
| ... | ... | @@ -91,12 +237,23 @@ | |
| 91 | 237 | .post { | |
| 92 | 238 | height: 100%; | |
| 93 | 239 | 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%; | |
| 95 | 251 | } | |
| 96 | 252 | ||
| 97 | 253 | .sitemap { | |
| 98 | 254 | column-count: 2; | |
| 99 | 255 | width: 100%; | |
| 256 | + | height: auto; | |
| 100 | 257 | margin-bottom: calc(2 * var(--line-height)); | |
| 101 | 258 | } | |
| 102 | 259 |
+4
-0
docs/static/smol.css
#
+4
-4
docs/tmpl/base.layout.tmpl
#
| ... | ... | @@ -8,10 +8,10 @@ | |
| 8 | 8 | <meta name="keywords" content="lend, ssh, agent, approval, mcp, touch id" /> | |
| 9 | 9 | <meta name="description" content="{{.Data.Description}}" /> | |
| 10 | 10 | <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}}" /> | |
| 15 | 15 | </head> | |
| 16 | 16 | ||
| 17 | 17 | <body {{template "attrs" .}}> |
+32
-22
docs/tmpl/home.page.tmpl
#
| ... | ... | @@ -9,53 +9,63 @@ | |
| 9 | 9 | ||
| 10 | 10 | <main id="main"> | |
| 11 | 11 | <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> | |
| 17 | 21 | </div> | |
| 18 | 22 | </div> | |
| 19 | 23 | ||
| 20 | 24 | <article class="features"> | |
| 21 | 25 | <div class="box"> | |
| 22 | - | <h2 class="m-0 p-0 text-lg"> | |
| 26 | + | <h3 class="m-0"> | |
| 23 | 27 | 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> | |
| 26 | 30 | </div> | |
| 27 | 31 | ||
| 28 | 32 | <div class="box"> | |
| 29 | - | <h2 class="m-0 p-0 text-lg"> | |
| 33 | + | <h3 class="m-0"> | |
| 30 | 34 | 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> | |
| 33 | 37 | </div> | |
| 34 | 38 | ||
| 35 | 39 | <div class="box"> | |
| 36 | - | <h2 class="m-0 p-0 text-lg"> | |
| 40 | + | <h3 class="m-0"> | |
| 37 | 41 | 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> | |
| 40 | 44 | </div> | |
| 41 | 45 | </article> | |
| 42 | 46 | ||
| 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 | |
| 45 | 54 | lend ssh --config ./policy.json -- agent-vm | |
| 46 | 55 | ||
| 47 | 56 | # On the remote host | |
| 48 | 57 | lend exec --reason "Inspect the pull request" -- \ | |
| 49 | 58 | gh pr view 123 --repo example/project</code></pre> | |
| 59 | + | </div> | |
| 50 | 60 | ||
| 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> | |
| 53 | 63 | </div> | |
| 54 | - | </article> | |
| 55 | - | </div> | |
| 64 | + | </div> | |
| 56 | 65 | ||
| 57 | - | <hr class="my-4" /> | |
| 66 | + | <hr class="my-4" /> | |
| 58 | 67 | ||
| 59 | - | {{template "footer" .}} | |
| 68 | + | {{template "footer" .}} | |
| 69 | + | </div> | |
| 60 | 70 | </main> | |
| 61 | 71 | {{end}} |
+14
-3
docs/tmpl/post.page.tmpl
#
| ... | ... | @@ -8,11 +8,20 @@ | |
| 8 | 8 | {{template "nav" .}} | |
| 9 | 9 | ||
| 10 | 10 | <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 | + | ||
| 11 | 20 | <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"> | |
| 13 | 22 | {{.Data.Title}} | |
| 14 | 23 | </h1> | |
| 15 | - | <p class="m-0">{{.Data.Description}}</p> | |
| 24 | + | <p class="m-0 mono">{{.Data.Description}}</p> | |
| 16 | 25 | ||
| 17 | 26 | <hr /> | |
| 18 | 27 |
+6
-4
docs/tmpl/sitemap.page.tmpl
#
| ... | ... | @@ -2,18 +2,20 @@ | |
| 2 | 2 | ||
| 3 | 3 | {{define "title"}}{{.Data.Title}}{{end}} | |
| 4 | 4 | ||
| 5 | - | {{define "attrs"}}class="container-sm"{{end}} | |
| 5 | + | {{define "attrs"}}class="container"{{end}} | |
| 6 | 6 | ||
| 7 | 7 | {{define "body"}} | |
| 8 | 8 | {{template "nav" .}} | |
| 9 | 9 | ||
| 10 | 10 | <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> | |
| 13 | 13 | ||
| 14 | - | <hr /> | |
| 14 | + | <hr class="dashed" /> | |
| 15 | 15 | ||
| 16 | 16 | {{template "toc" .}} | |
| 17 | + | ||
| 18 | + | <hr class="dashed" /> | |
| 17 | 19 | </main> | |
| 18 | 20 | ||
| 19 | 21 | {{template "footer" .}} |
+9
-7
docs/tmpl/toc.partial.tmpl
#
| ... | ... | @@ -2,20 +2,22 @@ | |
| 2 | 2 | <div class="sitemap-grid"> | |
| 3 | 3 | {{range .Sitemap.Children -}} | |
| 4 | 4 | {{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;"> | |
| 8 | 8 | {{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> | |
| 11 | 11 | ||
| 12 | - | <ul class="list-disc" style="padding-left: 2rem;"> | |
| 12 | + | {{if .Children}} | |
| 13 | + | <ul class="list-none sitemap-heading-list"> | |
| 13 | 14 | {{range .Children}} | |
| 14 | 15 | <li> | |
| 15 | - | <a href="{{.GenHref}}">{{.Text}}</a> | |
| 16 | + | <span class="text-grey">#</span> <a href="{{.GenHref}}">{{.Text}}</a> | |
| 16 | 17 | </li> | |
| 17 | 18 | {{end}} | |
| 18 | 19 | </ul> | |
| 20 | + | {{end}} | |
| 19 | 21 | </li> | |
| 20 | 22 | {{- end}} | |
| 21 | 23 | </ul> |