v0.17.0 ab8e178

blob-code.html RawHistoryFolder

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<meta name="color-scheme" content="light dark">
7<title>main.go · files · example.test</title>
8<meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff">
9<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#0c0c0c">
10<meta name="apple-mobile-web-app-title" content="ermite">
11<link rel="icon" type="image/svg+xml" href="/-/static/img/icon.HASH.svg">
12<link rel="apple-touch-icon" href="/-/static/app/apple-touch-icon.HASH.png">
13<link rel="manifest" href="/-/static/app/manifest.HASH.webmanifest">
14<link rel="preload" href="/-/static/fonts/atkinson-next.HASH.woff2" as="font" type="font/woff2" crossorigin>
15<link rel="stylesheet" href="/-/static/css/ermite.HASH.css">
16<meta name="htmx-config" content='{"history":false,"includeIndicatorCSS":false,"extensions":"sse, hx-live"}'>
17<script src="/-/static/js/htmx.min.HASH.js" defer>
18</script>
19<script src="/-/static/js/hx-live.min.HASH.js" defer>
20</script>
21<script src="/-/static/js/hx-sse.min.HASH.js" defer>
22</script>
23<script src="/-/static/js/ermite.HASH.js" defer>
24</script>
25<script src="/-/static/js/files.HASH.js" defer>
26</script>
27<script src="/-/static/js/passkey.HASH.js" defer>
28</script>
29<script src="/-/static/js/log.HASH.js" defer>
30</script>
31</head>
32<body data-ref="main" data-sha="SHA40" data-sel="" data-nav="" data-paths="/files/paths/SHA40" data-blob="/files/blob/main">
33<a class="skip" href="#main">skip to content</a>
34<header class="hdr">
35<div class="hdr-top">
36<a class="brand" href="/" data-g="h" aria-label="home" title="home (g h)">
37<span class="brand-mark" aria-hidden="true">
38</span>
39</a>
40<nav class="crumbs" aria-label="Path">
41<ol>
42<li>
43<a href="/files">files</a>
44</li>
45<li>
46<a href="/files/tree/main">blob</a>
47</li>
48<li>
49<a href="/files/tree/main">main</a>
50</li>
51<li>
52<a href="/files/blob/main/main.go" aria-current="page">main.go</a>
53</li>
54</ol>
55</nav>
56<div class="hdr-acts">
57<a class="btn ref" href="/files/refs" data-fire="refs" aria-keyshortcuts="b" title="switch branch or tag (b)">
58<span class="ico i-branch" aria-hidden="true">
59</span>
60<span class="ref-name">main</span>
61<span class="sha">SHA7</span>
62</a>
63<button type="button" class="btn search" data-js aria-haspopup="dialog" aria-controls="panel-cmd" aria-keyshortcuts="Control+K :" title="go to a section, ref, file or repo (ctrl k or :)" data-fire="cmd">
64<span class="ico i-search" aria-hidden="true">
65</span>
66<span class="search-label">Go to…</span>
67<kbd aria-hidden="true">ctrl k</kbd>
68</button>
69</div>
70</div>
71<nav class="tabs" aria-label="Sections">
72<ul>
73<li>
74<a href="/files" data-key="s" aria-keyshortcuts="s">Summary<kbd aria-hidden="true">s</kbd>
75</a>
76</li>
77<li>
78<a href="/files/tree/main" data-key="t" aria-keyshortcuts="t" aria-current="page">Files<kbd aria-hidden="true">t</kbd>
79</a>
80</li>
81<li>
82<a href="/files/commits/main" data-key="c" aria-keyshortcuts="c">Commits<kbd aria-hidden="true">c</kbd>
83</a>
84</li>
85<li>
86<a href="/files/refs" data-key="r" aria-keyshortcuts="r">Branches &amp; tags<kbd aria-hidden="true">r</kbd>
87</a>
88</li>
89<li>
90<a href="/files/merge-requests" data-key="m" aria-keyshortcuts="m">Merge requests<kbd aria-hidden="true">m</kbd>
91</a>
92</li>
93<li>
94<a href="/files/actions" data-key="a" aria-keyshortcuts="a">Actions<kbd aria-hidden="true">a</kbd>
95</a>
96</li>
97</ul>
98</nav>
99</header>
100<div class="work has-rail">
101<main id="main" tabindex="-1">
102<h1 class="file-h">
103<span>main.go</span>
104<span class="acts">
105<a class="btn" href="/files/raw/main/main.go">Raw</a>
106<a class="btn" href="/files/commits/main/main.go">History</a>
107<a class="btn" href="/files/tree/main">Folder</a>
108</span>
109</h1>
110<pre class="chroma code" data-anchor="" hx-on:click="let a = event.target.closest('a.ln'); if (!a) return; event.preventDefault();
111    let n = +a.textContent; if (!event.shiftKey || !data.anchor) data.anchor = n;
112    let lo = Math.min(+data.anchor, n), hi = Math.max(+data.anchor, n);
113    history.replaceState(null, '', '#L' + lo + (hi > lo ? '-L' + hi : '')); trigger('sel')" hx-on:sel="let m = location.hash.match(/^#L(\d+)(?:-L(\d+))?$/); let lo = m ? +m[1] : 0, hi = m ? +(m[2] || m[1]) : 0;
114    q('.line in this').arr().forEach(l => { let k = +l.id.slice(1); l.classList.toggle('sel', k >= lo && k <= hi) });
115    document.body.dataset.sel = lo ? 'L' + lo + (hi > lo ? '-L' + hi + ' · ' + (hi - lo + 1) + ' lines' : '') : '';
116    if (lo && event.detail?.scroll) document.getElementById('L' + lo)?.scrollIntoView({ block: 'center' })" hx-live="if (!data.ready) { data.ready = '1'; trigger('sel', { scroll: true }) }" data-ready="">
117<code hx-ignore>
118<span class="line" id="L1">
119<a class="ln" href="#L1">1</a>
120<span class="kn">package</span>
121<span class="w">
122</span>
123<span class="nx">main</span>
124</span>
125<span class="line" id="L2">
126<a class="ln" href="#L2">2</a>
127</span>
128<span class="line" id="L3">
129<a class="ln" href="#L3">3</a>
130<span class="kn">import</span>
131<span class="w">
132</span>
133<span class="s">&#34;fmt&#34;</span>
134</span>
135<span class="line" id="L4">
136<a class="ln" href="#L4">4</a>
137</span>
138<span class="line" id="L5">
139<a class="ln" href="#L5">5</a>
140<span class="c1">// main prints.</span>
141</span>
142<span class="line" id="L6">
143<a class="ln" href="#L6">6</a>
144<span class="kd">func</span>
145<span class="w">
146</span>
147<span class="nf">main</span>
148<span class="p">()</span>
149<span class="w">
150</span>
151<span class="p">{</span>
152</span>
153<span class="line" id="L7">
154<a class="ln" href="#L7">7</a>
155<span class="w">
156</span>
157<span class="nx">fmt</span>
158<span class="p">.</span>
159<span class="nf">Println</span>
160<span class="p">(</span>
161<span class="s">&#34;hi &lt;b&gt;&#34;</span>
162<span class="p">,</span>
163<span class="w">
164</span>
165<span class="mi">42</span>
166<span class="p">)</span>
167</span>
168<span class="line" id="L8">
169<a class="ln" href="#L8">8</a>
170<span class="p">}</span>
171</span>
172</code>
173</pre>
174</main>
175<aside class="rail" aria-label="Context">
176<section aria-labelledby="r-file">
177<h2 id="r-file">File</h2>
178<dl class="kv">
179<dt>size</dt>
180<dd>87 B</dd>
181<dt>lines</dt>
182<dd>8</dd>
183<dt>type</dt>
184<dd>Go</dd>
185</dl>
186</section>
187<section aria-labelledby="r-last">
188<h2 id="r-last">Last change <a href="/files/commits/main/main.go">History</a>
189</h2>
190<p>
191<a href="/files/commit/SHA40">SHA7</a> add main.go</p>
192<p class="dim">T · <time datetime="STAMP" title="STAMP">AGO</time>
193</p>
194</section>
195<section aria-labelledby="r-sel">
196<h2 id="r-sel">Selection</h2>
197<p :text="document.body.dataset.sel || 'none · click a line number, shift-click extends'">none · click a line number, shift-click extends</p>
198<p class="dim">y copies a permalink pinned to the commit sha</p>
199</section>
200</aside>
201</div>
202<footer class="foot">
203<span>ermite devel</span>
204<a href="http://example.test/ermite" rel="noopener" title="source of this version (AGPL-3.0-or-later)">source</a>
205<button type="button" class="foot-keys" data-js data-fire="help" aria-haspopup="dialog" aria-controls="panel-help" aria-keyshortcuts="?">
206<kbd aria-hidden="true">?</kbd> keyboard shortcuts</button>
207</footer>
208<div class="hint" role="status" aria-live="polite">
209<span class="hint-nav" :text="document.body.dataset.nav || ''">
210</span>
211<span class="hint-sel" :text="document.body.dataset.sel ? document.body.dataset.sel + ' · y permalink' : ''">
212</span>
213<span class="hint-flash" :text="document.body.dataset.flash || ''">
214</span>
215</div>
216<dialog id="panel-help" class="panel modal" aria-label="Keyboard shortcuts" hx-on:keydown="event.key === 'Escape' && (event.preventDefault(), this.close())" hx-on:click="event.target === this && this.close()">
217<div class="panel-head">
218<h2>Keyboard shortcuts</h2>
219<button type="button" class="panel-x" aria-label="Close" hx-on:click="closest('dialog').close()">
220<kbd>esc</kbd> close</button>
221</div>
222<dl class="keys">
223<div>
224<dt>
225<kbd>ctrl k</kbd>
226<kbd>:</kbd>
227</dt>
228<dd>go to a section, branch, tag, file or repository</dd>
229</div>
230<div>
231<dt>
232<kbd>?</kbd>
233</dt>
234<dd>this list</dd>
235</div>
236<div>
237<dt>
238<kbd>j</kbd>
239<kbd>k</kbd>
240</dt>
241<dd>move the row cursor down / up</dd>
242</div>
243<div>
244<dt>
245<kbd>enter</kbd>
246</dt>
247<dd>open the row under the cursor</dd>
248</div>
249<div>
250<dt>
251<kbd>g g</kbd>
252<kbd>G</kbd>
253</dt>
254<dd>first / last row</dd>
255</div>
256<div>
257<dt>
258<kbd>/</kbd>
259</dt>
260<dd>filter the list; on Files, find a file in the repository</dd>
261</div>
262<div>
263<dt>
264<kbd>b</kbd>
265</dt>
266<dd>switch branch or tag</dd>
267</div>
268<div>
269<dt>
270<kbd>s</kbd>
271<kbd>t</kbd>
272<kbd>c</kbd>
273<kbd>r</kbd>
274<kbd>m</kbd>
275</dt>
276<dd>tabs: summary, files, commits, branches &amp; tags, merge requests</dd>
277</div>
278<div>
279<dt>
280<kbd>g h</kbd>
281</dt>
282<dd>home</dd>
283</div>
284<div>
285<dt>
286<kbd>y</kbd>
287</dt>
288<dd>copy a permalink pinned to the commit</dd>
289</div>
290<div>
291<dt>
292<kbd>d</kbd>
293<kbd>u</kbd>
294<kbd>x</kbd>
295</dt>
296<dd>diff: split / unified / collapse or expand all</dd>
297</div>
298<div>
299<dt>
300<kbd>n</kbd>
301</dt>
302<dd>merge request: next note in the diff</dd>
303</div>
304<div>
305<dt>
306<kbd>esc</kbd>
307</dt>
308<dd>close a dialog, leave a field</dd>
309</div>
310</dl>
311</dialog>
312<dialog id="panel-refs" class="panel modal" aria-label="Switch ref" hx-on:keydown="event.key === 'Escape' && (event.preventDefault(), this.close())" hx-on:click="event.target === this && this.close()">
313<div class="panel-head">
314<label for="refs-filter" class="sr">filter branches and tags</label>
315<input id="refs-filter" type="search" placeholder="Switch branch or tag…" autocomplete="off" data-pick="#panel-refs li" hx-on:input="ermite.filter(this)">
316<button type="button" class="panel-x" aria-label="Close" hx-on:click="closest('dialog').close()">
317<kbd>esc</kbd>
318</button>
319</div>
320<div class="panel-cols" data-picklist>
321<section aria-label="Branches">
322<h2>Branches <span class="count">2</span>
323</h2>
324<ul>
325<li>
326<a href="/files/tree/feature/x">
327<span class="mark" aria-hidden="true">&nbsp;</span>feature/x</a>
328</li>
329<li>
330<a href="/files/tree/main" aria-current="true">
331<span class="mark" aria-hidden="true">●</span>main</a>
332</li>
333</ul>
334</section>
335<section aria-label="Tags">
336<h2>Tags <span class="count">1</span>
337</h2>
338<ul>
339<li>
340<a href="/files/tree/v1.0">
341<span class="mark" aria-hidden="true">&nbsp;</span>v1.0</a>
342</li>
343</ul>
344</section>
345</div>
346</dialog>
347<dialog id="panel-cmd" class="panel modal" aria-label="Go to" hx-on:close="ermiteFinder.paletteClose()" hx-on:keydown="event.key === 'Escape' && (event.preventDefault(), this.close())" hx-on:click="event.target === this && this.close()">
348<div class="panel-head">
349<label for="cmd-q" class="sr">go to</label>
350<input id="cmd-q" type="search" placeholder="Go to a section, branch, tag, file or repository…" autocomplete="off" spellcheck="false" aria-controls="cmd-list" hx-on:input="ermite.cmdFilter(this); ermiteFinder.palette(this)" hx-on:keydown="ermite.cmdKey(event)">
351<button type="button" class="panel-x" aria-label="Close" hx-on:click="closest('dialog').close()">
352<kbd>esc</kbd>
353</button>
354</div>
355<ul id="cmd-list" class="cmd-list" aria-label="Targets">
356<li data-k="go home" data-cursor>
357<a href="/" tabindex="-1">
358<span class="lbl">home</span>
359<span class="k">go</span>
360</a>
361</li>
362<li data-k="section summary">
363<a href="/files" tabindex="-1">
364<span class="lbl">summary</span>
365<span class="k">section</span>
366</a>
367</li>
368<li data-k="section files">
369<a href="/files/tree/main" tabindex="-1">
370<span class="lbl">files</span>
371<span class="k">section</span>
372</a>
373</li>
374<li data-k="section commits">
375<a href="/files/commits/main" tabindex="-1">
376<span class="lbl">commits</span>
377<span class="k">section</span>
378</a>
379</li>
380<li data-k="section branches &amp; tags">
381<a href="/files/refs" tabindex="-1">
382<span class="lbl">branches &amp; tags</span>
383<span class="k">section</span>
384</a>
385</li>
386<li data-k="section merge requests">
387<a href="/files/merge-requests" tabindex="-1">
388<span class="lbl">merge requests</span>
389<span class="k">section</span>
390</a>
391</li>
392<li data-k="section actions">
393<a href="/files/actions" tabindex="-1">
394<span class="lbl">actions</span>
395<span class="k">section</span>
396</a>
397</li>
398<li data-k="branch feature/x">
399<a href="/files/tree/feature/x" tabindex="-1">
400<span class="lbl">feature/x</span>
401<span class="k">branch</span>
402</a>
403</li>
404<li data-k="branch main">
405<a href="/files/tree/main" tabindex="-1">
406<span class="lbl">main</span>
407<span class="k">branch</span>
408</a>
409</li>
410<li data-k="tag v1.0">
411<a href="/files/tree/v1.0" tabindex="-1">
412<span class="lbl">v1.0</span>
413<span class="k">tag</span>
414</a>
415</li>
416</ul>
417<p class="panel-foot">
418<span>
419<kbd>↑</kbd>
420<kbd>↓</kbd> move</span>
421<span>
422<kbd>enter</kbd> open</span>
423<span>
424<kbd>esc</kbd> close</span>
425</p>
426</dialog>
427<div id="keys" hidden hx-on="k-j from:body -> ermite.move(1);
428         k-k from:body -> ermite.move(-1);
429         k-top from:body -> ermite.edge(false);
430         k-bottom from:body -> ermite.edge(true);
431         k-open from:body -> ermite.open();
432         k-esc from:body -> ermite.closeDialogs();
433         k-help from:body -> ermite.dialog('panel-help');
434         k-refs from:body -> ermite.dialog('panel-refs', 'refs-filter');
435         k-cmd from:body -> ermite.dialog('panel-cmd', 'cmd-q'); ermiteFinder.load();
436         k-filter from:body -> ermite.focusFilter();
437         k-gh from:body -> ermite.go('.brand');
438         k-s from:body -> ermite.tab('s');
439         k-t from:body -> ermite.tab('t');
440         k-c from:body -> ermite.tab('c');
441         k-r from:body -> ermite.tab('r');
442         k-m from:body -> ermite.tab('m');
443         k-next from:body -> ermite.nextNote();
444         k-split from:body -> ermite.layout('split');
445         k-unified from:body -> ermite.layout('unified');
446         k-collapse from:body -> ermite.collapse();
447         k-permalink from:body -> ermite.permalink()">
448</div>
449</body>
450</html>

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 2

Tags 45

↑↓ moveenter openesc close