oficina / estilo Public

Clone
git clone https://amadan.net/oficina/estilo

Plain git — no account needed to clone.

Download

Download this file

1{{/* estilo/colophon — an app's Colophon (colophon.Page). No script: the
2 contents are in-page links and each licence is its own page. Every
3 word not in the catalog is the caller's (Labels), in its locale; the
4 catalog's own words are English, like the licences they sit beside,
5 and are marked lang="en" (WCAG 3.1.2) node by node: each name, blurb,
6 author and licence name, and each licence text, never an element that
7 also holds the caller's labels.
8 Names are in <bdi> so a right-to-left page keeps them whole. */}}
9{{define "estilo/colophon"}}
10<article estilo-colophon>
11 <h1>{{.Title}}</h1>
12 {{range .Intro}}<p>{{.}}</p>{{end}}
13 <nav aria-label="{{.Labels.Contents}}" estilo-colophon-contents>
14 <ul role="list">
15 {{range .Colophon.Sections}}<li><a href="#colophon-{{.ID}}">{{index $.Labels.Sections .ID}}</a> <span estilo-colophon-count>({{len .Entries}})</span></li>
16 {{end}}</ul>
17 </nav>
18 {{range .Colophon.Sections}}
19 <section aria-labelledby="colophon-{{.ID}}">
20 <h2 id="colophon-{{.ID}}">{{index $.Labels.Sections .ID}}</h2>
21 <ul role="list" estilo-colophon-entries>
22 {{range .Entries}}
23 <li id="colophon-{{.ID}}" estilo-colophon-entry>
24 <h3 lang="en"><bdi>{{.Name}}</bdi></h3>
25 <p lang="en">{{.Blurb}} {{.Usage}}</p>
26 <dl>
27 <div><dt>{{$.Labels.By}}</dt><dd lang="en">{{.Author}}</dd></div>
28 <div><dt>{{$.Labels.Licence}}</dt><dd lang="en"><a href="{{$.LicenceBase}}{{.ID}}">{{.Licence.Name}}</a></dd></div>
29 {{with .VersionText}}<div><dt>{{$.Labels.Version}}</dt><dd><bdi>{{.}}</bdi></dd></div>{{end}}
30 </dl>
31 <p estilo-colophon-links>{{if eq .Home .Source}}<a href="{{.Home}}" rel="noreferrer" referrerpolicy="no-referrer">{{$.Labels.HomeAndSource}}</a>{{else}}<a href="{{.Home}}" rel="noreferrer" referrerpolicy="no-referrer">{{$.Labels.Home}}</a> <a href="{{.Source}}" rel="noreferrer" referrerpolicy="no-referrer">{{$.Labels.Source}}</a>{{end}}</p>
32 </li>
33 {{end}}
34 </ul>
35 </section>
36 {{end}}
37</article>
38{{end}}
39
40{{/* estilo/colophon-licence — one entry's licence texts
41 (colophon.LicencePage): every package's own files, unaltered. The
42 newline after <pre> is there because the HTML parser drops a <pre>'s
43 first newline, and a notice's own must survive. */}}
44{{define "estilo/colophon-licence"}}
45<article estilo-colophon>
46 <h1>{{.Title}}</h1>
47 <p><a href="{{.Back}}">{{.Labels.Back}}</a></p>
48 {{range .Entry.Packages}}
49 <section estilo-colophon-licence>
50 <h2 lang="en"><bdi>{{.Name}}</bdi>{{with .Version}} {{.}}{{end}}</h2>
51 {{range .Notices}}<h3 lang="en"><bdi>{{.Name}}</bdi></h3>
52 <pre lang="en">
53{{.Text}}</pre>
54 {{else}}{{if .Tool}}<p>{{$.Labels.NotIncluded}} <a href="{{$.Entry.Source}}" rel="noreferrer" referrerpolicy="no-referrer">{{$.Labels.Source}}</a></p>{{else}}<p>{{$.Labels.Missing}}</p>{{end}}{{end}}
55 </section>
56 {{end}}
57</article>
58{{end}}
59