colophon: English marked node by node, default notes checked against what uses the crate
Claude Fable 5.1's re-review of #27 (6fb210c):
- lang="en" sat on the entries list and each licence section, so it
wrapped the caller's labels too ("Licencia" announced as English). It
is now on each English node only: the name, blurb, author and licence
name, and each licence's heading and text. Tested with a Spanish
caller: no label inside a lang="en" element, every English node in one.
- A "*" note now says, in via, which dependents it names ("serde_json uses
it." is via serde-json). CollectCargo records each crate's direct
dependents (Package.Via), and Build refuses a default note for an app
that does not reach the crate through any of them, so an adopter that
ships memchr without serde_json is told, not given a false sentence.
Validate requires via on any crate with a default note.
- Catalog: Lucide's Apple note is gone (the apps draw no Lucide icon);
rustup, npm (Artistic-2.0) and Chromium join the tools.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 files changed,
+361
−46
colophon/colophon.go+50 −0colophon/colophon_test.go+118 −18colophon/inventory.go+23 −0colophon/inventory_test.go+29 −0colophon/projects.json+129 −17colophon/templates/colophon.html+12 −11
CI passed — run details
diff --git a/colophon/colophon.go b/colophon/colophon.go| index 5b1278b..2f47b33 100644 |
| --- a/colophon/colophon.go |
| +++ b/colophon/colophon.go |
| @@ -115,6 +115,11 @@ type Project struct { |
| // dependency is written once, not once per app. Only an app's own |
| // note can be stale. |
| Uses map[string]string `json:"uses"` |
| + // Via is the projects (catalog ids) a "*" note names as what uses this |
| + // one ("serde_json uses it." is via serde-json). A crate's default note |
| + // is true in an app only if the crate is reached there through one of |
| + // them, so Build checks it against the dependents CollectCargo records. |
| + Via []string `json:"via,omitempty"` |
| } |
| var projects = func() []Project { |
| @@ -235,12 +240,26 @@ func Validate(projects []Project) error { |
| } |
| owner[r] = p.ID |
| } |
| + cargo := false |
| + for _, r := range p.Packages { |
| + cargo = cargo || r.Ecosystem == Cargo |
| + } |
| + if p.Uses["*"] != "" && cargo && len(p.Via) == 0 { |
| + bad("a crate's default note must say, in via, which dependents it names") |
| + } |
| for app, use := range p.Uses { |
| if !sentence(use) || sentences(use) > 2 { |
| bad("the usage note for %s must be one or two sentences", app) |
| } |
| } |
| } |
| + for _, p := range projects { |
| + for _, v := range p.Via { |
| + if !ids[v] { |
| + problems = append(problems, p.ID+": via names "+v+", which is not in the catalog") |
| + } |
| + } |
| + } |
| if len(problems) > 0 { |
| sort.Strings(problems) |
| return errors.New("colophon: catalog:\n " + strings.Join(problems, "\n ")) |
| @@ -259,6 +278,9 @@ type Package struct { |
| // Platforms limits a package to some of the app's platforms ("mac"); |
| // empty is all of them. |
| Platforms []string `json:"platforms,omitempty"` |
| + // Via is the packages (by name, same ecosystem) that use this one |
| + // directly in the build that ships it, as CollectCargo records them. |
| + Via []string `json:"via,omitempty"` |
| // Notices are the package's own licence files, unaltered. |
| Notices []credits.Notice `json:"notices"` |
| } |
| @@ -371,6 +393,7 @@ func build(projects []Project, app string, shipped []Package) (Colophon, error) |
| key := p.Ecosystem + ":" + p.Name + "@" + p.Version |
| if have, ok := merged[key]; ok { |
| have.Tool = have.Tool && p.Tool |
| + have.Via = union(have.Via, p.Via) |
| if len(have.Platforms) == 0 || len(p.Platforms) == 0 { |
| have.Platforms = nil |
| } else { |
| @@ -414,6 +437,10 @@ func build(projects []Project, app string, shipped []Package) (Colophon, error) |
| case !ships: |
| continue |
| } |
| + if own == "" && len(p.Via) > 0 && !reachedVia(p, packages, projects, owner, byProject) { |
| + problems = append(problems, p.ID+"'s default note names "+strings.Join(p.Via, ", ")+", which "+app+" does not reach it through") |
| + continue |
| + } |
| section, err := sectionFor(p, packages) |
| if err != nil { |
| problems = append(problems, err.Error()) |
| @@ -439,6 +466,29 @@ func build(projects []Project, app string, shipped []Package) (Colophon, error) |
| return c, nil |
| } |
| +// reachedVia reports whether one of packages is used directly by a |
| +// shipped package of one of the projects p's default note names. |
| +func reachedVia(p Project, packages []Package, projects []Project, owner map[Ref]int, byProject map[int][]Package) bool { |
| + named := map[string]bool{} |
| + for _, v := range p.Via { |
| + named[v] = true |
| + } |
| + for _, pkg := range packages { |
| + for _, user := range pkg.Via { |
| + i, ok := owner[Ref{pkg.Ecosystem, user}] |
| + if !ok || !named[projects[i].ID] { |
| + continue |
| + } |
| + for _, shipped := range byProject[i] { |
| + if shipped.Name == user { |
| + return true |
| + } |
| + } |
| + } |
| + } |
| + return false |
| +} |
| + |
| func union(a, b []string) []string { |
| seen := map[string]bool{} |
| var out []string |
diff --git a/colophon/colophon_test.go b/colophon/colophon_test.go| index 4f2153f..829b1b4 100644 |
| --- a/colophon/colophon_test.go |
| +++ b/colophon/colophon_test.go |
| @@ -203,8 +203,8 @@ func TestPageNamesEachProjectAndLinksItsLicenceHomeAndSource(t *testing.T) { |
| "<h1>Colophon</h1>", "<p>What Docs is made with.</p>", |
| `<h2 id="colophon-typefaces">Typefaces</h2>`, `<h2 id="colophon-go">Go libraries</h2>`, |
| `<h2 id="colophon-javascript">JavaScript libraries</h2>`, `<h2 id="colophon-tools">Tools</h2>`, |
| - `<h3><bdi>ProseMirror</bdi></h3>`, "An editor toolkit. Draws the editor.", |
| - "<dt>By</dt>", "<dd>Marijn Haverbeke</dd>", |
| + `<h3 lang="en"><bdi>ProseMirror</bdi></h3>`, "An editor toolkit. Draws the editor.", |
| + "<dt>By</dt>", `<dd lang="en">Marijn Haverbeke</dd>`, |
| `<a href="/help/colophon/prosemirror">MIT License</a>`, |
| `<a href="https://prosemirror.net" rel="noreferrer" referrerpolicy="no-referrer">Home page</a>`, |
| `<a href="https://github.com/ProseMirror" rel="noreferrer" referrerpolicy="no-referrer">Source</a>`, |
| @@ -291,9 +291,9 @@ func TestLicencePageShowsEveryPackagesOriginalText(t *testing.T) { |
| for _, want := range []string{ |
| "<h1>ProseMirror: licence</h1>", |
| `<a href="/help/colophon#colophon-prosemirror">Back to the colophon</a>`, |
| - "<h2><bdi>prosemirror-model</bdi> 1.25.11</h2>", "<h2><bdi>prosemirror-view</bdi> 1.42.3</h2>", |
| + `<h2 lang="en"><bdi>prosemirror-model</bdi> 1.25.11</h2>`, `<h2 lang="en"><bdi>prosemirror-view</bdi> 1.42.3</h2>`, |
| // The parser drops a <pre>'s first newline, so the template adds one. |
| - "<pre>\n\nCopyright <Marijn>\nPermission & conditions</pre>", |
| + "<pre lang=\"en\">\n\nCopyright <Marijn>\nPermission & conditions</pre>", |
| } { |
| if !strings.Contains(html, want) { |
| t.Errorf("the licence page lost %q", want) |
| @@ -435,28 +435,97 @@ func TestCatalogIsInUSEnglish(t *testing.T) { |
| } |
| } |
| -// The entries, blurbs, authors and licence texts are English on a page in |
| -// the request's locale; they say so (WCAG 3.1.2). The caller's labels do not. |
| -func TestTheCatalogsEnglishIsMarkedAsEnglish(t *testing.T) { |
| +// The catalog's words and the licence texts are English on a page in the |
| +// caller's locale, and say so (WCAG 3.1.2); the caller's labels around them |
| +// keep the page's language. Checked with a Spanish caller: no label is |
| +// inside a lang="en" element, and every English node is. |
| +func TestOnlyTheCatalogsEnglishIsMarkedAsEnglish(t *testing.T) { |
| c, err := build(testCatalog(), "docs", shippedSet()) |
| if err != nil { |
| t.Fatal(err) |
| } |
| - html := page(t, c, English) |
| - if strings.Count(html, `<ul role="list" estilo-colophon-entries lang="en">`) != len(c.Sections) { |
| - t.Error("an entries list is not marked lang=\"en\"") |
| + es := English |
| + es.Contents, es.By, es.Licence, es.Version = "En esta página", "Autoría", "Licencia", "Versión" |
| + es.Home, es.Source, es.HomeAndSource = "Página principal", "Código fuente", "Página principal y código fuente" |
| + es.Back, es.Missing, es.NotIncluded = "Volver al colofón", "Este paquete no trae archivo de licencia.", "Es una herramienta; su licencia no se copia aquí." |
| + es.Sections = map[string]string{} |
| + for k, v := range English.Sections { |
| + es.Sections[k] = "ES " + v |
| + } |
| + labels := []string{es.By, es.Licence, es.Version, es.Home, es.Source, es.HomeAndSource, es.Back, es.Missing, es.NotIncluded, es.Contents} |
| + html := page(t, c, es) |
| + english := englishText(t, html) |
| + for _, l := range labels { |
| + if strings.Contains(english, template.HTMLEscapeString(l)) { |
| + t.Errorf("the label %q is inside a lang=\"en\" element", l) |
| + } |
| } |
| - if strings.Contains(html, `<article estilo-colophon lang=`) { |
| - t.Error("the whole page is marked English; the caller's labels are in its locale") |
| + for _, s := range c.Sections { |
| + for _, e := range s.Entries { |
| + for _, want := range []string{e.Name, template.HTMLEscapeString(e.Blurb), template.HTMLEscapeString(e.Author), template.HTMLEscapeString(e.Licence.Name)} { |
| + if !strings.Contains(english, want) { |
| + t.Errorf("%s: %q is not marked English", e.ID, want) |
| + } |
| + } |
| + } |
| } |
| - pm, _ := c.Entry("prosemirror") |
| - var out bytes.Buffer |
| - if err := parse(t).ExecuteTemplate(&out, "estilo/colophon-licence", LicencePage{Title: "t", Back: "/b", Labels: English, Entry: pm}); err != nil { |
| - t.Fatal(err) |
| + for _, id := range []string{"prosemirror", "esbuild", "signin"} { |
| + e, _ := c.Entry(id) |
| + var out bytes.Buffer |
| + if err := parse(t).ExecuteTemplate(&out, "estilo/colophon-licence", LicencePage{Title: "t", Back: "/b", Labels: es, Entry: e}); err != nil { |
| + t.Fatal(err) |
| + } |
| + english := englishText(t, out.String()) |
| + for _, l := range labels { |
| + if strings.Contains(english, template.HTMLEscapeString(l)) { |
| + t.Errorf("%s licence page: the label %q is inside a lang=\"en\" element", id, l) |
| + } |
| + } |
| + for _, p := range e.Packages { |
| + for _, n := range p.Notices { |
| + if !strings.Contains(english, template.HTMLEscapeString(n.Text)) || !strings.Contains(english, n.Name) { |
| + t.Errorf("%s: %s's %s is not marked English", id, p.Name, n.Name) |
| + } |
| + } |
| + } |
| } |
| - if strings.Count(out.String(), `<section estilo-colophon-licence lang="en">`) != len(pm.Packages) { |
| - t.Error("a licence section is not marked lang=\"en\"") |
| +} |
| + |
| +var tagPattern = regexp.MustCompile(`<(/?)([a-z][a-z0-9]*)([^>]*)>`) |
| + |
| +// englishText is the text of html that sits inside an element marked |
| +// lang="en", joined: a small tag walker, enough for these templates (they |
| +// close every element they open). |
| +func englishText(t *testing.T, html string) string { |
| + t.Helper() |
| + var stack []bool |
| + var out strings.Builder |
| + last := 0 |
| + inEnglish := func() bool { |
| + for _, en := range stack { |
| + if en { |
| + return true |
| + } |
| + } |
| + return false |
| + } |
| + for _, m := range tagPattern.FindAllStringSubmatchIndex(html, -1) { |
| + if inEnglish() { |
| + out.WriteString(html[last:m[0]]) |
| + out.WriteString("\n") |
| + } |
| + last = m[1] |
| + closing, attrs := html[m[2]:m[3]] == "/", html[m[6]:m[7]] |
| + if closing { |
| + if len(stack) == 0 { |
| + t.Fatalf("unbalanced </%s>", html[m[4]:m[5]]) |
| + } |
| + stack = stack[:len(stack)-1] |
| + continue |
| + } |
| + stack = append(stack, strings.Contains(attrs, `lang="en"`)) |
| } |
| + return out.String() |
| } |
| // At 320px a label beside a long value must not be squeezed: flex shrinks |
| @@ -467,3 +536,34 @@ func TestADefinitionLabelNeverShrinks(t *testing.T) { |
| t.Error("colophon.css lets a dt shrink") |
| } |
| } |
| + |
| +// A default note ("*") names the dependents it speaks of (Via); an app |
| +// whose package is not reached through any of them, in what it ships, has |
| +// no true note, and Build says so. |
| +func TestADefaultNoteMustNameADependentThatShips(t *testing.T) { |
| + cat := testCatalog() |
| + itoa := Project{ID: "itoa", Name: "itoa", Kind: Library, Blurb: "Writes integers as text.", Author: "David Tolnay", Licence: Licence{"MIT", "MIT License"}, Home: "https://crates.io/crates/itoa", Source: "https://github.com/dtolnay/itoa", Packages: []Ref{{Cargo, "itoa"}}, Uses: map[string]string{"*": "serde_json uses it."}, Via: []string{"serde-json"}} |
| + sj := Project{ID: "serde-json", Name: "serde_json", Kind: Library, Blurb: "JSON for Serde.", Author: "Erick Tryzelaar and David Tolnay", Licence: Licence{"MIT", "MIT License"}, Home: "https://crates.io/crates/serde_json", Source: "https://github.com/serde-rs/json", Packages: []Ref{{Cargo, "serde_json"}}, Uses: map[string]string{"docs": "Yrs uses it."}} |
| + cat = append(cat, itoa, sj) |
| + if err := Validate(cat); err != nil { |
| + t.Fatal(err) |
| + } |
| + withSJ := append(shippedSet(), |
| + Package{Ecosystem: Cargo, Name: "serde_json", Version: "1.0.151", Notices: notice("sj")}, |
| + Package{Ecosystem: Cargo, Name: "itoa", Version: "1.0.18", Via: []string{"serde_json"}, Notices: notice("itoa")}) |
| + if _, err := build(cat, "docs", withSJ); err != nil { |
| + t.Fatalf("itoa via a shipped serde_json was refused: %v", err) |
| + } |
| + // Reached only through something else: the note would be false. |
| + other := append(shippedSet(), |
| + Package{Ecosystem: Cargo, Name: "itoa", Version: "1.0.18", Via: []string{"ryu"}, Notices: notice("itoa")}) |
| + _, err := build(cat, "docs", other) |
| + if err == nil || !strings.Contains(err.Error(), "itoa's default note names serde-json, which docs does not reach it through") { |
| + t.Fatalf("err = %v", err) |
| + } |
| + // A cargo project with a default note must say whom it names. |
| + itoa.Via = nil |
| + if err := Validate([]Project{itoa}); err == nil || !strings.Contains(err.Error(), "via") { |
| + t.Fatalf("a default note naming no dependent was accepted: %v", err) |
| + } |
| +} |
diff --git a/colophon/inventory.go b/colophon/inventory.go| index 7a74fdd..65008a4 100644 |
| --- a/colophon/inventory.go |
| +++ b/colophon/inventory.go |
| @@ -222,6 +222,28 @@ func CollectCargo(metadata io.Reader) ([]Package, error) { |
| } |
| } |
| } |
| + // users: each crate's direct dependents in the walked graph, by name; |
| + // the root is the app itself, not a dependent to name. |
| + users := map[string][]string{} |
| + for id := range seen { |
| + if id == m.Resolve.Root { |
| + continue |
| + } |
| + var name string |
| + for _, p := range m.Packages { |
| + if p.ID == id { |
| + name = p.Name |
| + } |
| + } |
| + for _, d := range m.Resolve.Nodes[nodes[id]].Deps { |
| + for _, k := range d.DepKinds { |
| + if k.Kind == nil || *k.Kind != "dev" { |
| + users[d.Pkg] = union(users[d.Pkg], []string{name}) |
| + break |
| + } |
| + } |
| + } |
| + } |
| var out []Package |
| for id := range seen { |
| if id == m.Resolve.Root { |
| @@ -232,6 +254,7 @@ func CollectCargo(metadata io.Reader) ([]Package, error) { |
| return nil, err |
| } |
| p.Tool = !linked[id] |
| + p.Via = users[id] |
| out = append(out, p) |
| } |
| sort.Slice(out, func(i, j int) bool { |
diff --git a/colophon/inventory_test.go b/colophon/inventory_test.go| index 4c5acb9..8e82753 100644 |
| --- a/colophon/inventory_test.go |
| +++ b/colophon/inventory_test.go |
| @@ -192,3 +192,32 @@ func TestCollectCargoMarksMacroAndBuildOnlyCratesAsTools(t *testing.T) { |
| } |
| } |
| } |
| + |
| +// CollectCargo records each crate's direct dependents in the walked graph, |
| +// so a default usage note can be checked against what actually uses it. |
| +func TestCollectCargoRecordsWhatUsesEachCrate(t *testing.T) { |
| + root := t.TempDir() |
| + var pkgs []string |
| + for _, c := range []string{"yrs", "serde_json", "itoa", "smallvec"} { |
| + write(t, filepath.Join(root, c, "LICENSE"), c) |
| + pkgs = append(pkgs, `{"id":"`+c+`","name":"`+c+`","version":"1.0.0","manifest_path":"`+filepath.Join(root, c, "Cargo.toml")+`","targets":[{"kind":["lib"]}]}`) |
| + } |
| + pkgs = append(pkgs, `{"id":"app","name":"app","version":"0.1.0","manifest_path":"`+filepath.Join(root, "app", "Cargo.toml")+`","targets":[{"kind":["cdylib"]}]}`) |
| + meta := `{"packages":[` + strings.Join(pkgs, ",") + `],"resolve":{"root":"app","nodes":[ |
| + {"id":"app","deps":[{"pkg":"yrs","dep_kinds":[{"kind":null}]},{"pkg":"smallvec","dep_kinds":[{"kind":null}]}]}, |
| + {"id":"yrs","deps":[{"pkg":"serde_json","dep_kinds":[{"kind":null}]},{"pkg":"smallvec","dep_kinds":[{"kind":null}]}]}, |
| + {"id":"serde_json","deps":[{"pkg":"itoa","dep_kinds":[{"kind":null}]}]}, |
| + {"id":"itoa","deps":[]},{"id":"smallvec","deps":[]}]}}` |
| + got, err := CollectCargo(strings.NewReader(meta)) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + via := map[string]string{} |
| + for _, p := range got { |
| + via[p.Name] = strings.Join(p.Via, ",") |
| + } |
| + // The root is the app itself, not a dependent to name. |
| + if via["itoa"] != "serde_json" || via["serde_json"] != "yrs" || via["smallvec"] != "yrs" || via["yrs"] != "" { |
| + t.Fatalf("via = %v", via) |
| + } |
| +} |
diff --git a/colophon/projects.json b/colophon/projects.json| index e4996d0..875ea7b 100644 |
| --- a/colophon/projects.json |
| +++ b/colophon/projects.json |
| @@ -112,7 +112,10 @@ |
| ], |
| "uses": { |
| "*": "Yrs uses it while it is built." |
| - } |
| + }, |
| + "via": [ |
| + "yrs" |
| + ] |
| }, |
| { |
| "id": "autocfg", |
| @@ -342,6 +345,28 @@ |
| "docs": "Docs' browser tests drive Chrome with it." |
| } |
| }, |
| + { |
| + "id": "chromium", |
| + "name": "Chromium", |
| + "kind": "tool", |
| + "blurb": "The open-source browser Google Chrome is built from.", |
| + "author": "The Chromium Authors", |
| + "licence": { |
| + "spdx": "BSD-3-Clause", |
| + "name": "BSD 3-Clause License" |
| + }, |
| + "home": "https://www.chromium.org/", |
| + "source": "https://chromium.googlesource.com/chromium/src", |
| + "packages": [ |
| + { |
| + "ecosystem": "toolchain", |
| + "name": "chromium" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Docs' browser tests drive it, through chromedp and the browser drive script." |
| + } |
| + }, |
| { |
| "id": "crossbeam-utils", |
| "name": "crossbeam-utils", |
| @@ -362,7 +387,10 @@ |
| ], |
| "uses": { |
| "*": "DashMap uses it." |
| - } |
| + }, |
| + "via": [ |
| + "dashmap" |
| + ] |
| }, |
| { |
| "id": "dashmap", |
| @@ -496,7 +524,10 @@ |
| ], |
| "uses": { |
| "*": "async-lock uses it." |
| - } |
| + }, |
| + "via": [ |
| + "async-lock" |
| + ] |
| }, |
| { |
| "id": "event-listener-strategy", |
| @@ -518,7 +549,10 @@ |
| ], |
| "uses": { |
| "*": "async-lock uses it." |
| - } |
| + }, |
| + "via": [ |
| + "async-lock" |
| + ] |
| }, |
| { |
| "id": "fastrand", |
| @@ -856,7 +890,10 @@ |
| ], |
| "uses": { |
| "*": "serde_json uses it." |
| - } |
| + }, |
| + "via": [ |
| + "serde-json" |
| + ] |
| }, |
| { |
| "id": "jetbrains-mono", |
| @@ -1058,8 +1095,7 @@ |
| } |
| ], |
| "uses": { |
| - "docs": "The chrome's interface icons are Lucide's. The app icons are Oficina's own drawings.", |
| - "docs-native": "The apps carry Lucide's license; their icons are Oficina's own drawings and the system's symbols." |
| + "docs": "The chrome's interface icons are Lucide's. The app icons are Oficina's own drawings." |
| } |
| }, |
| { |
| @@ -1082,7 +1118,10 @@ |
| ], |
| "uses": { |
| "*": "serde_json uses it." |
| - } |
| + }, |
| + "via": [ |
| + "serde-json" |
| + ] |
| }, |
| { |
| "id": "modernc-libc", |
| @@ -1261,6 +1300,29 @@ |
| "docs": "GORM uses it." |
| } |
| }, |
| + { |
| + "id": "npm", |
| + "name": "npm", |
| + "kind": "tool", |
| + "blurb": "The package manager that ships with Node.js.", |
| + "author": "npm, Inc. and the npm contributors", |
| + "licence": { |
| + "spdx": "Artistic-2.0", |
| + "name": "Artistic License 2.0" |
| + }, |
| + "home": "https://www.npmjs.com/", |
| + "source": "https://github.com/npm/cli", |
| + "packages": [ |
| + { |
| + "ecosystem": "toolchain", |
| + "name": "npm" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "It installs the editor's locked JavaScript dependencies for the build and the tests.", |
| + "docs-native": "It installs the locked JavaScript the wire-compatibility checks run." |
| + } |
| + }, |
| { |
| "id": "num-derive", |
| "name": "num-derive", |
| @@ -1325,7 +1387,11 @@ |
| ], |
| "uses": { |
| "*": "DashMap and aHash use it." |
| - } |
| + }, |
| + "via": [ |
| + "dashmap", |
| + "ahash" |
| + ] |
| }, |
| { |
| "id": "onest", |
| @@ -1395,7 +1461,10 @@ |
| ], |
| "uses": { |
| "*": "DashMap uses it." |
| - } |
| + }, |
| + "via": [ |
| + "dashmap" |
| + ] |
| }, |
| { |
| "id": "paste", |
| @@ -1439,7 +1508,10 @@ |
| ], |
| "uses": { |
| "*": "async-lock uses it." |
| - } |
| + }, |
| + "via": [ |
| + "async-lock" |
| + ] |
| }, |
| { |
| "id": "playfair-display", |
| @@ -1734,6 +1806,28 @@ |
| "docs-native": "The apps' document core and the interpreter that runs it are written in Rust, with its standard library compiled in." |
| } |
| }, |
| + { |
| + "id": "rustup", |
| + "name": "rustup", |
| + "kind": "tool", |
| + "blurb": "The Rust toolchain installer, which picks the pinned Rust version and its WebAssembly target.", |
| + "author": "The Rust Project Developers", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://rust-lang.github.io/rustup/", |
| + "source": "https://github.com/rust-lang/rustup", |
| + "packages": [ |
| + { |
| + "ecosystem": "toolchain", |
| + "name": "rustup" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The gate checks the pinned Rust and its WebAssembly target are installed through it." |
| + } |
| + }, |
| { |
| "id": "rustversion", |
| "name": "rustversion", |
| @@ -1754,7 +1848,10 @@ |
| ], |
| "uses": { |
| "*": "arc-swap uses it while it is built." |
| - } |
| + }, |
| + "via": [ |
| + "arc-swap" |
| + ] |
| }, |
| { |
| "id": "scopeguard", |
| @@ -1776,7 +1873,10 @@ |
| ], |
| "uses": { |
| "*": "parking_lot uses it." |
| - } |
| + }, |
| + "via": [ |
| + "parking-lot" |
| + ] |
| }, |
| { |
| "id": "serde", |
| @@ -2059,7 +2159,10 @@ |
| ], |
| "uses": { |
| "*": "Yrs's errors are written with it." |
| - } |
| + }, |
| + "via": [ |
| + "yrs" |
| + ] |
| }, |
| { |
| "id": "uharfbuzz", |
| @@ -2126,7 +2229,10 @@ |
| ], |
| "uses": { |
| "*": "aHash uses it while it is built." |
| - } |
| + }, |
| + "via": [ |
| + "ahash" |
| + ] |
| }, |
| { |
| "id": "w3c-keyname", |
| @@ -2444,7 +2550,10 @@ |
| ], |
| "uses": { |
| "*": "aHash uses it." |
| - } |
| + }, |
| + "via": [ |
| + "ahash" |
| + ] |
| }, |
| { |
| "id": "zilla-slab", |
| @@ -2489,7 +2598,10 @@ |
| ], |
| "uses": { |
| "*": "serde_json uses it." |
| - } |
| + }, |
| + "via": [ |
| + "serde-json" |
| + ] |
| } |
| ] |
| } |
diff --git a/colophon/templates/colophon.html b/colophon/templates/colophon.html| index 8c008c2..127b054 100644 |
| --- a/colophon/templates/colophon.html |
| +++ b/colophon/templates/colophon.html |
| @@ -2,8 +2,9 @@ |
| contents are in-page links and each licence is its own page. Every |
| word not in the catalog is the caller's (Labels), in its locale; the |
| catalog's own words are English, like the licences they sit beside, |
| - and are marked lang="en" (WCAG 3.1.2): the entries and the licence |
| - texts, never the caller's labels around them. |
| + and are marked lang="en" (WCAG 3.1.2) node by node: each name, blurb, |
| + author and licence name, and each licence text, never an element that |
| + also holds the caller's labels. |
| Names are in <bdi> so a right-to-left page keeps them whole. */}} |
| {{define "estilo/colophon"}} |
| <article estilo-colophon> |
| @@ -17,14 +18,14 @@ |
| {{range .Colophon.Sections}} |
| <section aria-labelledby="colophon-{{.ID}}"> |
| <h2 id="colophon-{{.ID}}">{{index $.Labels.Sections .ID}}</h2> |
| - <ul role="list" estilo-colophon-entries lang="en"> |
| + <ul role="list" estilo-colophon-entries> |
| {{range .Entries}} |
| <li id="colophon-{{.ID}}" estilo-colophon-entry> |
| - <h3><bdi>{{.Name}}</bdi></h3> |
| - <p>{{.Blurb}} {{.Usage}}</p> |
| + <h3 lang="en"><bdi>{{.Name}}</bdi></h3> |
| + <p lang="en">{{.Blurb}} {{.Usage}}</p> |
| <dl> |
| - <div><dt>{{$.Labels.By}}</dt><dd>{{.Author}}</dd></div> |
| - <div><dt>{{$.Labels.Licence}}</dt><dd><a href="{{$.LicenceBase}}{{.ID}}">{{.Licence.Name}}</a></dd></div> |
| + <div><dt>{{$.Labels.By}}</dt><dd lang="en">{{.Author}}</dd></div> |
| + <div><dt>{{$.Labels.Licence}}</dt><dd lang="en"><a href="{{$.LicenceBase}}{{.ID}}">{{.Licence.Name}}</a></dd></div> |
| {{with .VersionText}}<div><dt>{{$.Labels.Version}}</dt><dd><bdi>{{.}}</bdi></dd></div>{{end}} |
| </dl> |
| <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> |
| @@ -45,10 +46,10 @@ |
| <h1>{{.Title}}</h1> |
| <p><a href="{{.Back}}">{{.Labels.Back}}</a></p> |
| {{range .Entry.Packages}} |
| - <section estilo-colophon-licence lang="en"> |
| - <h2><bdi>{{.Name}}</bdi>{{with .Version}} {{.}}{{end}}</h2> |
| - {{range .Notices}}<h3><bdi>{{.Name}}</bdi></h3> |
| - <pre> |
| + <section estilo-colophon-licence> |
| + <h2 lang="en"><bdi>{{.Name}}</bdi>{{with .Version}} {{.}}{{end}}</h2> |
| + {{range .Notices}}<h3 lang="en"><bdi>{{.Name}}</bdi></h3> |
| + <pre lang="en"> |
| {{.Text}}</pre> |
| {{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}} |
| </section> |