v0.19.0 55a688e

blob_templ.go RawHistoryFolder

1// Code generated by templ - DO NOT EDIT.
2
3// templ: version: v0.3.1020
4// SPDX-License-Identifier: AGPL-3.0-or-later
5
6package web
7
8//lint:file-ignore SA4006 This context is only used if a nested component is present.
9
10import "github.com/a-h/templ"
11import templruntime "github.com/a-h/templ/runtime"
12
13import "html/template"
14
15// Blob is a file: its title with the actions, the notice of a state (too
16// large, binary, empty), the code, the rendered Markdown with its source
17// under a fold, or the image; the rail holds the facts, the last change, the
18// outline and the line selection.
19func Blob(l Layout, p BlobPage) templ.Component {
20	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
21		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
22		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
23			return templ_7745c5c3_CtxErr
24		}
25		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
26		if !templ_7745c5c3_IsBuffer {
27			defer func() {
28				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
29				if templ_7745c5c3_Err == nil {
30					templ_7745c5c3_Err = templ_7745c5c3_BufErr
31				}
32			}()
33		}
34		ctx = templ.InitializeContext(ctx)
35		templ_7745c5c3_Var1 := templ.GetChildren(ctx)
36		if templ_7745c5c3_Var1 == nil {
37			templ_7745c5c3_Var1 = templ.NopComponent
38		}
39		ctx = templ.ClearChildren(ctx)
40		templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
41			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
42			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
43			if !templ_7745c5c3_IsBuffer {
44				defer func() {
45					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
46					if templ_7745c5c3_Err == nil {
47						templ_7745c5c3_Err = templ_7745c5c3_BufErr
48					}
49				}()
50			}
51			ctx = templ.InitializeContext(ctx)
52			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<h1 class=\"file-h\"><span>")
53			if templ_7745c5c3_Err != nil {
54				return templ_7745c5c3_Err
55			}
56			var templ_7745c5c3_Var3 string
57			templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(p.Name)
58			if templ_7745c5c3_Err != nil {
59				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/blob.templ`, Line: 14, Col: 17}
60			}
61			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
62			if templ_7745c5c3_Err != nil {
63				return templ_7745c5c3_Err
64			}
65			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</span> <span class=\"acts\"><a class=\"btn\" href=\"")
66			if templ_7745c5c3_Err != nil {
67				return templ_7745c5c3_Err
68			}
69			var templ_7745c5c3_Var4 templ.SafeURL
70			templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.RawHref))
71			if templ_7745c5c3_Err != nil {
72				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/blob.templ`, Line: 15, Col: 68}
73			}
74			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
75			if templ_7745c5c3_Err != nil {
76				return templ_7745c5c3_Err
77			}
78			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\">Raw</a><a class=\"btn\" href=\"")
79			if templ_7745c5c3_Err != nil {
80				return templ_7745c5c3_Err
81			}
82			var templ_7745c5c3_Var5 templ.SafeURL
83			templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.HistHref))
84			if templ_7745c5c3_Err != nil {
85				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/blob.templ`, Line: 15, Col: 125}
86			}
87			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
88			if templ_7745c5c3_Err != nil {
89				return templ_7745c5c3_Err
90			}
91			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\">History</a><a class=\"btn\" href=\"")
92			if templ_7745c5c3_Err != nil {
93				return templ_7745c5c3_Err
94			}
95			var templ_7745c5c3_Var6 templ.SafeURL
96			templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.DirHref))
97			if templ_7745c5c3_Err != nil {
98				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/blob.templ`, Line: 15, Col: 185}
99			}
100			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
101			if templ_7745c5c3_Err != nil {
102				return templ_7745c5c3_Err
103			}
104			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "\">Folder</a></span></h1>")
105			if templ_7745c5c3_Err != nil {
106				return templ_7745c5c3_Err
107			}
108			if p.Notice != "" {
109				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "<p class=\"notice\" role=\"note\">")
110				if templ_7745c5c3_Err != nil {
111					return templ_7745c5c3_Err
112				}
113				var templ_7745c5c3_Var7 string
114				templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(p.Notice)
115				if templ_7745c5c3_Err != nil {
116					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/blob.templ`, Line: 18, Col: 43}
117				}
118				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
119				if templ_7745c5c3_Err != nil {
120					return templ_7745c5c3_Err
121				}
122				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</p>")
123				if templ_7745c5c3_Err != nil {
124					return templ_7745c5c3_Err
125				}
126			}
127			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, " ")
128			if templ_7745c5c3_Err != nil {
129				return templ_7745c5c3_Err
130			}
131			if p.Image {
132				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "<p class=\"img-view\"><img src=\"")
133				if templ_7745c5c3_Err != nil {
134					return templ_7745c5c3_Err
135				}
136				var templ_7745c5c3_Var8 string
137				templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.RawHref)
138				if templ_7745c5c3_Err != nil {
139					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/blob.templ`, Line: 21, Col: 43}
140				}
141				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8)
142				if templ_7745c5c3_Err != nil {
143					return templ_7745c5c3_Err
144				}
145				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "\" alt=\"")
146				if templ_7745c5c3_Err != nil {
147					return templ_7745c5c3_Err
148				}
149				var templ_7745c5c3_Var9 string
150				templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Name)
151				if templ_7745c5c3_Err != nil {
152					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/blob.templ`, Line: 21, Col: 58}
153				}
154				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9)
155				if templ_7745c5c3_Err != nil {
156					return templ_7745c5c3_Err
157				}
158				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "\"></p>")
159				if templ_7745c5c3_Err != nil {
160					return templ_7745c5c3_Err
161				}
162			}
163			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, " ")
164			if templ_7745c5c3_Err != nil {
165				return templ_7745c5c3_Err
166			}
167			if p.Rendered != nil {
168				templ_7745c5c3_Err = ReadmeView(*p.Rendered).Render(ctx, templ_7745c5c3_Buffer)
169				if templ_7745c5c3_Err != nil {
170					return templ_7745c5c3_Err
171				}
172			}
173			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, " ")
174			if templ_7745c5c3_Err != nil {
175				return templ_7745c5c3_Err
176			}
177			if p.HasCode {
178				if p.Rendered != nil {
179					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "<details class=\"source\"><summary>source</summary>")
180					if templ_7745c5c3_Err != nil {
181						return templ_7745c5c3_Err
182					}
183					templ_7745c5c3_Err = CodeView(p.Code).Render(ctx, templ_7745c5c3_Buffer)
184					if templ_7745c5c3_Err != nil {
185						return templ_7745c5c3_Err
186					}
187					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "</details>")
188					if templ_7745c5c3_Err != nil {
189						return templ_7745c5c3_Err
190					}
191				} else {
192					templ_7745c5c3_Err = CodeView(p.Code).Render(ctx, templ_7745c5c3_Buffer)
193					if templ_7745c5c3_Err != nil {
194						return templ_7745c5c3_Err
195					}
196				}
197			}
198			return nil
199		})
200		templ_7745c5c3_Err = Shell(l, blobRail(p)).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
201		if templ_7745c5c3_Err != nil {
202			return templ_7745c5c3_Err
203		}
204		return nil
205	})
206}
207
208// CodeView is the highlighted lines with a link on each number. A click on a
209// number selects the line, shift-click extends the selection to a range; the
210// URL hash (#L10 or #L10-L24) is the state, so a page loaded with a hash is
211// painted the same way. body[data-sel] feeds the hint badge and the rail.
212func CodeView(h template.HTML) templ.Component {
213	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
214		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
215		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
216			return templ_7745c5c3_CtxErr
217		}
218		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
219		if !templ_7745c5c3_IsBuffer {
220			defer func() {
221				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
222				if templ_7745c5c3_Err == nil {
223					templ_7745c5c3_Err = templ_7745c5c3_BufErr
224				}
225			}()
226		}
227		ctx = templ.InitializeContext(ctx)
228		templ_7745c5c3_Var10 := templ.GetChildren(ctx)
229		if templ_7745c5c3_Var10 == nil {
230			templ_7745c5c3_Var10 = templ.NopComponent
231		}
232		ctx = templ.ClearChildren(ctx)
233		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<pre class=\"chroma code\" data-anchor=\"\" hx-on:click=\"let a = event.target.closest('a.ln'); if (!a) return; event.preventDefault();\n    let n = +a.textContent; if (!event.shiftKey || !data.anchor) data.anchor = n;\n    let lo = Math.min(+data.anchor, n), hi = Math.max(+data.anchor, n);\n    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;\n    q('.line in this').arr().forEach(l => { let k = +l.id.slice(1); l.classList.toggle('sel', k >= lo && k <= hi) });\n    document.body.dataset.sel = lo ? 'L' + lo + (hi > lo ? '-L' + hi + ' · ' + (hi - lo + 1) + ' lines' : '') : '';\n    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=\"\"><code hx-ignore>")
234		if templ_7745c5c3_Err != nil {
235			return templ_7745c5c3_Err
236		}
237		templ_7745c5c3_Err = templ.Raw(string(h)).Render(ctx, templ_7745c5c3_Buffer)
238		if templ_7745c5c3_Err != nil {
239			return templ_7745c5c3_Err
240		}
241		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</code></pre>")
242		if templ_7745c5c3_Err != nil {
243			return templ_7745c5c3_Err
244		}
245		return nil
246	})
247}
248
249func blobRail(p BlobPage) templ.Component {
250	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
251		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
252		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
253			return templ_7745c5c3_CtxErr
254		}
255		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
256		if !templ_7745c5c3_IsBuffer {
257			defer func() {
258				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
259				if templ_7745c5c3_Err == nil {
260					templ_7745c5c3_Err = templ_7745c5c3_BufErr
261				}
262			}()
263		}
264		ctx = templ.InitializeContext(ctx)
265		templ_7745c5c3_Var11 := templ.GetChildren(ctx)
266		if templ_7745c5c3_Var11 == nil {
267			templ_7745c5c3_Var11 = templ.NopComponent
268		}
269		ctx = templ.ClearChildren(ctx)
270		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<section aria-labelledby=\"r-file\"><h2 id=\"r-file\">File</h2>")
271		if templ_7745c5c3_Err != nil {
272			return templ_7745c5c3_Err
273		}
274		templ_7745c5c3_Err = Facts(p.Facts).Render(ctx, templ_7745c5c3_Buffer)
275		if templ_7745c5c3_Err != nil {
276			return templ_7745c5c3_Err
277		}
278		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "</section>")
279		if templ_7745c5c3_Err != nil {
280			return templ_7745c5c3_Err
281		}
282		if p.Last != nil {
283			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<section aria-labelledby=\"r-last\"><h2 id=\"r-last\">Last change <a href=\"")
284			if templ_7745c5c3_Err != nil {
285				return templ_7745c5c3_Err
286			}
287			var templ_7745c5c3_Var12 templ.SafeURL
288			templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.HistHref))
289			if templ_7745c5c3_Err != nil {
290				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/blob.templ`, Line: 67, Col: 66}
291			}
292			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
293			if templ_7745c5c3_Err != nil {
294				return templ_7745c5c3_Err
295			}
296			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "\">History</a></h2><p><a href=\"")
297			if templ_7745c5c3_Err != nil {
298				return templ_7745c5c3_Err
299			}
300			var templ_7745c5c3_Var13 templ.SafeURL
301			templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Last.CHref))
302			if templ_7745c5c3_Err != nil {
303				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/blob.templ`, Line: 68, Col: 43}
304			}
305			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
306			if templ_7745c5c3_Err != nil {
307				return templ_7745c5c3_Err
308			}
309			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "\">")
310			if templ_7745c5c3_Err != nil {
311				return templ_7745c5c3_Err
312			}
313			var templ_7745c5c3_Var14 string
314			templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(p.Last.Short)
315			if templ_7745c5c3_Err != nil {
316				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/blob.templ`, Line: 68, Col: 60}
317			}
318			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
319			if templ_7745c5c3_Err != nil {
320				return templ_7745c5c3_Err
321			}
322			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "</a> ")
323			if templ_7745c5c3_Err != nil {
324				return templ_7745c5c3_Err
325			}
326			var templ_7745c5c3_Var15 string
327			templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(p.Last.Subject)
328			if templ_7745c5c3_Err != nil {
329				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/blob.templ`, Line: 68, Col: 83}
330			}
331			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
332			if templ_7745c5c3_Err != nil {
333				return templ_7745c5c3_Err
334			}
335			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "</p><p class=\"dim\">")
336			if templ_7745c5c3_Err != nil {
337				return templ_7745c5c3_Err
338			}
339			var templ_7745c5c3_Var16 string
340			templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(p.Last.Author)
341			if templ_7745c5c3_Err != nil {
342				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/blob.templ`, Line: 70, Col: 19}
343			}
344			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
345			if templ_7745c5c3_Err != nil {
346				return templ_7745c5c3_Err
347			}
348			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, " · ")
349			if templ_7745c5c3_Err != nil {
350				return templ_7745c5c3_Err
351			}
352			if p.Last.WhenAt != "" {
353				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "<time datetime=\"")
354				if templ_7745c5c3_Err != nil {
355					return templ_7745c5c3_Err
356				}
357				var templ_7745c5c3_Var17 string
358				templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Last.WhenAt)
359				if templ_7745c5c3_Err != nil {
360					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/blob.templ`, Line: 72, Col: 35}
361				}
362				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var17)
363				if templ_7745c5c3_Err != nil {
364					return templ_7745c5c3_Err
365				}
366				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "\" title=\"")
367				if templ_7745c5c3_Err != nil {
368					return templ_7745c5c3_Err
369				}
370				var templ_7745c5c3_Var18 string
371				templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Last.WhenAt)
372				if templ_7745c5c3_Err != nil {
373					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/blob.templ`, Line: 72, Col: 59}
374				}
375				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var18)
376				if templ_7745c5c3_Err != nil {
377					return templ_7745c5c3_Err
378				}
379				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "\">")
380				if templ_7745c5c3_Err != nil {
381					return templ_7745c5c3_Err
382				}
383				var templ_7745c5c3_Var19 string
384				templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(p.Last.When)
385				if templ_7745c5c3_Err != nil {
386					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/blob.templ`, Line: 72, Col: 75}
387				}
388				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
389				if templ_7745c5c3_Err != nil {
390					return templ_7745c5c3_Err
391				}
392				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "</time>")
393				if templ_7745c5c3_Err != nil {
394					return templ_7745c5c3_Err
395				}
396			}
397			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "</p></section>")
398			if templ_7745c5c3_Err != nil {
399				return templ_7745c5c3_Err
400			}
401		}
402		if len(p.Outline) > 0 {
403			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "<section aria-labelledby=\"r-outline\"><h2 id=\"r-outline\">On this page</h2>")
404			if templ_7745c5c3_Err != nil {
405				return templ_7745c5c3_Err
406			}
407			templ_7745c5c3_Err = Outline(p.Outline).Render(ctx, templ_7745c5c3_Buffer)
408			if templ_7745c5c3_Err != nil {
409				return templ_7745c5c3_Err
410			}
411			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "</section>")
412			if templ_7745c5c3_Err != nil {
413				return templ_7745c5c3_Err
414			}
415		}
416		if p.HasCode {
417			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "<section aria-labelledby=\"r-sel\"><h2 id=\"r-sel\">Selection</h2><p :text=\"document.body.dataset.sel || 'none · click a line number, shift-click extends'\">none · click a line number, shift-click extends</p><p class=\"dim\">y copies a permalink pinned to the commit sha</p></section>")
418			if templ_7745c5c3_Err != nil {
419				return templ_7745c5c3_Err
420			}
421		}
422		return nil
423	})
424}
425
426var _ = templruntime.GeneratedTemplate

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