@bendyline/gezel-cli 1.2.10 → 1.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/dist/app-author-command.js +1 -0
- package/dist/app-command.js +1 -0
- package/dist/bin/gezel-main.js +1199 -86
- package/dist/handboek-export.js +2756 -1435
- package/dist/knowledge-command.js +1 -0
- package/dist/tui/index.js +15 -1
- package/package.json +10 -10
package/dist/handboek-export.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
// src/handboek-export.ts
|
|
4
4
|
import { existsSync as existsSync2 } from "fs";
|
|
5
|
-
import { cp, mkdir as
|
|
6
|
-
import { join as
|
|
7
|
-
import { SCORECARD_DATA_ATTRS as
|
|
5
|
+
import { cp, mkdir as mkdir4, writeFile as writeFile4 } from "fs/promises";
|
|
6
|
+
import { join as join5, resolve as resolve2 } from "path";
|
|
7
|
+
import { SCORECARD_DATA_ATTRS as SCORECARD_DATA_ATTRS3 } from "@bendyline/gezel";
|
|
8
8
|
import { CatalogService } from "@bendyline/gezel-catalog";
|
|
9
9
|
import {
|
|
10
10
|
OG_CARD_HEIGHT,
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
bundledGildeDataDir,
|
|
13
13
|
createHandboekEngine,
|
|
14
14
|
findHandboekContent,
|
|
15
|
+
loadScorecardRoundNotes,
|
|
15
16
|
ogKicker,
|
|
16
17
|
readOgHeadlines,
|
|
17
18
|
resolveOgHeadline,
|
|
@@ -23,1473 +24,2772 @@ import { PLAYER_BUNDLE } from "@bendyline/squisq-react/standalone-source";
|
|
|
23
24
|
import { markdownToDoc } from "@bendyline/squisq/doc";
|
|
24
25
|
import { parseMarkdown } from "@bendyline/squisq/markdown";
|
|
25
26
|
|
|
26
|
-
// src/
|
|
27
|
+
// src/apps-site.ts
|
|
28
|
+
import { createHash as createHash2 } from "crypto";
|
|
29
|
+
import { mkdir as mkdir2, writeFile as writeFile2 } from "fs/promises";
|
|
30
|
+
import { join as join3 } from "path";
|
|
31
|
+
import {
|
|
32
|
+
catalogGroundFor,
|
|
33
|
+
plainRoleTitle
|
|
34
|
+
} from "@bendyline/gezel";
|
|
35
|
+
|
|
36
|
+
// src/page-demo-export.ts
|
|
27
37
|
import { createHash } from "crypto";
|
|
28
|
-
import {
|
|
29
|
-
import { mkdir,
|
|
30
|
-
import { dirname, join, relative
|
|
31
|
-
import {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
39
|
+
import { mkdir, writeFile } from "fs/promises";
|
|
40
|
+
import { dirname, join as join2, relative } from "path";
|
|
41
|
+
import { fileURLToPath } from "url";
|
|
42
|
+
import { injectPageDemo, pageDemoBootstrapSource } from "@bendyline/gezel";
|
|
43
|
+
|
|
44
|
+
// ../../scripts/project-page-typography.mjs
|
|
45
|
+
import { readFileSync } from "fs";
|
|
46
|
+
import { join } from "path";
|
|
47
|
+
function buildProjectPageTypography(uiRoot) {
|
|
48
|
+
const fonts = join(uiRoot, "src/assets/fonts");
|
|
49
|
+
const faces = readFileSync(join(fonts, "ui-fonts.css"), "utf8").replace(
|
|
50
|
+
/url\("\.\/([a-z0-9-]+\.woff2)"\)/g,
|
|
51
|
+
(_, name) => `url("data:font/woff2;base64,${readFileSync(join(fonts, name)).toString("base64")}")`
|
|
52
|
+
);
|
|
53
|
+
return [
|
|
54
|
+
faces,
|
|
55
|
+
readFileSync(join(fonts, "typography-tokens.css"), "utf8"),
|
|
56
|
+
readFileSync(join(fonts, "page-defaults.css"), "utf8")
|
|
57
|
+
].join("\n");
|
|
35
58
|
}
|
|
36
|
-
|
|
37
|
-
|
|
59
|
+
|
|
60
|
+
// src/page-demo-export.ts
|
|
61
|
+
function pageDemoAssets() {
|
|
62
|
+
const sourceMode = import.meta.url.endsWith(".ts");
|
|
63
|
+
const fonts = fileURLToPath(new URL("../../ui/src/assets/fonts/", import.meta.url));
|
|
64
|
+
const css = sourceMode ? buildProjectPageTypography(fileURLToPath(new URL("../../ui", import.meta.url))) : readFileSync2(new URL("./page-typography.css", import.meta.url), "utf8");
|
|
65
|
+
const versioned = (stem, extension, source) => ({
|
|
66
|
+
path: `${stem}-${createHash("sha256").update(source).digest("hex").slice(0, 16)}.${extension}`,
|
|
67
|
+
bytes: Buffer.from(source)
|
|
68
|
+
});
|
|
69
|
+
return [
|
|
70
|
+
versioned("bootstrap", "js", pageDemoBootstrapSource()),
|
|
71
|
+
versioned("typography", "css", css),
|
|
72
|
+
...["LICENSE-HankenGrotesk-OFL-1.1.txt", "LICENSE-PTSerif-OFL-1.1.txt"].map((path) => ({
|
|
73
|
+
path,
|
|
74
|
+
bytes: readFileSync2(sourceMode ? join2(fonts, path) : new URL(`./${path}`, import.meta.url))
|
|
75
|
+
}))
|
|
76
|
+
];
|
|
38
77
|
}
|
|
39
|
-
async function
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (!parsed || typeof parsed.cards !== "object") throw new Error("no `cards` object");
|
|
45
|
-
return { version: 1, cards: parsed.cards };
|
|
46
|
-
} catch {
|
|
47
|
-
return { version: 1, cards: {} };
|
|
48
|
-
}
|
|
78
|
+
async function writePageDemoAssets(directory) {
|
|
79
|
+
const assets = pageDemoAssets();
|
|
80
|
+
await mkdir(directory, { recursive: true });
|
|
81
|
+
for (const asset of assets) await writeFile(join2(directory, asset.path), asset.bytes);
|
|
82
|
+
return assets;
|
|
49
83
|
}
|
|
50
|
-
async function
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
else if (item.name.endsWith(".png")) {
|
|
57
|
-
out.push(
|
|
58
|
-
relative(dir, full).split(sep).join("/").replace(/\.png$/, "")
|
|
59
|
-
);
|
|
60
|
-
}
|
|
84
|
+
async function writePageDemo(directory, files, config, shared) {
|
|
85
|
+
const script = shared.assets.find((file) => file.path.endsWith(".js"));
|
|
86
|
+
const style = shared.assets.find((file) => file.path.endsWith(".css"));
|
|
87
|
+
for (const file of files) {
|
|
88
|
+
if (!file.path || file.path.split(/[\\/]/).some((part) => !part || part === "." || part === "..") || /[:\\]/.test(file.path)) {
|
|
89
|
+
throw new Error(`Unsafe demo asset path: ${file.path}`);
|
|
61
90
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
91
|
+
const target = join2(directory, file.path);
|
|
92
|
+
let bytes = file.bytes;
|
|
93
|
+
if (/\.html?$/i.test(file.path)) {
|
|
94
|
+
const url = (name) => relative(dirname(target), join2(shared.directory, name)).split(/[\\/]/).map((part) => part === ".." ? part : encodeURIComponent(part)).join("/");
|
|
95
|
+
bytes = Buffer.from(
|
|
96
|
+
injectPageDemo(bytes.toString("utf8"), config, {
|
|
97
|
+
scriptUrl: url(script.path),
|
|
98
|
+
styleUrl: url(style.path)
|
|
99
|
+
})
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
await mkdir(dirname(target), { recursive: true });
|
|
103
|
+
await writeFile(target, bytes);
|
|
104
|
+
}
|
|
65
105
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
106
|
+
|
|
107
|
+
// src/apps-site.ts
|
|
108
|
+
var CATEGORIES = [
|
|
109
|
+
["home", "Home & Family"],
|
|
110
|
+
["growth", "Personal Growth"],
|
|
111
|
+
["game", "Games"],
|
|
112
|
+
["events", "Events & Journeys"],
|
|
113
|
+
["business", "Business & Teams"],
|
|
114
|
+
["money", "Money & Small Business"],
|
|
115
|
+
["writing", "Writing"],
|
|
116
|
+
["creative", "Photos & Media"],
|
|
117
|
+
["communication", "Communication"],
|
|
118
|
+
["data", "Data"],
|
|
119
|
+
["code", "Code"],
|
|
120
|
+
["general", "General"],
|
|
121
|
+
["other", "More"]
|
|
122
|
+
];
|
|
123
|
+
var CATEGORY_LABEL = new Map(CATEGORIES);
|
|
124
|
+
async function writeAppsSite(catalog, site, opts) {
|
|
125
|
+
const list = async (kind) => (await catalog.list(kind)).map((s) => s.manifest);
|
|
126
|
+
const templates = new Map(
|
|
127
|
+
(await list("gezel-template")).map((t) => [t.id, t])
|
|
128
|
+
);
|
|
129
|
+
const books = new Map(
|
|
130
|
+
(await list("craftbook-template")).map((b) => [b.id, b])
|
|
131
|
+
);
|
|
132
|
+
const demos = new Map(site.demos.map((d) => [d.projectTypeId, d]));
|
|
133
|
+
const apps = [];
|
|
134
|
+
for (const manifest of await list("project-type")) {
|
|
135
|
+
const category = manifest.category ?? "other";
|
|
136
|
+
const logo = manifest.logo === "logo.webp" ? await catalog.readItemFile("project-type", manifest.id, "logo.webp") : null;
|
|
137
|
+
apps.push({
|
|
138
|
+
manifest,
|
|
139
|
+
category,
|
|
140
|
+
ground: catalogGroundFor({ kind: "project-type", category, tags: manifest.tags }),
|
|
141
|
+
logo,
|
|
142
|
+
demo: demos.get(manifest.id),
|
|
143
|
+
crew: (manifest.gezels ?? []).flatMap((g) => {
|
|
144
|
+
const t = templates.get(g.templateId);
|
|
145
|
+
return t ? [
|
|
146
|
+
{
|
|
147
|
+
templateId: t.id,
|
|
148
|
+
role: plainRoleTitle(t.role),
|
|
149
|
+
description: t.description,
|
|
150
|
+
lead: g.voorman
|
|
151
|
+
}
|
|
152
|
+
] : [];
|
|
153
|
+
}),
|
|
154
|
+
craftbooks: (manifest.craftbooks ?? []).flatMap((id) => {
|
|
155
|
+
const b = books.get(id);
|
|
156
|
+
return b ? [{ id, name: b.name, description: b.description, art: site.craftbookArt.has(id) }] : [];
|
|
157
|
+
})
|
|
158
|
+
});
|
|
76
159
|
}
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
160
|
+
const order = new Map(CATEGORIES.map(([id], i) => [id, i]));
|
|
161
|
+
apps.sort(
|
|
162
|
+
(a, b) => Number(!a.demo) - Number(!b.demo) || (order.get(a.category) ?? 99) - (order.get(b.category) ?? 99) || a.manifest.name.localeCompare(b.manifest.name)
|
|
163
|
+
);
|
|
164
|
+
await mkdir2(opts.out, { recursive: true });
|
|
165
|
+
const css = Buffer.from(APPS_CSS);
|
|
166
|
+
const cssHref = `/apps/apps.css?v=${createHash2("sha256").update(css).digest("hex").slice(0, 10)}`;
|
|
167
|
+
await writeFile2(join3(opts.out, "apps.css"), css);
|
|
168
|
+
const sharedDir = join3(opts.out, "_gezel-demo");
|
|
169
|
+
const shared = apps.some((a) => a.demo) ? await writePageDemoAssets(sharedDir) : [];
|
|
170
|
+
const page = { ...opts, cssHref };
|
|
171
|
+
await writeFile2(join3(opts.out, "index.html"), indexHtml(apps, page));
|
|
172
|
+
for (const app of apps) {
|
|
173
|
+
const dir = join3(opts.out, app.manifest.id);
|
|
174
|
+
await mkdir2(dir, { recursive: true });
|
|
175
|
+
if (app.logo) await writeFile2(join3(dir, "logo.webp"), app.logo);
|
|
176
|
+
if (app.demo) {
|
|
177
|
+
await writePageDemo(
|
|
178
|
+
join3(dir, "demo"),
|
|
179
|
+
app.demo.files,
|
|
180
|
+
{
|
|
181
|
+
imports: app.demo.imports,
|
|
182
|
+
...app.demo.companion ? { companion: app.demo.companion } : {}
|
|
183
|
+
},
|
|
184
|
+
{ directory: sharedDir, assets: shared }
|
|
185
|
+
);
|
|
97
186
|
}
|
|
98
|
-
|
|
99
|
-
opts.onProgress?.(done, plans.length);
|
|
187
|
+
await writeFile2(join3(dir, "index.html"), appHtml(app, apps, page));
|
|
100
188
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
189
|
+
return { apps: apps.length, demos: apps.filter((a) => a.demo).length };
|
|
190
|
+
}
|
|
191
|
+
function esc(s) {
|
|
192
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
193
|
+
}
|
|
194
|
+
function firstSentence(text) {
|
|
195
|
+
const match = /^.*?[.!?](?=\s|$)/.exec(text.trim());
|
|
196
|
+
return (match ? match[0] : text).trim();
|
|
197
|
+
}
|
|
198
|
+
function humanizeTool(name) {
|
|
199
|
+
const words = name.replace(/[_-]+/g, " ").trim();
|
|
200
|
+
return words.charAt(0).toUpperCase() + words.slice(1);
|
|
201
|
+
}
|
|
202
|
+
function demoSrc(demo) {
|
|
203
|
+
return `demo/${demo.entry.split("/").map(encodeURIComponent).join("/")}`;
|
|
204
|
+
}
|
|
205
|
+
function head(title, description, path, ctx) {
|
|
206
|
+
const url = ctx.siteOrigin ? `${ctx.siteOrigin}${path}` : "";
|
|
207
|
+
return `<!DOCTYPE html>
|
|
208
|
+
<html lang="en">
|
|
209
|
+
<head>
|
|
210
|
+
<meta charset="UTF-8">
|
|
211
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
212
|
+
<title>${esc(title)}</title>
|
|
213
|
+
<meta name="description" content="${esc(description)}">
|
|
214
|
+
${url ? `<link rel="canonical" href="${esc(url)}">` : ""}
|
|
215
|
+
<meta name="theme-color" content="#eae5d6" media="(prefers-color-scheme: light)">
|
|
216
|
+
<meta name="theme-color" content="#141517" media="(prefers-color-scheme: dark)">
|
|
217
|
+
<link rel="icon" href="/favicon.svg?v=outline" type="image/svg+xml">
|
|
218
|
+
<link rel="apple-touch-icon" href="/apple-touch-icon.png?v=workbench" sizes="180x180">
|
|
219
|
+
${url ? `<meta property="og:type" content="website">
|
|
220
|
+
<meta property="og:site_name" content="Gezel">
|
|
221
|
+
<meta property="og:url" content="${esc(url)}">
|
|
222
|
+
<meta property="og:title" content="${esc(title)}">
|
|
223
|
+
<meta property="og:description" content="${esc(description)}">
|
|
224
|
+
<meta property="og:image" content="${esc(`${ctx.siteOrigin}/og-image.png?v=2`)}">
|
|
225
|
+
<meta name="twitter:card" content="summary_large_image">` : ""}
|
|
226
|
+
<link rel="preload" href="/assets/fonts/hanken-grotesk-variable.woff2" as="font" type="font/woff2" crossorigin>
|
|
227
|
+
<link rel="preload" href="/assets/fonts/pt-serif-700.woff2" as="font" type="font/woff2" crossorigin>
|
|
228
|
+
<link rel="stylesheet" href="${esc(ctx.cssHref)}">
|
|
229
|
+
</head>`;
|
|
230
|
+
}
|
|
231
|
+
function masthead() {
|
|
232
|
+
return `<header class="masthead">
|
|
233
|
+
<a class="logotype" href="/" aria-label="Gezel home">gezel</a>
|
|
234
|
+
<nav class="masthead-nav" aria-label="Site">
|
|
235
|
+
<a href="/apps/" aria-current="page">Apps</a>
|
|
236
|
+
<a href="/docs/">Docs</a>
|
|
237
|
+
<a href="/docs/model-scorecard/">Model scorecard</a>
|
|
238
|
+
<a href="/platform/">For developers</a>
|
|
239
|
+
<a href="https://github.com/bendyline/gezel">GitHub</a>
|
|
240
|
+
</nav>
|
|
241
|
+
</header>`;
|
|
242
|
+
}
|
|
243
|
+
function footer(ctx) {
|
|
244
|
+
return `<footer>
|
|
245
|
+
<p>\xA9 2026 Bendyline \xB7 Free and open source under the MIT license</p>
|
|
246
|
+
<p><a href="https://github.com/bendyline/gezel">GitHub</a><span class="sep" aria-hidden="true">\xB7</span><a href="/platform/">For developers</a><span class="sep" aria-hidden="true">\xB7</span><a href="${esc(ctx.docsBase)}craftbooks-index/">Craftbooks</a><span class="sep" aria-hidden="true">\xB7</span><a href="https://github.com/bendyline/gilde">Contribute an app</a></p>
|
|
247
|
+
</footer>`;
|
|
248
|
+
}
|
|
249
|
+
function mark(app, size, href) {
|
|
250
|
+
return app.logo ? `<img class="mark" src="${esc(href)}" alt="" width="${size}" height="${size}" loading="lazy" decoding="async"${app.ground ? ` data-ground="${app.ground}"` : ""}>` : `<span class="mark mark-empty"${app.ground ? ` data-ground="${app.ground}"` : ""} aria-hidden="true">${esc(app.manifest.name.charAt(0))}</span>`;
|
|
251
|
+
}
|
|
252
|
+
function card(app, prefix = "") {
|
|
253
|
+
const id = app.manifest.id;
|
|
254
|
+
const lead = app.crew.find((c) => c.lead) ?? app.crew[0];
|
|
255
|
+
const facts = [
|
|
256
|
+
lead ? `Crew: ${lead.role}${app.crew.length > 1 ? ` + ${app.crew.length - 1}` : ""}` : "",
|
|
257
|
+
app.craftbooks.length ? `${app.craftbooks.length} craftbook${app.craftbooks.length === 1 ? "" : "s"}` : ""
|
|
258
|
+
].filter(Boolean);
|
|
259
|
+
return `<li class="app-card" data-category="${esc(app.category)}">
|
|
260
|
+
<a href="${esc(prefix + id)}/">
|
|
261
|
+
${mark(app, 160, `${prefix}${id}/logo.webp`)}
|
|
262
|
+
<span class="app-card-body">
|
|
263
|
+
<span class="app-card-kicker">${esc(CATEGORY_LABEL.get(app.category) ?? "More")}</span>
|
|
264
|
+
<strong>${esc(app.manifest.name)}</strong>
|
|
265
|
+
<span class="app-card-text">${esc(firstSentence(app.manifest.description))}</span>
|
|
266
|
+
<span class="app-card-facts">${app.demo ? '<span class="tag tag-try">Try it here</span>' : '<span class="tag">In the app</span>'}${facts.map((f) => `<span>${esc(f)}</span>`).join("")}</span>
|
|
267
|
+
</span>
|
|
268
|
+
</a>
|
|
269
|
+
</li>`;
|
|
270
|
+
}
|
|
271
|
+
function indexHtml(apps, ctx) {
|
|
272
|
+
const present = CATEGORIES.filter(([id]) => apps.some((a) => a.category === id));
|
|
273
|
+
const demos = apps.filter((a) => a.demo).length;
|
|
274
|
+
const description = `${apps.length} Gezel apps: an interface paired with AI crew members, the plans they follow, and the actions they take. Try ${demos} of them in your browser.`;
|
|
275
|
+
return `${head("Gezel apps \u2014 a page you use, and a crew that works it", description, "/apps/", ctx)}
|
|
276
|
+
<body>
|
|
277
|
+
<div class="wrap">
|
|
278
|
+
${masthead()}
|
|
279
|
+
<main>
|
|
280
|
+
<section class="hero">
|
|
281
|
+
<h1><span class="title">Gezel apps</span><span class="tagline">A page you use, and a crew that works it.</span></h1>
|
|
282
|
+
<p class="lede">Each app pairs an interface with AI crew members who know the job, the step-by-step plans they follow, and actions that change the app\u2019s own files. Try ${demos} of them right here on sample data, with a scripted conversation. In Gezel they run on your computer, on your files, with the model you choose.</p>
|
|
283
|
+
</section>
|
|
284
|
+
<div class="filter">
|
|
285
|
+
<div class="tray" role="radiogroup" aria-label="Show apps for">
|
|
286
|
+
<button type="button" role="radio" class="key" aria-checked="true" data-filter="all">All</button>
|
|
287
|
+
${present.map(([id, label]) => `<button type="button" role="radio" class="key" aria-checked="false" tabindex="-1" data-filter="${esc(id)}">${esc(label)}</button>`).join("\n")}
|
|
288
|
+
</div>
|
|
289
|
+
<p class="filter-count" role="status" aria-live="polite">${apps.length} apps</p>
|
|
290
|
+
</div>
|
|
291
|
+
<ul class="app-grid">
|
|
292
|
+
${apps.map((a) => card(a)).join("\n")}
|
|
293
|
+
</ul>
|
|
294
|
+
<section class="band">
|
|
295
|
+
<h2>Make your own</h2>
|
|
296
|
+
<p>An app is plain files: an HTML page, the crew it hires, the craftbooks they follow, and small scripts for its actions. Build one for yourself, or contribute it to the catalog everyone installs from.</p>
|
|
297
|
+
<p class="band-links"><a href="${esc(ctx.docsBase)}building-ai-apps-inside-gezel/">Building AI apps inside Gezel</a><a href="${esc(ctx.docsBase)}gezel-page-apis/">The page APIs</a><a href="https://github.com/bendyline/gilde">The gilde catalog on GitHub</a></p>
|
|
298
|
+
</section>
|
|
299
|
+
</main>
|
|
300
|
+
${footer(ctx)}
|
|
301
|
+
</div>
|
|
302
|
+
<script>
|
|
303
|
+
(function () {
|
|
304
|
+
var keys = Array.prototype.slice.call(document.querySelectorAll('.tray .key'));
|
|
305
|
+
var cards = Array.prototype.slice.call(document.querySelectorAll('.app-card'));
|
|
306
|
+
var status = document.querySelector('.filter-count');
|
|
307
|
+
function pick(key, focus) {
|
|
308
|
+
var filter = key.getAttribute('data-filter'), shown = 0;
|
|
309
|
+
keys.forEach(function (k) { var on = k === key; k.setAttribute('aria-checked', String(on)); k.tabIndex = on ? 0 : -1; });
|
|
310
|
+
cards.forEach(function (c) { var show = filter === 'all' || c.getAttribute('data-category') === filter; c.hidden = !show; if (show) shown++; });
|
|
311
|
+
status.textContent = shown + (shown === 1 ? ' app' : ' apps');
|
|
312
|
+
if (focus) key.focus();
|
|
313
|
+
}
|
|
314
|
+
keys.forEach(function (key, i) {
|
|
315
|
+
key.addEventListener('click', function () { pick(key, false); });
|
|
316
|
+
key.addEventListener('keydown', function (e) {
|
|
317
|
+
var next = e.key === 'ArrowRight' || e.key === 'ArrowDown' ? i + 1 : e.key === 'ArrowLeft' || e.key === 'ArrowUp' ? i - 1 : e.key === 'Home' ? 0 : e.key === 'End' ? keys.length - 1 : null;
|
|
318
|
+
if (next === null) return;
|
|
319
|
+
e.preventDefault();
|
|
320
|
+
pick(keys[(next + keys.length) % keys.length], true);
|
|
321
|
+
});
|
|
322
|
+
});
|
|
323
|
+
})();
|
|
324
|
+
</script>
|
|
325
|
+
</body>
|
|
326
|
+
</html>
|
|
327
|
+
`;
|
|
328
|
+
}
|
|
329
|
+
function paramQuestions(manifest) {
|
|
330
|
+
const props = manifest.params?.properties;
|
|
331
|
+
if (!props) return [];
|
|
332
|
+
return Object.values(props).map((p) => typeof p.title === "string" ? p.title.trim() : "").filter(Boolean).slice(0, 3);
|
|
333
|
+
}
|
|
334
|
+
function appHtml(app, apps, ctx) {
|
|
335
|
+
const m = app.manifest;
|
|
336
|
+
const docs = ctx.docsBase;
|
|
337
|
+
const label = CATEGORY_LABEL.get(app.category) ?? "More";
|
|
338
|
+
const lead = app.crew.find((c) => c.lead) ?? app.crew[0];
|
|
339
|
+
const pageTools = new Set(m.pages?.tools ?? []);
|
|
340
|
+
const actions = (m.tools ?? []).filter((t) => !pageTools.has(t.name));
|
|
341
|
+
const files = [...m.workspaceSeed ?? [], ...m.artifactsSeed ?? []].filter(
|
|
342
|
+
(f) => !/\.md$/i.test(f) || !/^(about|mission)\.md$/i.test(f)
|
|
343
|
+
);
|
|
344
|
+
const questions = paramQuestions(m);
|
|
345
|
+
const schedules = (m.schedules ?? []).flatMap((s) => {
|
|
346
|
+
const book = app.craftbooks.find((b) => b.id === s.craftbook);
|
|
347
|
+
return book ? [{ name: book.name, night: s.runMode === "night-shift" }] : [];
|
|
348
|
+
});
|
|
349
|
+
const more = apps.filter((a) => a !== app && a.demo).sort((a, b) => Number(b.category === app.category) - Number(a.category === app.category)).slice(0, 3);
|
|
350
|
+
const demo = app.demo ? `<section class="demo" aria-labelledby="try">
|
|
351
|
+
<div class="demo-head"><h2 id="try">Try it</h2><a class="text-link" href="${esc(demoSrc(app.demo))}" target="_blank" rel="noreferrer">Open in a full window<span aria-hidden="true"> \u2197</span></a></div>
|
|
352
|
+
<p class="demo-note">${esc(m.name)} running in your browser on sample data. Use the page, or talk with ${lead ? `the ${esc(lead.role.toLowerCase())}` : "your companion"} beside it: the conversation is scripted for this preview, and the changes stay in the page.</p>
|
|
353
|
+
<div class="demo-frame"><iframe src="${esc(demoSrc(app.demo))}" title="${esc(m.name)}, running on sample data" sandbox="allow-scripts allow-forms allow-modals" referrerpolicy="no-referrer"></iframe></div>
|
|
354
|
+
</section>` : `<section class="demo demo-native" aria-labelledby="try">
|
|
355
|
+
<h2 id="try">Runs in the Gezel app</h2>
|
|
356
|
+
<p>${esc(m.name)} uses Gezel\u2019s own conversation and project views rather than a page of its own, so there is no browser preview. Install Gezel to try it.</p>
|
|
357
|
+
</section>`;
|
|
358
|
+
const crew = app.crew.length ? `<section class="inside-card"><h3>The crew</h3><ul class="plain">${app.crew.map(
|
|
359
|
+
(c) => `<li><a href="${esc(docs)}role-template/${esc(c.templateId)}/"><strong>${esc(c.role)}</strong></a>${c.lead ? ' <span class="tag">Crew lead</span>' : ""}<span>${esc(firstSentence(c.description))}</span></li>`
|
|
360
|
+
).join("")}</ul></section>` : "";
|
|
361
|
+
const plans = app.craftbooks.length ? `<section class="inside-card"><h3>Plans it follows</h3><ul class="plain">${app.craftbooks.map(
|
|
362
|
+
(b) => `<li><a href="${esc(docs)}craftbook/${esc(b.id)}/"><strong>${esc(b.name)}</strong></a><span>${esc(firstSentence(b.description))}</span></li>`
|
|
363
|
+
).join("")}</ul>${schedules.length ? `<p class="small">${schedules.map(
|
|
364
|
+
(s) => s.night ? `Runs ${esc(s.name)} overnight, once you agree.` : `Runs ${esc(s.name)} on a schedule, once you agree.`
|
|
365
|
+
).join(" ")}</p>` : ""}</section>` : "";
|
|
366
|
+
const shown = actions.slice(0, 8);
|
|
367
|
+
const tools = actions.length ? `<section class="inside-card"><h3>Actions the crew can take</h3><ul class="plain">${shown.map(
|
|
368
|
+
(t) => `<li><strong>${esc(humanizeTool(t.name))}</strong><span>${esc(firstSentence(t.description ?? ""))}</span></li>`
|
|
369
|
+
).join(
|
|
370
|
+
""
|
|
371
|
+
)}</ul>${actions.length > shown.length ? `<p class="small">And ${actions.length - shown.length} more.</p>` : ""}<p class="small">Each action is a small script that changes the app\u2019s files, checked by Gezel\u2019s security settings before it runs.</p></section>` : "";
|
|
372
|
+
const keeps = files.length ? `<section class="inside-card"><h3>Files it keeps</h3><p>Plain files in the project folder you can open, back up, and read: ${files.map((f) => `<code>${esc(f)}</code>`).join(", ")}.</p></section>` : "";
|
|
373
|
+
return `${head(`${m.name} \u2014 a Gezel app`, m.description, `/apps/${m.id}/`, ctx)}
|
|
374
|
+
<body>
|
|
375
|
+
<div class="wrap">
|
|
376
|
+
${masthead()}
|
|
377
|
+
<main>
|
|
378
|
+
<nav class="crumbs" aria-label="Breadcrumb"><a href="/apps/">Apps</a><span aria-hidden="true"> / </span><span>${esc(label)}</span></nav>
|
|
379
|
+
<section class="app-hero">
|
|
380
|
+
${mark(app, 200, "logo.webp")}
|
|
381
|
+
<div>
|
|
382
|
+
<h1>${esc(m.name)}</h1>
|
|
383
|
+
<p class="lede">${esc(m.description)}</p>
|
|
384
|
+
<p class="app-actions"><a class="button" href="/#download">Get Gezel</a><a class="text-link" href="${esc(docs)}project-type/${esc(m.id)}/">Read about it in the docs<span aria-hidden="true"> \u2192</span></a></p>
|
|
385
|
+
</div>
|
|
386
|
+
</section>
|
|
387
|
+
${demo}
|
|
388
|
+
<section class="inside" aria-labelledby="inside">
|
|
389
|
+
<h2 id="inside">What\u2019s inside</h2>
|
|
390
|
+
<div class="inside-grid">${crew}${plans}${tools}${keeps}</div>
|
|
391
|
+
</section>
|
|
392
|
+
<section class="steps" aria-labelledby="start">
|
|
393
|
+
<h2 id="start">Start one</h2>
|
|
394
|
+
<ol>
|
|
395
|
+
<li><a href="/#download">Download Gezel</a> for Mac, Windows or Linux. It\u2019s free.</li>
|
|
396
|
+
<li>Choose <strong>New project</strong>, then <strong>${esc(label)}</strong>, then <strong>${esc(m.name)}</strong>.</li>
|
|
397
|
+
${questions.length ? `<li>Answer ${questions.length === 1 ? "its question" : "a few questions"}: ${questions.map((q) => `<em>${esc(q)}</em>`).join(" ")}</li>` : ""}
|
|
398
|
+
<li>${lead ? `Your ${esc(lead.role.toLowerCase())} takes it from there, on the model you choose.` : "Your crew takes it from there, on the model you choose."}</li>
|
|
399
|
+
</ol>
|
|
400
|
+
</section>
|
|
401
|
+
${more.length ? `<section class="more" aria-labelledby="more"><h2 id="more">More apps to try</h2><ul class="app-grid app-grid-small">${more.map((a) => card(a, "../")).join("")}</ul></section>` : ""}
|
|
402
|
+
</main>
|
|
403
|
+
${footer(ctx)}
|
|
404
|
+
</div>
|
|
405
|
+
</body>
|
|
406
|
+
</html>
|
|
407
|
+
`;
|
|
408
|
+
}
|
|
409
|
+
var APPS_CSS = `@font-face { font-family: 'Hanken Grotesk'; font-weight: 100 900; font-display: swap; src: url(/assets/fonts/hanken-grotesk-variable.woff2) format('woff2'); }
|
|
410
|
+
@font-face { font-family: 'Hanken Grotesk'; font-weight: 400; font-style: italic; font-display: swap; src: url(/assets/fonts/hanken-grotesk-400i.woff2) format('woff2'); }
|
|
411
|
+
@font-face { font-family: 'PT Serif'; font-weight: 400; font-display: swap; src: url(/assets/fonts/pt-serif-400.woff2) format('woff2'); }
|
|
412
|
+
@font-face { font-family: 'PT Serif'; font-weight: 400; font-style: italic; font-display: swap; src: url(/assets/fonts/pt-serif-400i.woff2) format('woff2'); }
|
|
413
|
+
@font-face { font-family: 'PT Serif'; font-weight: 700; font-display: swap; src: url(/assets/fonts/pt-serif-700.woff2) format('woff2'); }
|
|
414
|
+
:root {
|
|
415
|
+
color-scheme: light dark;
|
|
416
|
+
--bg: #eae5d6; --panel: #f3eddf; --surface: #ddd3bd; --text: #1c1c1c; --muted: #5e5e5e; --muted-strong: #4d4d4d;
|
|
417
|
+
--accent: #9a5a35; --accent-hover: #80482a; --accent-soft: rgba(176, 114, 76, 0.16); --accent-line: rgba(176, 114, 76, 0.45);
|
|
418
|
+
--action-bg: #9a5a35; --action-ink: #fbf7ee;
|
|
419
|
+
--sage: #667f62; --border: rgba(127,127,127,0.28); --shadow: 0 1px 2px rgba(0,0,0,0.05), 0 6px 18px rgba(0,0,0,0.06);
|
|
420
|
+
--serif: 'PT Serif', Georgia, serif; --sans: 'Hanken Grotesk', system-ui, -apple-system, sans-serif; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
421
|
+
--ground-indigo: #4f5d7e; --ground-slate: #6f8aa0; --ground-teal: #5f8a86; --ground-sage: #8a9a76; --ground-forest: #4f6249; --ground-terracotta: #b0724c; --ground-rose: #c08a86; --ground-plum: #7d6378;
|
|
422
|
+
--band-bg: #4f6249; --band-title: #f6f1e4; --band-text: rgba(246, 241, 228, 0.88);
|
|
423
|
+
}
|
|
424
|
+
@media (prefers-color-scheme: dark) {
|
|
425
|
+
:root {
|
|
426
|
+
--bg: #141517; --panel: #1c1d20; --surface: #26282b; --text: #f0f0f0; --muted: #a8a8a8; --muted-strong: #c2c2c2;
|
|
427
|
+
--accent: #d39a70; --accent-hover: #e2b08b; --accent-soft: rgba(192, 135, 93, 0.18); --accent-line: rgba(192, 135, 93, 0.45);
|
|
428
|
+
--action-bg: #d39a70; --action-ink: #1a1410;
|
|
429
|
+
--shadow: 0 1px 2px rgba(0,0,0,0.3), 0 6px 18px rgba(0,0,0,0.36);
|
|
430
|
+
--ground-indigo: #3e4961; --ground-slate: #576b7b; --ground-teal: #4b6b67; --ground-sage: #6b775b; --ground-forest: #3e4c39; --ground-terracotta: #88593b; --ground-rose: #946b67; --ground-plum: #614d5d;
|
|
431
|
+
--band-bg: #253022; --band-title: #ece6d6; --band-text: rgba(236, 230, 214, 0.84);
|
|
106
432
|
}
|
|
107
|
-
await mkdir(dir, { recursive: true });
|
|
108
|
-
await writeFile(join(dir, MANIFEST), `${JSON.stringify(next, null, 2)}
|
|
109
|
-
`, "utf8");
|
|
110
|
-
return result;
|
|
111
433
|
}
|
|
434
|
+
* { box-sizing: border-box; }
|
|
435
|
+
[hidden] { display: none !important; }
|
|
436
|
+
body {
|
|
437
|
+
margin: 0; font-family: var(--sans); color: var(--text); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased;
|
|
438
|
+
background-image: repeating-linear-gradient(45deg, rgba(127,127,127,0.035) 0px, rgba(127,127,127,0.035) 1px, transparent 1px, transparent 3px);
|
|
439
|
+
}
|
|
440
|
+
a { color: var(--accent); text-decoration: none; }
|
|
441
|
+
a:hover { color: var(--accent-hover); }
|
|
442
|
+
:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
|
|
443
|
+
code { font-family: var(--mono); font-size: 0.86em; padding: 0.08em 0.36em; border-radius: 4px; background: var(--surface); color: var(--text); }
|
|
444
|
+
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; }
|
|
445
|
+
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
|
|
446
|
+
header.masthead { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; padding: 28px 0 8px; }
|
|
447
|
+
.logotype { font-family: var(--serif); font-weight: 700; font-style: italic; font-size: 1.7rem; line-height: 1; letter-spacing: -0.01em; color: var(--text); border-radius: 4px; }
|
|
448
|
+
.logotype:hover { color: var(--accent); }
|
|
449
|
+
.masthead-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; }
|
|
450
|
+
.masthead-nav a { border-radius: 4px; font-size: 0.95rem; font-weight: 500; }
|
|
451
|
+
.masthead-nav a[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent-line); text-decoration-thickness: 2px; text-underline-offset: 6px; }
|
|
452
|
+
.hero { padding: 40px 0 28px; max-width: 760px; }
|
|
453
|
+
.hero h1 { margin: 0 0 1rem; }
|
|
454
|
+
.hero .title { display: block; font-weight: 700; font-size: clamp(2.3rem, 5.5vw, 3.4rem); line-height: 1.08; letter-spacing: -0.01em; margin: 0 0 0.3em; }
|
|
455
|
+
.tagline { display: block; font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(1.15rem, 3vw, 1.5rem); line-height: 1.35; }
|
|
456
|
+
.lede { margin: 0; font-size: 1.06rem; }
|
|
457
|
+
.text-link { font-weight: 600; }
|
|
458
|
+
.filter { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin: 12px 0 20px; }
|
|
459
|
+
.tray { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 10px; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--border); box-shadow: inset 0 1px 2px rgba(0,0,0,0.08); }
|
|
460
|
+
.key { font: 500 0.9rem/1.2 var(--sans); color: var(--text); padding: 8px 12px; min-height: 36px; border-radius: 6px; border: 1px solid var(--border); background: linear-gradient(var(--panel), color-mix(in srgb, var(--panel) 92%, var(--surface))); box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 1px 1px rgba(0,0,0,0.06); cursor: pointer; }
|
|
461
|
+
.key:hover { background: var(--panel); border-color: var(--accent-line); }
|
|
462
|
+
.key[aria-checked="true"] { background: var(--action-bg); color: var(--action-ink); border-color: var(--action-bg); box-shadow: inset 0 1px 3px rgba(0,0,0,0.3); transform: translateY(1px); }
|
|
463
|
+
.filter-count { margin: 0; color: var(--muted); font-size: 0.9rem; }
|
|
464
|
+
.app-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
|
|
465
|
+
.app-card a { display: flex; flex-direction: column; height: 100%; color: inherit; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); transition: transform 140ms ease-out, border-color 140ms ease-out; }
|
|
466
|
+
.app-card a:hover { transform: translateY(-2px); border-color: var(--accent-line); color: inherit; }
|
|
467
|
+
.app-card .mark { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; display: block; padding: 12px; }
|
|
468
|
+
.mark-empty { display: grid; place-items: center; font: 700 2.4rem var(--serif); color: rgba(255,255,255,0.86); }
|
|
469
|
+
.app-card-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; flex: 1; }
|
|
470
|
+
.app-card-kicker { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
|
|
471
|
+
.app-card strong { font-family: var(--serif); font-size: 1.15rem; line-height: 1.25; }
|
|
472
|
+
.app-card-text { color: var(--muted-strong); font-size: 0.92rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
|
|
473
|
+
.app-card-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: auto; padding-top: 10px; font-size: 0.82rem; color: var(--muted); }
|
|
474
|
+
.tag { display: inline-block; padding: 1px 7px; border-radius: 4px; border: 1px solid var(--border); font-size: 0.78rem; font-weight: 600; color: var(--muted-strong); background: color-mix(in srgb, var(--surface) 60%, transparent); }
|
|
475
|
+
.tag-try { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
|
|
476
|
+
[data-ground="indigo"] { background-color: var(--ground-indigo); } [data-ground="slate"] { background-color: var(--ground-slate); } [data-ground="teal"] { background-color: var(--ground-teal); } [data-ground="sage"] { background-color: var(--ground-sage); } [data-ground="forest"] { background-color: var(--ground-forest); } [data-ground="terracotta"] { background-color: var(--ground-terracotta); } [data-ground="rose"] { background-color: var(--ground-rose); } [data-ground="plum"] { background-color: var(--ground-plum); }
|
|
477
|
+
.band { margin: 64px 0 24px; padding: 36px 40px; border-radius: 10px; background: var(--band-bg); color: var(--band-text); }
|
|
478
|
+
.band h2 { color: var(--band-title); margin: 0 0 0.6rem; font-size: 1.7rem; }
|
|
479
|
+
.band p { margin: 0 0 0.8rem; max-width: 720px; }
|
|
480
|
+
.band-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
|
|
481
|
+
.band a { color: var(--band-title); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(246,241,228,0.45); text-underline-offset: 4px; }
|
|
482
|
+
.crumbs { font-size: 0.9rem; color: var(--muted); padding: 20px 0 0; }
|
|
483
|
+
.app-hero { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: center; padding: 20px 0 28px; }
|
|
484
|
+
.app-hero .mark { width: 200px; height: 200px; border-radius: 10px; object-fit: contain; padding: 14px; }
|
|
485
|
+
.app-hero .mark-empty { width: 200px; height: 200px; border-radius: 10px; }
|
|
486
|
+
.app-hero h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); margin: 0 0 0.5rem; letter-spacing: -0.01em; }
|
|
487
|
+
.app-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 1.2rem 0 0; }
|
|
488
|
+
.button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 6px; background: var(--action-bg); color: var(--action-ink); font-weight: 600; box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.15); }
|
|
489
|
+
.button:hover { color: var(--action-ink); filter: brightness(1.06); }
|
|
490
|
+
.demo { margin: 8px 0 48px; }
|
|
491
|
+
.demo-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
|
|
492
|
+
.demo h2, .inside h2, .steps h2, .more h2 { font-size: 1.6rem; margin: 0 0 0.4rem; }
|
|
493
|
+
.demo-note { margin: 0 0 14px; color: var(--muted-strong); max-width: 780px; }
|
|
494
|
+
.demo-frame { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--panel); box-shadow: var(--shadow); }
|
|
495
|
+
.demo-frame iframe { display: block; width: 100%; height: min(860px, 86vh); min-height: 560px; border: 0; background: var(--bg); }
|
|
496
|
+
.demo-native { padding: 24px 28px; border: 1px dashed var(--border); border-radius: 10px; background: var(--panel); }
|
|
497
|
+
.demo-native p { margin: 0; max-width: 720px; color: var(--muted-strong); }
|
|
498
|
+
.inside { margin: 0 0 48px; }
|
|
499
|
+
.inside-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; gap: 16px; margin-top: 12px; }
|
|
500
|
+
.inside-card { padding: 18px 20px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
|
|
501
|
+
.inside-card h3 { margin: 0 0 0.6rem; font-size: 1.15rem; }
|
|
502
|
+
.inside-card p { margin: 0.6rem 0 0; }
|
|
503
|
+
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
|
|
504
|
+
.plain li { display: grid; gap: 2px; }
|
|
505
|
+
.plain li > span:last-child { color: var(--muted-strong); font-size: 0.92rem; line-height: 1.45; }
|
|
506
|
+
.plain .tag { justify-self: start; }
|
|
507
|
+
.plain li:has(> .tag) { grid-template-columns: auto 1fr; column-gap: 8px; align-items: baseline; }
|
|
508
|
+
.plain li:has(> .tag) > span:last-child { grid-column: 1 / -1; }
|
|
509
|
+
.small { font-size: 0.86rem; color: var(--muted); }
|
|
510
|
+
.steps { margin: 0 0 48px; }
|
|
511
|
+
.steps ol { margin: 0.6rem 0 0; padding-left: 1.4rem; display: grid; gap: 6px; max-width: 760px; }
|
|
512
|
+
.steps em { font-family: var(--serif); }
|
|
513
|
+
.steps em + em::before { content: ' \xB7 '; font-style: normal; color: var(--muted); }
|
|
514
|
+
.more { margin: 0 0 32px; }
|
|
515
|
+
footer { padding: 28px 0 40px; margin-top: 40px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; text-align: center; }
|
|
516
|
+
footer p { margin: 0.3em 0; }
|
|
517
|
+
footer a { color: var(--muted); }
|
|
518
|
+
footer a:hover { color: var(--accent); }
|
|
519
|
+
footer .sep { opacity: 0.45; margin: 0 9px; }
|
|
520
|
+
@media (max-width: 720px) {
|
|
521
|
+
.app-hero { grid-template-columns: 1fr; gap: 16px; }
|
|
522
|
+
.app-hero .mark, .app-hero .mark-empty { width: 120px; height: 120px; }
|
|
523
|
+
.band { padding: 28px 22px; }
|
|
524
|
+
.demo-frame iframe { height: 88vh; }
|
|
525
|
+
}
|
|
526
|
+
@media (prefers-reduced-motion: reduce) { .app-card a { transition: none; } .app-card a:hover { transform: none; } }
|
|
527
|
+
`;
|
|
112
528
|
|
|
113
|
-
// src/handboek-
|
|
529
|
+
// src/handboek-data-tables.ts
|
|
530
|
+
import { readFile } from "fs/promises";
|
|
531
|
+
import { resolve, sep } from "path";
|
|
114
532
|
import {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
533
|
+
SCORECARD_DATA_ATTRS as SCORECARD_DATA_ATTRS2,
|
|
534
|
+
scorecardHardwareKey,
|
|
535
|
+
scorecardModelFamilyId
|
|
118
536
|
} from "@bendyline/gezel";
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
var
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
var
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
)
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const toolsets = await catalog.list("toolset");
|
|
152
|
-
const addOns = toolsets.filter((s) => s.sourceId !== "community" && s.sourceId !== "builtin").map((s) => s.manifest).sort(byName);
|
|
153
|
-
const communityCount = toolsets.filter((s) => s.sourceId === "community").length;
|
|
154
|
-
const connectors = (await manifests("connector-type")).sort(byName);
|
|
155
|
-
const roles = (await manifests("gezel-template")).sort(byName);
|
|
156
|
-
const projectTypes = await manifests("project-type");
|
|
157
|
-
const craftbooks = (await manifests("craftbook-template")).sort(
|
|
158
|
-
byName
|
|
159
|
-
);
|
|
160
|
-
const craftbookArt = /* @__PURE__ */ new Map();
|
|
161
|
-
for (const book of craftbooks) {
|
|
162
|
-
if (book.logo !== CRAFTBOOK_ART_FILE) continue;
|
|
163
|
-
const bytes = await catalog.readItemFile("craftbook-template", book.id, CRAFTBOOK_ART_FILE);
|
|
164
|
-
if (bytes) craftbookArt.set(book.id, bytes);
|
|
537
|
+
import { defaultDataReaders } from "@bendyline/squisq-formats/data";
|
|
538
|
+
import { isDataFilePath, resolveDataReferences } from "@bendyline/squisq/doc";
|
|
539
|
+
import { MemoryContentContainer } from "@bendyline/squisq/storage";
|
|
540
|
+
|
|
541
|
+
// src/handboek-site-scorecard.ts
|
|
542
|
+
import {
|
|
543
|
+
MODEL_TIER_ORDER,
|
|
544
|
+
SCORECARD_DATA_ATTRS,
|
|
545
|
+
SCORECARD_QUERY_PARAMS,
|
|
546
|
+
SCORECARD_ROUND_ALL,
|
|
547
|
+
SCORECARD_ROUND_LATEST
|
|
548
|
+
} from "@bendyline/gezel";
|
|
549
|
+
var ATTRS = SCORECARD_DATA_ATTRS;
|
|
550
|
+
var PARAMS = SCORECARD_QUERY_PARAMS;
|
|
551
|
+
var SCORECARD_VIEW_EVENT = "hb-scorecard-view";
|
|
552
|
+
var SCORECARD_TABLE_EVENT = "hb-scorecard-table";
|
|
553
|
+
var SCORECARD_FILTER_JS = `(function () {
|
|
554
|
+
'use strict';
|
|
555
|
+
|
|
556
|
+
var ATTR = ${JSON.stringify(ATTRS)};
|
|
557
|
+
var PARAM = ${JSON.stringify(PARAMS)};
|
|
558
|
+
var VIEW_EVENT = ${JSON.stringify(SCORECARD_VIEW_EVENT)};
|
|
559
|
+
var TABLE_EVENT = ${JSON.stringify(SCORECARD_TABLE_EVENT)};
|
|
560
|
+
var ROUND_LATEST = ${JSON.stringify(SCORECARD_ROUND_LATEST)};
|
|
561
|
+
var ROUND_ALL = ${JSON.stringify(SCORECARD_ROUND_ALL)};
|
|
562
|
+
var TIER_ORDER = ${JSON.stringify(MODEL_TIER_ORDER)};
|
|
563
|
+
|
|
564
|
+
var ANY = '';
|
|
565
|
+
|
|
566
|
+
function attr(el, name) {
|
|
567
|
+
var value = el.getAttribute(name);
|
|
568
|
+
return value === null ? '' : value;
|
|
165
569
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
"gezel-template",
|
|
171
|
-
role.id,
|
|
172
|
-
role.about,
|
|
173
|
-
void 0,
|
|
174
|
-
role.version
|
|
175
|
-
);
|
|
176
|
-
if (bytes) roleAbouts.set(role.id, bytes.toString("utf8"));
|
|
570
|
+
|
|
571
|
+
function tokens(el, name) {
|
|
572
|
+
var raw = attr(el, name).trim();
|
|
573
|
+
return raw ? raw.split(/\\s+/) : [];
|
|
177
574
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
subcategory: MODELS_AND_TESTING
|
|
188
|
-
},
|
|
189
|
-
markdown: modelCatalogMarkdown(chat, images, videos),
|
|
190
|
-
listed: true
|
|
191
|
-
},
|
|
192
|
-
...chat.map((m) => ({
|
|
193
|
-
entry: {
|
|
194
|
-
id: `model/${m.id}`,
|
|
195
|
-
title: m.name,
|
|
196
|
-
area: "technical",
|
|
197
|
-
order: 100,
|
|
198
|
-
summary: firstSentence(m.description),
|
|
199
|
-
generated: true,
|
|
200
|
-
subcategory: MODELS_AND_TESTING
|
|
201
|
-
},
|
|
202
|
-
markdown: chatModelMarkdown(m),
|
|
203
|
-
listed: false
|
|
204
|
-
})),
|
|
205
|
-
{
|
|
206
|
-
entry: {
|
|
207
|
-
id: TOOLSET_CATALOG_ID,
|
|
208
|
-
title: "Add-on toolsets and connectors",
|
|
209
|
-
area: "technical",
|
|
210
|
-
order: 4.5,
|
|
211
|
-
summary: "Toolsets you can add to a gezel, and connectors that bring outside data into a project.",
|
|
212
|
-
generated: true,
|
|
213
|
-
subcategory: HOW_GEZEL_WORKS
|
|
214
|
-
},
|
|
215
|
-
markdown: toolsetCatalogMarkdown(addOns, connectors, communityCount),
|
|
216
|
-
listed: true
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
entry: {
|
|
220
|
-
id: ROLE_CATALOG_ID,
|
|
221
|
-
title: "Every role template",
|
|
222
|
-
area: "gezel-roles",
|
|
223
|
-
order: 1,
|
|
224
|
-
summary: "Ready-made characters you can add to your crew, from researcher to meal planner.",
|
|
225
|
-
generated: true
|
|
226
|
-
},
|
|
227
|
-
markdown: roleCatalogMarkdown(roles),
|
|
228
|
-
listed: true
|
|
229
|
-
},
|
|
230
|
-
...roles.map((r) => ({
|
|
231
|
-
entry: {
|
|
232
|
-
id: `role-template/${r.id}`,
|
|
233
|
-
title: r.name,
|
|
234
|
-
area: "gezel-roles",
|
|
235
|
-
order: 100,
|
|
236
|
-
summary: firstSentence(r.description),
|
|
237
|
-
generated: true
|
|
238
|
-
},
|
|
239
|
-
markdown: roleTemplateMarkdown(r, roleAbouts.get(r.id)),
|
|
240
|
-
listed: false
|
|
241
|
-
})),
|
|
242
|
-
{
|
|
243
|
-
entry: {
|
|
244
|
-
id: "craftbooks-index",
|
|
245
|
-
title: "Every craftbook",
|
|
246
|
-
area: "craftbooks",
|
|
247
|
-
order: 0,
|
|
248
|
-
generated: true
|
|
249
|
-
},
|
|
250
|
-
markdown: [
|
|
251
|
-
"# Every craftbook",
|
|
252
|
-
"",
|
|
253
|
-
`Craftbooks are step-by-step plans your crew follows to produce a real piece of work. Each one names its steps, who runs them, and the checks the result must pass. There are ${craftbooks.length} of them, grouped here by the kind of work they do.`
|
|
254
|
-
].join("\n"),
|
|
255
|
-
html: craftbookGalleryHtml(craftbooks, craftbookArt),
|
|
256
|
-
listed: false,
|
|
257
|
-
replaces: true
|
|
575
|
+
|
|
576
|
+
function unique(list) {
|
|
577
|
+
var seen = {};
|
|
578
|
+
var out = [];
|
|
579
|
+
for (var i = 0; i < list.length; i++) {
|
|
580
|
+
if (list[i] && !Object.prototype.hasOwnProperty.call(seen, list[i])) {
|
|
581
|
+
seen[list[i]] = true;
|
|
582
|
+
out.push(list[i]);
|
|
583
|
+
}
|
|
258
584
|
}
|
|
259
|
-
|
|
260
|
-
const demos = [];
|
|
261
|
-
for (const pt of projectTypes) {
|
|
262
|
-
const demo = await projectTypeDemo(catalog, pt);
|
|
263
|
-
if (demo) demos.push(demo);
|
|
585
|
+
return out;
|
|
264
586
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
m.supportsTools === false ? "No" : "Yes",
|
|
285
|
-
CATEGORY_LABELS[m.category ?? ""] ?? "",
|
|
286
|
-
engines(m).join(", "),
|
|
287
|
-
cell(m.licenseShortName ?? m.license ?? "")
|
|
288
|
-
])
|
|
289
|
-
)
|
|
290
|
-
];
|
|
291
|
-
if (images.length > 0) {
|
|
292
|
-
lines.push(
|
|
293
|
-
"",
|
|
294
|
-
`## Image models (${images.length})`,
|
|
295
|
-
"",
|
|
296
|
-
"Models your crew can use to draw pictures, icons and illustrations. Gezel works out what each one needs from its files and offers only the ones your machine can run.",
|
|
297
|
-
"",
|
|
298
|
-
"| Model | Size | Commercial use | License |",
|
|
299
|
-
"| --- | --- | --- | --- |",
|
|
300
|
-
...images.map(
|
|
301
|
-
(m) => row([
|
|
302
|
-
link(m.name, m.upstream),
|
|
303
|
-
formatGB(m.approxSizeBytes),
|
|
304
|
-
yesNo(m.commercialUse),
|
|
305
|
-
cell(m.licenseShortName ?? m.license ?? "")
|
|
306
|
-
])
|
|
307
|
-
)
|
|
308
|
-
);
|
|
587
|
+
|
|
588
|
+
function collect(root) {
|
|
589
|
+
var nodes = root.querySelectorAll('[' + ATTR.round + ']');
|
|
590
|
+
var rounds = [];
|
|
591
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
592
|
+
var el = nodes[i];
|
|
593
|
+
rounds.push({
|
|
594
|
+
el: el,
|
|
595
|
+
id: attr(el, ATTR.round),
|
|
596
|
+
label: attr(el, ATTR.roundLabel) || attr(el, ATTR.date),
|
|
597
|
+
date: attr(el, ATTR.date),
|
|
598
|
+
hardware: attr(el, ATTR.hardware),
|
|
599
|
+
hardwareLabel: attr(el, ATTR.hardwareLabel) || attr(el, ATTR.hardware),
|
|
600
|
+
models: tokens(el, ATTR.models),
|
|
601
|
+
tiers: tokens(el, ATTR.tiers),
|
|
602
|
+
latest: el.hasAttribute(ATTR.latest)
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
return rounds;
|
|
309
606
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
(
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
)
|
|
328
|
-
);
|
|
607
|
+
|
|
608
|
+
function facets(rounds) {
|
|
609
|
+
var hardware = [];
|
|
610
|
+
var hardwareSeen = {};
|
|
611
|
+
var models = [];
|
|
612
|
+
var tiers = [];
|
|
613
|
+
for (var i = 0; i < rounds.length; i++) {
|
|
614
|
+
var round = rounds[i];
|
|
615
|
+
if (round.hardware && !Object.prototype.hasOwnProperty.call(hardwareSeen, round.hardware)) {
|
|
616
|
+
hardwareSeen[round.hardware] = true;
|
|
617
|
+
hardware.push({ value: round.hardware, label: round.hardwareLabel });
|
|
618
|
+
}
|
|
619
|
+
models = models.concat(round.models);
|
|
620
|
+
tiers = tiers.concat(round.tiers);
|
|
621
|
+
}
|
|
622
|
+
models = unique(models).sort();
|
|
623
|
+
tiers = unique(tiers).sort(function (a, b) {
|
|
624
|
+
return TIER_ORDER.indexOf(a) - TIER_ORDER.indexOf(b);
|
|
625
|
+
});
|
|
626
|
+
return { hardware: hardware, models: models, tiers: tiers };
|
|
329
627
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
["Runs on", engines(m).join(", ")],
|
|
343
|
-
["License", m.licenseShortName ?? m.license ?? ""],
|
|
344
|
-
["Added to the catalog", m.releasedAt ? m.releasedAt.slice(0, 10) : ""]
|
|
345
|
-
];
|
|
346
|
-
const lines = [
|
|
347
|
-
`# ${m.name}`,
|
|
348
|
-
"",
|
|
349
|
-
m.description.trim(),
|
|
350
|
-
"",
|
|
351
|
-
"| At a glance | |",
|
|
352
|
-
"| --- | --- |",
|
|
353
|
-
...facts.filter(([, v]) => v).map(([k, v]) => row([k, cell(v)])),
|
|
354
|
-
"",
|
|
355
|
-
"Gezel downloads this model the first time a gezel needs it, checks the file against its published hash, and applies tuned settings for it."
|
|
356
|
-
];
|
|
357
|
-
const more = [
|
|
358
|
-
m.upstream ? `[The model\u2019s own page](${m.upstream})` : "",
|
|
359
|
-
"[Every model](model-catalog)",
|
|
360
|
-
"[Model scorecard](model-scorecard)"
|
|
361
|
-
].filter(Boolean);
|
|
362
|
-
lines.push("", more.join(" \xB7 "));
|
|
363
|
-
return lines.join("\n");
|
|
364
|
-
}
|
|
365
|
-
function toolsetCatalogMarkdown(addOns, connectors, communityCount) {
|
|
366
|
-
const lines = [
|
|
367
|
-
"# Add-on toolsets and connectors",
|
|
368
|
-
"",
|
|
369
|
-
"Every gezel starts with the built-in tool groups that fit its role, described in [Tools and toolsets](tools-and-toolsets). This page lists what you can add on top."
|
|
370
|
-
];
|
|
371
|
-
if (addOns.length > 0) {
|
|
372
|
-
lines.push(
|
|
373
|
-
"",
|
|
374
|
-
"## Add-on toolsets",
|
|
375
|
-
"",
|
|
376
|
-
"Extra tools from Gezel\u2019s own catalog. Add one to a gezel from its Toolsets tab.",
|
|
377
|
-
"",
|
|
378
|
-
"| Toolset | What it does |",
|
|
379
|
-
"| --- | --- |",
|
|
380
|
-
...addOns.map((t) => row([cell(t.name), cell(firstSentence(t.description) ?? "")]))
|
|
381
|
-
);
|
|
628
|
+
|
|
629
|
+
/* \u2500\u2500 state \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
630
|
+
|
|
631
|
+
function readState() {
|
|
632
|
+
var params = new URLSearchParams(window.location.search);
|
|
633
|
+
return {
|
|
634
|
+
round: params.get(PARAM.round) || ANY,
|
|
635
|
+
date: params.get(PARAM.date) || ANY,
|
|
636
|
+
hardware: params.get(PARAM.hardware) || ANY,
|
|
637
|
+
model: params.get(PARAM.model) || ANY,
|
|
638
|
+
modelClass: params.get(PARAM.modelClass) || ANY
|
|
639
|
+
};
|
|
382
640
|
}
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
"## Connectors",
|
|
387
|
-
"",
|
|
388
|
-
"Connectors copy data from outside services, such as mail, calendars and issue trackers, into a project as searchable files. Your crew works on that local copy, never on the live account.",
|
|
389
|
-
"",
|
|
390
|
-
"| Connector | What it brings in |",
|
|
391
|
-
"| --- | --- |",
|
|
392
|
-
...connectors.map((c) => row([cell(c.name), cell(firstSentence(c.description) ?? "")]))
|
|
393
|
-
);
|
|
641
|
+
|
|
642
|
+
function narrowed(state) {
|
|
643
|
+
return !!(state.hardware || state.model || state.modelClass);
|
|
394
644
|
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
645
|
+
|
|
646
|
+
/*
|
|
647
|
+
* A pinned round wins; otherwise the default depends on whether the
|
|
648
|
+
* reader has narrowed anything. Asking for one model with the page still
|
|
649
|
+
* pinned to the latest round would answer "no results" whenever that
|
|
650
|
+
* round did not measure it \u2014 so any narrowing opens the history.
|
|
651
|
+
*/
|
|
652
|
+
function scopeFor(state, rounds) {
|
|
653
|
+
if (state.round === ROUND_ALL) return rounds;
|
|
654
|
+
if (state.round === ROUND_LATEST) return latest(rounds);
|
|
655
|
+
if (state.round) {
|
|
656
|
+
return rounds.filter(function (round) {
|
|
657
|
+
return round.id === state.round;
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
if (state.date) {
|
|
661
|
+
return rounds.filter(function (round) {
|
|
662
|
+
return round.date === state.date;
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
return narrowed(state) ? rounds : latest(rounds);
|
|
402
666
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
function
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
"",
|
|
411
|
-
"| Role | What they do |",
|
|
412
|
-
"| --- | --- |",
|
|
413
|
-
...roles.map(
|
|
414
|
-
(r) => row([`[${cell(r.name)}](role-template/${r.id})`, cell(firstSentence(r.description) ?? "")])
|
|
415
|
-
)
|
|
416
|
-
].join("\n");
|
|
417
|
-
}
|
|
418
|
-
function roleTemplateMarkdown(r, about) {
|
|
419
|
-
const lines = [`# ${r.name}`, "", r.description.trim()];
|
|
420
|
-
if (r.meesterCandidate) {
|
|
421
|
-
lines.push("", "This character can also act as your Meester, the gezel who runs the crew.");
|
|
667
|
+
|
|
668
|
+
function latest(rounds) {
|
|
669
|
+
var flagged = rounds.filter(function (round) {
|
|
670
|
+
return round.latest;
|
|
671
|
+
});
|
|
672
|
+
if (flagged.length > 0) return flagged;
|
|
673
|
+
return rounds.length > 0 ? [rounds[0]] : [];
|
|
422
674
|
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
675
|
+
|
|
676
|
+
/* Which option the round picker should show for the current state. */
|
|
677
|
+
function roundSelection(state, rounds) {
|
|
678
|
+
if (state.round) return state.round;
|
|
679
|
+
if (state.date) {
|
|
680
|
+
var onDate = rounds.filter(function (round) {
|
|
681
|
+
return round.date === state.date;
|
|
682
|
+
});
|
|
683
|
+
if (onDate.length === 1) return onDate[0].id;
|
|
684
|
+
return onDate.length > 0 ? ROUND_ALL : ROUND_LATEST;
|
|
685
|
+
}
|
|
686
|
+
return narrowed(state) ? ROUND_ALL : ROUND_LATEST;
|
|
432
687
|
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
688
|
+
|
|
689
|
+
/*
|
|
690
|
+
* The shortest link that reproduces exactly what is on screen.
|
|
691
|
+
*
|
|
692
|
+
* Two rules earn their complexity. A round of ROUND_LATEST or ROUND_ALL
|
|
693
|
+
* is written only when it is NOT what scopeFor would have defaulted to,
|
|
694
|
+
* because the default flips once the reader narrows something \u2014 omitting
|
|
695
|
+
* it on the wrong side of that flip hands out a link that opens a
|
|
696
|
+
* different page than the one that was shared. And a pinned round is
|
|
697
|
+
* written as its date whenever that date belongs to one sweep, because
|
|
698
|
+
* ?date=2026-08-22 is what a person would rather paste into a message;
|
|
699
|
+
* dates are not unique, so the run id is still written when one date
|
|
700
|
+
* carries two.
|
|
701
|
+
*/
|
|
702
|
+
function writeState(state, rounds) {
|
|
703
|
+
var params = new URLSearchParams(window.location.search);
|
|
704
|
+
params.delete(PARAM.round);
|
|
705
|
+
params.delete(PARAM.date);
|
|
706
|
+
params.delete(PARAM.hardware);
|
|
707
|
+
params.delete(PARAM.model);
|
|
708
|
+
params.delete(PARAM.modelClass);
|
|
709
|
+
var defaultRound = narrowed(state) ? ROUND_ALL : ROUND_LATEST;
|
|
710
|
+
if (state.round === ROUND_ALL || state.round === ROUND_LATEST) {
|
|
711
|
+
if (state.round !== defaultRound) params.set(PARAM.round, state.round);
|
|
712
|
+
} else if (state.round) {
|
|
713
|
+
var pinned = rounds.filter(function (round) {
|
|
714
|
+
return round.id === state.round;
|
|
715
|
+
})[0];
|
|
716
|
+
var sharesDate = pinned
|
|
717
|
+
? rounds.filter(function (round) {
|
|
718
|
+
return round.date === pinned.date;
|
|
719
|
+
}).length > 1
|
|
720
|
+
: true;
|
|
721
|
+
if (pinned && !sharesDate) params.set(PARAM.date, pinned.date);
|
|
722
|
+
else params.set(PARAM.round, state.round);
|
|
723
|
+
} else if (state.date) {
|
|
724
|
+
params.set(PARAM.date, state.date);
|
|
725
|
+
}
|
|
726
|
+
if (state.hardware) params.set(PARAM.hardware, state.hardware);
|
|
727
|
+
if (state.model) params.set(PARAM.model, state.model);
|
|
728
|
+
if (state.modelClass) params.set(PARAM.modelClass, state.modelClass);
|
|
729
|
+
var query = params.toString();
|
|
730
|
+
var url = window.location.pathname + (query ? '?' + query : '') + window.location.hash;
|
|
731
|
+
window.history.replaceState(null, '', url);
|
|
457
732
|
}
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
}).join("\n")}
|
|
467
|
-
</ul>
|
|
468
|
-
</section>`
|
|
469
|
-
).join("\n");
|
|
470
|
-
}
|
|
471
|
-
function craftbookArtHtml(title) {
|
|
472
|
-
return `<img class="hb-craftbook-art" src="${CRAFTBOOK_ART_FILE}" alt="${escHtml(title)} illustration" width="160" height="160" decoding="async">`;
|
|
473
|
-
}
|
|
474
|
-
function insertAfterTitle(body, html) {
|
|
475
|
-
const end = body.indexOf("</h1>");
|
|
476
|
-
if (end === -1) return `${html}
|
|
477
|
-
${body}`;
|
|
478
|
-
const at = end + "</h1>".length;
|
|
479
|
-
return `${body.slice(0, at)}
|
|
480
|
-
${html}${body.slice(at)}`;
|
|
481
|
-
}
|
|
482
|
-
function escHtml(s) {
|
|
483
|
-
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
484
|
-
}
|
|
485
|
-
async function projectTypeDemo(catalog, pt) {
|
|
486
|
-
const entry = safeRelativePath(pt.pages?.entry);
|
|
487
|
-
if (!entry) return null;
|
|
488
|
-
const prefix = `versions/${pt.version}/pages/`;
|
|
489
|
-
const paths = (await catalog.listItemFiles("project-type", pt.id)).map((p) => p.replaceAll("\\", "/")).filter((p) => p.startsWith(prefix)).map((p) => p.slice(prefix.length)).filter((p) => safeRelativePath(p) !== void 0);
|
|
490
|
-
if (!paths.includes(entry)) return null;
|
|
491
|
-
const files = [];
|
|
492
|
-
for (const path of paths) {
|
|
493
|
-
const bytes = await catalog.readItemFile("project-type", pt.id, `${prefix}${path}`);
|
|
494
|
-
if (bytes) files.push({ path, bytes });
|
|
733
|
+
|
|
734
|
+
/* \u2500\u2500 controls \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
735
|
+
|
|
736
|
+
function option(value, label) {
|
|
737
|
+
var el = document.createElement('option');
|
|
738
|
+
el.value = value;
|
|
739
|
+
el.textContent = label;
|
|
740
|
+
return el;
|
|
495
741
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
const at = firstParagraphEnd + "</p>".length;
|
|
513
|
-
return `${body.slice(0, at)}
|
|
514
|
-
${section}${body.slice(at)}`;
|
|
515
|
-
}
|
|
516
|
-
function safeRelativePath(value) {
|
|
517
|
-
if (typeof value !== "string") return void 0;
|
|
518
|
-
const normalized = value.replaceAll("\\", "/").replace(/^\.\//, "");
|
|
519
|
-
const segments = normalized.split("/");
|
|
520
|
-
if (!normalized || normalized.startsWith("/") || segments.some((s) => !s || s === "..")) {
|
|
521
|
-
return void 0;
|
|
742
|
+
|
|
743
|
+
function field(id, labelText, options) {
|
|
744
|
+
var wrap = document.createElement('label');
|
|
745
|
+
wrap.className = 'hb-scorecard-field';
|
|
746
|
+
var caption = document.createElement('span');
|
|
747
|
+
caption.className = 'hb-scorecard-field-label';
|
|
748
|
+
caption.textContent = labelText;
|
|
749
|
+
var select = document.createElement('select');
|
|
750
|
+
select.className = 'hb-scorecard-select';
|
|
751
|
+
select.id = id;
|
|
752
|
+
for (var i = 0; i < options.length; i++) {
|
|
753
|
+
select.appendChild(option(options[i].value, options[i].label));
|
|
754
|
+
}
|
|
755
|
+
wrap.appendChild(caption);
|
|
756
|
+
wrap.appendChild(select);
|
|
757
|
+
return { wrap: wrap, select: select };
|
|
522
758
|
}
|
|
523
|
-
return normalized;
|
|
524
|
-
}
|
|
525
|
-
function byName(a, b) {
|
|
526
|
-
return a.name.localeCompare(b.name);
|
|
527
|
-
}
|
|
528
|
-
function engines(m) {
|
|
529
|
-
return ENGINE_LABELS.filter(([key]) => m[key] !== void 0).map(([, label]) => label);
|
|
530
|
-
}
|
|
531
|
-
function quantization(m) {
|
|
532
|
-
const blocks = [m.llamaCpp, m.mlx, m.ds4];
|
|
533
|
-
return blocks.find((b) => b?.quantization)?.quantization ?? "";
|
|
534
|
-
}
|
|
535
|
-
function firstSentence(text) {
|
|
536
|
-
const s = text?.trim().split(/\.\s/)[0]?.replace(/\.$/, "").trim();
|
|
537
|
-
return s ? `${s}.` : void 0;
|
|
538
|
-
}
|
|
539
|
-
function clip(text, max) {
|
|
540
|
-
if (text.length <= max) return text;
|
|
541
|
-
const cut = text.slice(0, max);
|
|
542
|
-
const space = cut.lastIndexOf(" ");
|
|
543
|
-
return `${(space > max * 0.6 ? cut.slice(0, space) : cut).replace(/[\s,;:—–-]+$/, "")}\u2026`;
|
|
544
|
-
}
|
|
545
|
-
function formatGB(bytes) {
|
|
546
|
-
if (typeof bytes !== "number" || !Number.isFinite(bytes) || bytes <= 0) return "";
|
|
547
|
-
return `${(bytes / 1e9).toFixed(1)} GB`;
|
|
548
|
-
}
|
|
549
|
-
function formatContext(tokens) {
|
|
550
|
-
if (typeof tokens !== "number" || !Number.isFinite(tokens) || tokens <= 0) return "";
|
|
551
|
-
return tokens >= 1e3 ? `${Math.round(tokens / 1e3)}K` : String(tokens);
|
|
552
|
-
}
|
|
553
|
-
function yesNo(value) {
|
|
554
|
-
return value === void 0 ? "" : value ? "Yes" : "No";
|
|
555
|
-
}
|
|
556
|
-
function roundDown(n) {
|
|
557
|
-
return n >= 1e3 ? Math.floor(n / 100) * 100 : n;
|
|
558
|
-
}
|
|
559
|
-
function link(text, url) {
|
|
560
|
-
return url && /^https?:\/\//.test(url) ? `[${cell(text)}](${url})` : cell(text);
|
|
561
|
-
}
|
|
562
|
-
function cell(text) {
|
|
563
|
-
return text.replace(/\|/g, "\\|").replace(/\s*\n\s*/g, " ").trim();
|
|
564
|
-
}
|
|
565
|
-
function row(cells) {
|
|
566
|
-
return `| ${cells.join(" | ")} |`;
|
|
567
|
-
}
|
|
568
759
|
|
|
569
|
-
|
|
570
|
-
var
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
}
|
|
760
|
+
function enhance(root) {
|
|
761
|
+
var mount = root.querySelector('[' + ATTR.controls + ']');
|
|
762
|
+
var rounds = collect(root);
|
|
763
|
+
if (!mount || rounds.length === 0) return;
|
|
764
|
+
var facet = facets(rounds);
|
|
765
|
+
|
|
766
|
+
var roundOptions = [
|
|
767
|
+
{ value: ROUND_LATEST, label: 'Latest round' },
|
|
768
|
+
{ value: ROUND_ALL, label: 'All rounds' }
|
|
769
|
+
];
|
|
770
|
+
for (var i = 0; i < rounds.length; i++) {
|
|
771
|
+
roundOptions.push({ value: rounds[i].id, label: rounds[i].label });
|
|
772
|
+
}
|
|
773
|
+
var hardwareOptions = [{ value: ANY, label: 'Any hardware' }];
|
|
774
|
+
for (var h = 0; h < facet.hardware.length; h++) {
|
|
775
|
+
hardwareOptions.push({ value: facet.hardware[h].value, label: facet.hardware[h].label });
|
|
776
|
+
}
|
|
777
|
+
var modelOptions = [{ value: ANY, label: 'Any model' }];
|
|
778
|
+
for (var m = 0; m < facet.models.length; m++) {
|
|
779
|
+
modelOptions.push({ value: facet.models[m], label: facet.models[m] });
|
|
780
|
+
}
|
|
781
|
+
var classOptions = [{ value: ANY, label: 'Any class' }];
|
|
782
|
+
for (var c = 0; c < facet.tiers.length; c++) {
|
|
783
|
+
classOptions.push({ value: facet.tiers[c], label: facet.tiers[c] });
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
var bar = document.createElement('div');
|
|
787
|
+
bar.className = 'hb-scorecard-controlbar';
|
|
788
|
+
var hardware = field('hb-scorecard-hardware', 'Hardware', hardwareOptions);
|
|
789
|
+
var model = field('hb-scorecard-model', 'Model', modelOptions);
|
|
790
|
+
var modelClass = field('hb-scorecard-class', 'Model class', classOptions);
|
|
791
|
+
var round = field('hb-scorecard-round', 'Test round', roundOptions);
|
|
792
|
+
bar.appendChild(hardware.wrap);
|
|
793
|
+
bar.appendChild(model.wrap);
|
|
794
|
+
bar.appendChild(modelClass.wrap);
|
|
795
|
+
bar.appendChild(round.wrap);
|
|
796
|
+
|
|
797
|
+
var reset = document.createElement('button');
|
|
798
|
+
reset.type = 'button';
|
|
799
|
+
reset.className = 'hb-scorecard-reset';
|
|
800
|
+
reset.textContent = 'Reset to latest';
|
|
801
|
+
|
|
802
|
+
var status = document.createElement('p');
|
|
803
|
+
status.className = 'hb-scorecard-status';
|
|
804
|
+
status.setAttribute('role', 'status');
|
|
805
|
+
|
|
806
|
+
// Written by the script rather than into the article, because it is only
|
|
807
|
+
// true where the controls exist: the same prose is read in the app, where
|
|
808
|
+
// this page is a fixed stack of rounds with no address bar behind it.
|
|
809
|
+
var help = document.createElement('p');
|
|
810
|
+
help.className = 'hb-scorecard-help';
|
|
811
|
+
help.textContent =
|
|
812
|
+
'Pick a machine, a model, or a round. Your choice goes into the address bar, so a link you copy opens the same view.';
|
|
813
|
+
|
|
814
|
+
mount.appendChild(bar);
|
|
815
|
+
mount.appendChild(status);
|
|
816
|
+
mount.appendChild(help);
|
|
817
|
+
bar.appendChild(reset);
|
|
818
|
+
|
|
819
|
+
var state = readState();
|
|
820
|
+
// Rounds the all-results table still shows rows for while its column
|
|
821
|
+
// filters are on; null while they are off. Narrows the list, never widens it.
|
|
822
|
+
var tableRounds = null;
|
|
823
|
+
var picked = {};
|
|
594
824
|
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
--hb-reading: #1a1b1e;
|
|
600
|
-
--hb-inset: #1f2124;
|
|
601
|
-
--hb-ink: #f0f0f0;
|
|
602
|
-
--hb-ink-warm: #ececec;
|
|
603
|
-
--hb-ink-muted: #999999;
|
|
604
|
-
--hb-ink-quiet: #808080;
|
|
605
|
-
--hb-sage: #4d6149;
|
|
606
|
-
--hb-accent: #c0875d;
|
|
607
|
-
--hb-accent-hover: #d5a07a;
|
|
608
|
-
--hb-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.36);
|
|
609
|
-
}
|
|
610
|
-
}
|
|
825
|
+
function render() {
|
|
826
|
+
var scope = scopeFor(state, rounds);
|
|
827
|
+
var inScope = {};
|
|
828
|
+
for (var s = 0; s < scope.length; s++) inScope[scope[s].id] = true;
|
|
611
829
|
|
|
612
|
-
|
|
830
|
+
picked = {};
|
|
831
|
+
for (var r = 0; r < rounds.length; r++) {
|
|
832
|
+
var entry = rounds[r];
|
|
833
|
+
picked[entry.id] =
|
|
834
|
+
!!inScope[entry.id] &&
|
|
835
|
+
(!state.hardware || entry.hardware === state.hardware) &&
|
|
836
|
+
rowsMatch(entry);
|
|
837
|
+
}
|
|
838
|
+
paint();
|
|
613
839
|
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
line-height: 1.6;
|
|
621
|
-
-webkit-font-smoothing: antialiased;
|
|
622
|
-
}
|
|
840
|
+
hardware.select.value = state.hardware;
|
|
841
|
+
model.select.value = state.model;
|
|
842
|
+
modelClass.select.value = state.modelClass;
|
|
843
|
+
round.select.value = roundSelection(state, rounds);
|
|
844
|
+
reset.hidden = !state.hardware && !state.model && !state.modelClass && !state.round && !state.date;
|
|
845
|
+
writeState(state, rounds);
|
|
623
846
|
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
.
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
847
|
+
var view = {
|
|
848
|
+
rounds: scope.map(function (entry) {
|
|
849
|
+
return entry.id;
|
|
850
|
+
}),
|
|
851
|
+
hardware: state.hardware,
|
|
852
|
+
model: state.model,
|
|
853
|
+
modelClass: state.modelClass
|
|
854
|
+
};
|
|
855
|
+
root.hbScorecardView = view;
|
|
856
|
+
root.dispatchEvent(new CustomEvent(VIEW_EVENT, { detail: view }));
|
|
857
|
+
}
|
|
631
858
|
|
|
632
|
-
/*
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
.
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
font-weight: 700;
|
|
646
|
-
}
|
|
859
|
+
/* Show the rounds the pickers kept and the table's filters still reach. */
|
|
860
|
+
function paint() {
|
|
861
|
+
var shown = 0;
|
|
862
|
+
for (var r = 0; r < rounds.length; r++) {
|
|
863
|
+
var entry = rounds[r];
|
|
864
|
+
var visible = !!picked[entry.id] && (!tableRounds || tableRounds.indexOf(entry.id) !== -1);
|
|
865
|
+
entry.el.hidden = !visible;
|
|
866
|
+
if (visible) shown++;
|
|
867
|
+
}
|
|
868
|
+
status.textContent = shown === 0
|
|
869
|
+
? 'No test rounds match these filters.'
|
|
870
|
+
: 'Showing ' + shown + ' of ' + rounds.length + ' test ' + (rounds.length === 1 ? 'round' : 'rounds') + '.';
|
|
871
|
+
}
|
|
647
872
|
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
font-family: var(--hb-font-display);
|
|
654
|
-
font-style: italic;
|
|
655
|
-
font-weight: 400;
|
|
656
|
-
font-size: 1.15rem;
|
|
657
|
-
text-transform: lowercase;
|
|
658
|
-
padding-right: 0.6rem;
|
|
659
|
-
margin-right: 0.1rem;
|
|
660
|
-
border-right: 1px solid rgba(243, 237, 224, 0.35);
|
|
661
|
-
opacity: 0.9;
|
|
662
|
-
}
|
|
663
|
-
.hb-wordmark:hover { opacity: 1; }
|
|
664
|
-
.hb-masthead a, .hb-masthead a:hover { color: var(--hb-cream-ink); }
|
|
665
|
-
.hb-areanav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.9rem; }
|
|
666
|
-
.hb-areanav a { opacity: 0.85; }
|
|
667
|
-
.hb-areanav a:hover, .hb-areanav a[aria-current='true'] { opacity: 1; }
|
|
668
|
-
.hb-areanav a[aria-current='true'] { text-decoration: underline; text-underline-offset: 4px; }
|
|
873
|
+
// Repaints only: answering with another view event would loop.
|
|
874
|
+
root.addEventListener(TABLE_EVENT, function (event) {
|
|
875
|
+
tableRounds = event.detail.filtering ? event.detail.rounds : null;
|
|
876
|
+
paint();
|
|
877
|
+
});
|
|
669
878
|
|
|
670
|
-
/*
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
.
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
879
|
+
/*
|
|
880
|
+
* Rows and whole suite tables hide together with what they contain: a
|
|
881
|
+
* suite whose every row was filtered out would otherwise leave a
|
|
882
|
+
* heading over an empty table, which reads as "measured nothing" rather
|
|
883
|
+
* than "not what you asked for". Returns whether the round kept
|
|
884
|
+
* anything at all. A round listed as a link to its own page has no
|
|
885
|
+
* tables here, so it answers from the models and classes it is stamped
|
|
886
|
+
* with.
|
|
887
|
+
*/
|
|
888
|
+
function rowsMatch(round) {
|
|
889
|
+
var roundEl = round.el;
|
|
890
|
+
var suites = roundEl.querySelectorAll('[' + ATTR.suite + ']');
|
|
891
|
+
if (suites.length === 0) {
|
|
892
|
+
return (
|
|
893
|
+
(!state.model || round.models.indexOf(state.model) !== -1) &&
|
|
894
|
+
(!state.modelClass || round.tiers.indexOf(state.modelClass) !== -1)
|
|
895
|
+
);
|
|
896
|
+
}
|
|
897
|
+
var kept = 0;
|
|
898
|
+
for (var i = 0; i < suites.length; i++) {
|
|
899
|
+
var rows = suites[i].querySelectorAll('[' + ATTR.model + ']');
|
|
900
|
+
var visibleRows = 0;
|
|
901
|
+
for (var j = 0; j < rows.length; j++) {
|
|
902
|
+
var row = rows[j];
|
|
903
|
+
var ok =
|
|
904
|
+
(!state.model || attr(row, ATTR.model) === state.model) &&
|
|
905
|
+
(!state.modelClass || attr(row, ATTR.tier) === state.modelClass);
|
|
906
|
+
row.hidden = !ok;
|
|
907
|
+
if (ok) visibleRows++;
|
|
908
|
+
}
|
|
909
|
+
suites[i].hidden = visibleRows === 0;
|
|
910
|
+
if (visibleRows > 0) kept++;
|
|
911
|
+
}
|
|
912
|
+
return kept > 0;
|
|
913
|
+
}
|
|
683
914
|
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
}
|
|
695
|
-
.
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
.
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
.
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
915
|
+
function onNarrow(key, value) {
|
|
916
|
+
state[key] = value;
|
|
917
|
+
// Opening a narrower question on the latest round alone would answer
|
|
918
|
+
// it with whatever that one sweep happened to cover.
|
|
919
|
+
if (!state.round && !state.date && narrowed(state)) state.round = ROUND_ALL;
|
|
920
|
+
render();
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
hardware.select.addEventListener('change', function () {
|
|
924
|
+
onNarrow('hardware', hardware.select.value);
|
|
925
|
+
});
|
|
926
|
+
model.select.addEventListener('change', function () {
|
|
927
|
+
onNarrow('model', model.select.value);
|
|
928
|
+
});
|
|
929
|
+
modelClass.select.addEventListener('change', function () {
|
|
930
|
+
onNarrow('modelClass', modelClass.select.value);
|
|
931
|
+
});
|
|
932
|
+
round.select.addEventListener('change', function () {
|
|
933
|
+
state.date = ANY;
|
|
934
|
+
state.round = round.select.value;
|
|
935
|
+
render();
|
|
936
|
+
});
|
|
937
|
+
reset.addEventListener('click', function () {
|
|
938
|
+
state = { round: ANY, date: ANY, hardware: ANY, model: ANY, modelClass: ANY };
|
|
939
|
+
render();
|
|
940
|
+
});
|
|
941
|
+
window.addEventListener('popstate', function () {
|
|
942
|
+
state = readState();
|
|
943
|
+
render();
|
|
944
|
+
});
|
|
945
|
+
|
|
946
|
+
root.setAttribute('data-hb-scorecard-ready', '1');
|
|
947
|
+
render();
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
function start() {
|
|
951
|
+
var roots = document.querySelectorAll('[' + ATTR.root + ']');
|
|
952
|
+
for (var i = 0; i < roots.length; i++) enhance(roots[i]);
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
if (document.readyState === 'loading') {
|
|
956
|
+
document.addEventListener('DOMContentLoaded', start);
|
|
957
|
+
} else {
|
|
958
|
+
start();
|
|
959
|
+
}
|
|
960
|
+
})();
|
|
961
|
+
`;
|
|
962
|
+
|
|
963
|
+
// src/handboek-data-tables.ts
|
|
964
|
+
var DATA_TABLE_SCRIPT = "data-table.js";
|
|
965
|
+
var DATA_TABLE_ATTR = "data-hb-data-table";
|
|
966
|
+
var DATA_TABLE_FOLLOW_ATTR = "data-hb-data-table-follow";
|
|
967
|
+
function annotationParams(block) {
|
|
968
|
+
const heading = block.sourceHeading;
|
|
969
|
+
return heading?.templateAnnotation?.params;
|
|
970
|
+
}
|
|
971
|
+
function dataTableBlocks(blocks, found = []) {
|
|
972
|
+
for (const block of blocks ?? []) {
|
|
973
|
+
const src = annotationParams(block)?.src;
|
|
974
|
+
if (block.template === "dataTable" && src && isDataFilePath(src)) found.push(block);
|
|
975
|
+
dataTableBlocks(block.children, found);
|
|
976
|
+
}
|
|
977
|
+
return found;
|
|
978
|
+
}
|
|
979
|
+
function assetFile(contentDir, src) {
|
|
980
|
+
const candidate = src.replace(/^(\.\.?\/)+/, "");
|
|
981
|
+
if (!candidate.startsWith("assets/")) return null;
|
|
982
|
+
const root = resolve(contentDir, "assets");
|
|
983
|
+
const file = resolve(contentDir, candidate);
|
|
984
|
+
return file.startsWith(root + sep) ? file : null;
|
|
985
|
+
}
|
|
986
|
+
function selectColumns(data, columns) {
|
|
987
|
+
if (!columns || !data.headers || !data.rows) return { data, missing: [] };
|
|
988
|
+
const headers = data.headers;
|
|
989
|
+
const wanted = columns.split(",").map((name) => name.trim()).filter(Boolean);
|
|
990
|
+
const missing = wanted.filter((name) => !headers.includes(name));
|
|
991
|
+
const picks = wanted.filter((name) => headers.includes(name)).map((name) => headers.indexOf(name));
|
|
992
|
+
return {
|
|
993
|
+
data: {
|
|
994
|
+
...data,
|
|
995
|
+
headers: picks.map((i) => headers[i] ?? ""),
|
|
996
|
+
rows: data.rows.map((row2) => picks.map((i) => row2[i] ?? "")),
|
|
997
|
+
...data.align ? { align: picks.map((i) => data.align?.[i] ?? null) } : {}
|
|
998
|
+
},
|
|
999
|
+
missing
|
|
1000
|
+
};
|
|
709
1001
|
}
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
1002
|
+
function scorecardRowFacets(data) {
|
|
1003
|
+
const headers = data.headers ?? [];
|
|
1004
|
+
const round = headers.indexOf("run_id");
|
|
1005
|
+
const platform = headers.indexOf("platform");
|
|
1006
|
+
const model = headers.indexOf("model_id");
|
|
1007
|
+
const tier = headers.indexOf("tier");
|
|
1008
|
+
if (!data.rows || [round, platform, model, tier].some((index) => index < 0)) return null;
|
|
1009
|
+
return data.rows.map((row2) => [
|
|
1010
|
+
row2[round] ?? "",
|
|
1011
|
+
// The hardware key reads only the platform.
|
|
1012
|
+
scorecardHardwareKey({ platform: row2[platform] ?? "" }),
|
|
1013
|
+
scorecardModelFamilyId(row2[model] ?? ""),
|
|
1014
|
+
row2[tier] ?? ""
|
|
1015
|
+
]);
|
|
1016
|
+
}
|
|
1017
|
+
var scriptJson = (value) => JSON.stringify(value).replace(/</g, "\\u003c");
|
|
1018
|
+
async function dataTableMounts(doc, contentDir, warn = () => {
|
|
1019
|
+
}) {
|
|
1020
|
+
const mounts = [];
|
|
1021
|
+
const { startBlock: _cover, ...frame } = doc;
|
|
1022
|
+
for (const block of dataTableBlocks(doc.blocks)) {
|
|
1023
|
+
const params = annotationParams(block) ?? {};
|
|
1024
|
+
const src = params.src ?? "";
|
|
1025
|
+
const file = assetFile(contentDir, src);
|
|
1026
|
+
const bytes = file ? await readFile(file).catch(() => null) : null;
|
|
1027
|
+
if (!bytes) {
|
|
1028
|
+
warn(`data table "${block.title ?? block.id}": no published file at ${src}`);
|
|
1029
|
+
continue;
|
|
1030
|
+
}
|
|
1031
|
+
const container = new MemoryContentContainer();
|
|
1032
|
+
await container.writeFile(src, bytes);
|
|
1033
|
+
const { doc: resolved, diagnostics } = await resolveDataReferences(
|
|
1034
|
+
{ ...frame, blocks: [{ ...block, contents: [] }] },
|
|
1035
|
+
container,
|
|
1036
|
+
{ readers: defaultDataReaders() }
|
|
1037
|
+
);
|
|
1038
|
+
for (const issue of diagnostics) warn(`data table ${src}: ${issue.message}`);
|
|
1039
|
+
const table = resolved.blocks[0];
|
|
1040
|
+
const data = table?.templateData;
|
|
1041
|
+
if (!table || !data?.rows) continue;
|
|
1042
|
+
let facets;
|
|
1043
|
+
if (params.follow === "scorecard") {
|
|
1044
|
+
facets = scorecardRowFacets(data) ?? void 0;
|
|
1045
|
+
if (!facets) {
|
|
1046
|
+
warn(`data table ${src}: follow=scorecard needs run_id, platform, model_id, and tier`);
|
|
1047
|
+
}
|
|
1048
|
+
} else if (params.follow) {
|
|
1049
|
+
warn(`data table ${src}: nothing to follow called "${params.follow}"`);
|
|
1050
|
+
}
|
|
1051
|
+
const groupAt = params.group ? (data.headers ?? []).indexOf(params.group) : -1;
|
|
1052
|
+
const groups = groupAt >= 0 ? data.rows.map((row2) => row2[groupAt] ?? "") : void 0;
|
|
1053
|
+
if (params.group && !groups) warn(`data table ${src}: no column named ${params.group}`);
|
|
1054
|
+
const { data: shown, missing } = selectColumns(data, params.columns);
|
|
1055
|
+
if (missing.length > 0) warn(`data table ${src}: no column named ${missing.join(", ")}`);
|
|
1056
|
+
const payload = {
|
|
1057
|
+
doc: { ...resolved, blocks: [{ ...table, templateData: { ...data, ...shown } }] },
|
|
1058
|
+
...facets ? { facets } : {},
|
|
1059
|
+
...groups ? { groups } : {}
|
|
1060
|
+
};
|
|
1061
|
+
mounts.push({
|
|
1062
|
+
src,
|
|
1063
|
+
title: block.title ?? "",
|
|
1064
|
+
...facets ? { follow: "scorecard" } : {},
|
|
1065
|
+
html: `<div class="hb-data-table" ${DATA_TABLE_ATTR}><script type="application/json">${scriptJson(payload)}</script></div>`
|
|
1066
|
+
});
|
|
1067
|
+
}
|
|
1068
|
+
return mounts;
|
|
1069
|
+
}
|
|
1070
|
+
var escapeRegExp = (text) => text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1071
|
+
var escapeHtml = (text) => text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1072
|
+
function insertDataTables(body, mounts) {
|
|
1073
|
+
let html = body;
|
|
1074
|
+
for (const mount of mounts) {
|
|
1075
|
+
const file = escapeRegExp(mount.src.split("/").pop() ?? mount.src);
|
|
1076
|
+
const link2 = new RegExp(`<p>(?:(?!</p>)[\\s\\S])*?href="[^"]*${file}"[\\s\\S]*?</p>`).exec(
|
|
1077
|
+
html
|
|
1078
|
+
);
|
|
1079
|
+
const heading = new RegExp(`<h[23][^>]*>${escapeRegExp(escapeHtml(mount.title))}</h[23]>`).exec(
|
|
1080
|
+
html
|
|
1081
|
+
);
|
|
1082
|
+
const anchor = link2 ?? heading;
|
|
1083
|
+
const at = anchor ? anchor.index + anchor[0].length : html.length;
|
|
1084
|
+
const end = at + 1 + mount.html.length;
|
|
1085
|
+
html = `${html.slice(0, at)}
|
|
1086
|
+
${mount.html}${html.slice(at)}`;
|
|
1087
|
+
if (mount.follow && heading && heading.index < at) {
|
|
1088
|
+
html = `${html.slice(0, heading.index)}<section class="hb-data-table-section" ${DATA_TABLE_FOLLOW_ATTR}="${mount.follow}">${html.slice(heading.index, end)}</section>${html.slice(end)}`;
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
return html;
|
|
719
1092
|
}
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
.hb-more { margin: 0.4rem 0 0; font-size: 0.85rem; }
|
|
1093
|
+
var DATA_TABLE_LOGIC_JS = `
|
|
1094
|
+
var OPERATOR = /^(>=|<=|!=|!~|\\^~|\\$~|>|<|=|~)\\s*([\\s\\S]*)$/;
|
|
723
1095
|
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
1096
|
+
function numeric(text) {
|
|
1097
|
+
var value = String(text).trim();
|
|
1098
|
+
return /^-?(?:\\d+\\.?\\d*|\\.\\d+)$/.test(value) ? parseFloat(value) : null;
|
|
1099
|
+
}
|
|
727
1100
|
|
|
728
|
-
|
|
729
|
-
.
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
padding: 2.5rem 2.75rem 3rem;
|
|
736
|
-
color: var(--hb-ink-warm);
|
|
737
|
-
}
|
|
738
|
-
.hb-article h1, .hb-article h2, .hb-article h3,
|
|
739
|
-
.hb-article h4, .hb-article h5, .hb-article h6 {
|
|
740
|
-
font-family: var(--hb-font-display);
|
|
741
|
-
font-weight: 700;
|
|
742
|
-
line-height: 1.25;
|
|
743
|
-
color: var(--hb-ink-warm);
|
|
744
|
-
margin: 2rem 0 0.75rem;
|
|
745
|
-
}
|
|
746
|
-
.hb-article a { font-family: var(--hb-font-ui); }
|
|
747
|
-
.hb-article h1 { font-size: 2rem; margin-top: 0; }
|
|
748
|
-
.hb-article h2 {
|
|
749
|
-
font-size: 1.4rem;
|
|
750
|
-
padding-bottom: 0.3rem;
|
|
751
|
-
border-bottom: 1px solid var(--hb-border);
|
|
752
|
-
}
|
|
753
|
-
.hb-article h3 { font-size: 1.1rem; }
|
|
754
|
-
.hb-article p, .hb-article li { font-size: 1rem; }
|
|
755
|
-
.hb-article p { margin: 0 0 1rem; }
|
|
756
|
-
.hb-article ul, .hb-article ol { margin: 0 0 1rem; padding-left: 1.35rem; }
|
|
757
|
-
.hb-article li { margin: 0.3rem 0; }
|
|
758
|
-
.hb-article li > p { margin: 0; }
|
|
759
|
-
.hb-article img { max-width: 100%; height: auto; border-radius: var(--hb-radius-md); }
|
|
760
|
-
.hb-article hr { border: 0; border-top: 1px solid var(--hb-border); margin: 2rem 0; }
|
|
761
|
-
.hb-article blockquote {
|
|
762
|
-
margin: 0 0 1rem;
|
|
763
|
-
padding: 0.25rem 0 0.25rem 1rem;
|
|
764
|
-
border-left: 3px solid var(--hb-accent);
|
|
765
|
-
color: var(--hb-ink-muted);
|
|
766
|
-
}
|
|
767
|
-
.hb-article code {
|
|
768
|
-
font-family: var(--hb-font-mono);
|
|
769
|
-
font-size: 0.875em;
|
|
770
|
-
background: var(--hb-inset);
|
|
771
|
-
border-radius: var(--hb-radius-sm);
|
|
772
|
-
padding: 0.1em 0.35em;
|
|
773
|
-
}
|
|
774
|
-
.hb-article pre {
|
|
775
|
-
background: var(--hb-inset);
|
|
776
|
-
border: 1px solid var(--hb-border);
|
|
777
|
-
border-radius: var(--hb-radius-md);
|
|
778
|
-
padding: 0.9rem 1.1rem;
|
|
779
|
-
overflow-x: auto;
|
|
780
|
-
margin: 0 0 1rem;
|
|
781
|
-
}
|
|
782
|
-
.hb-article pre code { background: none; padding: 0; font-size: 0.85rem; }
|
|
1101
|
+
function parseFilter(text) {
|
|
1102
|
+
var raw = String(text || '').trim();
|
|
1103
|
+
if (!raw) return null;
|
|
1104
|
+
var match = OPERATOR.exec(raw);
|
|
1105
|
+
var value = (match ? match[2] : raw).trim();
|
|
1106
|
+
return { op: match ? match[1] : '~', value: value.toLowerCase(), num: numeric(value) };
|
|
1107
|
+
}
|
|
783
1108
|
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
.
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
.
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
of description, so white-space:nowrap would push the description off the
|
|
803
|
-
page and force a horizontal scroll to read every row.
|
|
1109
|
+
function cellMatches(cell, filter) {
|
|
1110
|
+
var text = String(cell).trim().toLowerCase();
|
|
1111
|
+
var num = numeric(text);
|
|
1112
|
+
var value = filter.value;
|
|
1113
|
+
var both = num !== null && filter.num !== null;
|
|
1114
|
+
switch (filter.op) {
|
|
1115
|
+
case '>': return both && num > filter.num;
|
|
1116
|
+
case '<': return both && num < filter.num;
|
|
1117
|
+
case '>=': return both && num >= filter.num;
|
|
1118
|
+
case '<=': return both && num <= filter.num;
|
|
1119
|
+
case '=': return value === '' ? text === '' : both ? num === filter.num : text === value;
|
|
1120
|
+
case '!=': return value === '' ? text !== '' : !(both ? num === filter.num : text === value);
|
|
1121
|
+
case '!~': return text.indexOf(value) === -1;
|
|
1122
|
+
case '^~': return text.slice(0, value.length) === value;
|
|
1123
|
+
case '$~': return value === '' || text.slice(-value.length) === value;
|
|
1124
|
+
default: return text.indexOf(value) !== -1;
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
804
1127
|
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
border: 1px solid var(--hb-border);
|
|
812
|
-
padding: 0.4rem 0.45rem;
|
|
813
|
-
text-align: left;
|
|
814
|
-
vertical-align: top;
|
|
815
|
-
overflow-wrap: break-word;
|
|
816
|
-
min-width: 3rem;
|
|
817
|
-
}
|
|
818
|
-
.hb-article th { background: var(--hb-inset); font-weight: 600; }
|
|
819
|
-
/* Keep the leading label column from collapsing to one word per line while
|
|
820
|
-
the description column takes the slack. */
|
|
821
|
-
.hb-article tbody td:first-child { min-width: 6rem; }
|
|
1128
|
+
function rowMatches(cells, filters) {
|
|
1129
|
+
for (var i = 0; i < filters.length; i++) {
|
|
1130
|
+
if (filters[i] && !cellMatches(cells[i] === undefined ? '' : cells[i], filters[i])) return false;
|
|
1131
|
+
}
|
|
1132
|
+
return true;
|
|
1133
|
+
}
|
|
822
1134
|
|
|
823
|
-
/*
|
|
1135
|
+
/* rows: [{ cells, index }]; dir: 1 ascending, -1 descending. */
|
|
1136
|
+
function sortRows(rows, col, dir) {
|
|
1137
|
+
return rows.slice().sort(function (a, b) {
|
|
1138
|
+
var x = String(a.cells[col] === undefined ? '' : a.cells[col]).trim();
|
|
1139
|
+
var y = String(b.cells[col] === undefined ? '' : b.cells[col]).trim();
|
|
1140
|
+
if (x === '' || y === '') {
|
|
1141
|
+
return x === y ? a.index - b.index : x === '' ? 1 : -1;
|
|
1142
|
+
}
|
|
1143
|
+
var nx = numeric(x);
|
|
1144
|
+
var ny = numeric(y);
|
|
1145
|
+
var order = nx !== null && ny !== null
|
|
1146
|
+
? nx - ny
|
|
1147
|
+
: x.localeCompare(y, undefined, { numeric: true, sensitivity: 'base' });
|
|
1148
|
+
return dir * order || a.index - b.index;
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1151
|
+
`;
|
|
1152
|
+
var DATA_TABLE_JS = `(function () {
|
|
1153
|
+
'use strict';
|
|
824
1154
|
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
.
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
}
|
|
843
|
-
.hb-scorecard-field {
|
|
844
|
-
display: flex;
|
|
845
|
-
flex-direction: column;
|
|
846
|
-
gap: 0.25rem;
|
|
847
|
-
min-width: 0;
|
|
848
|
-
/* Grows to share a row, but never to the whole bar: the round picker wraps
|
|
849
|
-
onto its own line inside the reading measure, and a full-width control
|
|
850
|
-
there reads as a search field rather than as one key of four. */
|
|
851
|
-
flex: 1 1 9rem;
|
|
852
|
-
max-width: 14rem;
|
|
853
|
-
}
|
|
854
|
-
.hb-scorecard-field-label {
|
|
855
|
-
font-family: var(--hb-font-ui);
|
|
856
|
-
font-size: 0.72rem;
|
|
857
|
-
letter-spacing: 0.06em;
|
|
858
|
-
text-transform: uppercase;
|
|
859
|
-
color: var(--hb-ink-muted);
|
|
860
|
-
}
|
|
861
|
-
/* Keys, not capsules: --radius-md inside a --radius-lg tray, matching the
|
|
862
|
-
app's choice-control recipe in docs/ux.md. */
|
|
863
|
-
.hb-scorecard-select {
|
|
864
|
-
font-family: var(--hb-font-ui);
|
|
865
|
-
font-size: 0.9rem;
|
|
866
|
-
color: var(--hb-ink-warm);
|
|
867
|
-
background: var(--hb-panel);
|
|
868
|
-
border: 1px solid var(--hb-border);
|
|
869
|
-
border-radius: var(--hb-radius-md);
|
|
870
|
-
padding: 0.35rem 0.5rem;
|
|
871
|
-
max-width: 100%;
|
|
872
|
-
}
|
|
873
|
-
.hb-scorecard-select:hover { border-color: var(--hb-ink-quiet); }
|
|
874
|
-
.hb-scorecard-reset {
|
|
875
|
-
font-family: var(--hb-font-ui);
|
|
876
|
-
font-size: 0.85rem;
|
|
877
|
-
color: var(--hb-ink-warm);
|
|
878
|
-
background: var(--hb-panel);
|
|
879
|
-
border: 1px solid var(--hb-border);
|
|
880
|
-
border-radius: var(--hb-radius-md);
|
|
881
|
-
padding: 0.4rem 0.7rem;
|
|
882
|
-
cursor: pointer;
|
|
883
|
-
}
|
|
884
|
-
.hb-scorecard-reset:hover { color: var(--hb-accent); border-color: var(--hb-accent); }
|
|
885
|
-
.hb-scorecard-status {
|
|
886
|
-
font-family: var(--hb-font-ui);
|
|
887
|
-
font-size: 0.85rem;
|
|
888
|
-
color: var(--hb-ink-muted);
|
|
889
|
-
margin: 0.55rem 0 0;
|
|
890
|
-
}
|
|
891
|
-
.hb-article .hb-scorecard-help {
|
|
892
|
-
font-family: var(--hb-font-ui);
|
|
893
|
-
font-size: 0.82rem;
|
|
894
|
-
color: var(--hb-ink-quiet);
|
|
895
|
-
margin: 0.15rem 0 0;
|
|
896
|
-
}
|
|
897
|
-
.hb-scorecard-round { margin: 1.75rem 0 0; }
|
|
898
|
-
.hb-article .hb-scorecard-round-title { font-size: 1.1rem; margin-top: 0; }
|
|
899
|
-
.hb-article .hb-scorecard-suite-title { font-size: 0.95rem; margin: 1.25rem 0 0.5rem; }
|
|
900
|
-
.hb-scorecard-stamp { font-size: 0.85rem; margin: 0 0 0.75rem; }
|
|
901
|
-
.hb-article .hb-scorecard-withheld,
|
|
902
|
-
.hb-article .hb-scorecard-memory-note,
|
|
903
|
-
.hb-article .hb-scorecard-taskcount {
|
|
904
|
-
font-size: 0.82rem;
|
|
905
|
-
color: var(--hb-ink-muted);
|
|
906
|
-
margin: 0 0 0.75rem;
|
|
907
|
-
}
|
|
1155
|
+
var ATTR = ${JSON.stringify(DATA_TABLE_ATTR)};
|
|
1156
|
+
var FOLLOW = ${JSON.stringify(DATA_TABLE_FOLLOW_ATTR)};
|
|
1157
|
+
var SCORECARD_ROOT = ${JSON.stringify(SCORECARD_DATA_ATTRS2.root)};
|
|
1158
|
+
var SCORECARD_CONTROLS = ${JSON.stringify(SCORECARD_DATA_ATTRS2.controls)};
|
|
1159
|
+
var VIEW_EVENT = ${JSON.stringify(SCORECARD_VIEW_EVENT)};
|
|
1160
|
+
var TABLE_EVENT = ${JSON.stringify(SCORECARD_TABLE_EVENT)};
|
|
1161
|
+
var HINT = 'Type to match text anywhere. Start with > < >= or <= to compare numbers, = or != for an exact value (alone: empty cells), !~ to leave a word out.';
|
|
1162
|
+
${DATA_TABLE_LOGIC_JS}
|
|
1163
|
+
/* A following table's section moves under its scorecard's pickers. */
|
|
1164
|
+
function place(host) {
|
|
1165
|
+
var section = host.closest ? host.closest('[' + FOLLOW + ']') : null;
|
|
1166
|
+
var root = section ? document.querySelector('[' + SCORECARD_ROOT + ']') : null;
|
|
1167
|
+
var controls = root ? root.querySelector('[' + SCORECARD_CONTROLS + ']') : null;
|
|
1168
|
+
if (!controls) return null;
|
|
1169
|
+
controls.parentNode.insertBefore(section, controls.nextSibling);
|
|
1170
|
+
return root;
|
|
1171
|
+
}
|
|
908
1172
|
|
|
909
|
-
|
|
1173
|
+
function whenTable(stage, done) {
|
|
1174
|
+
var found = stage.querySelector('table');
|
|
1175
|
+
if (found) return done(found);
|
|
1176
|
+
var finished = false;
|
|
1177
|
+
function finish(table) {
|
|
1178
|
+
if (finished) return;
|
|
1179
|
+
finished = true;
|
|
1180
|
+
observer.disconnect();
|
|
1181
|
+
done(table);
|
|
1182
|
+
}
|
|
1183
|
+
var observer = new MutationObserver(function () {
|
|
1184
|
+
var table = stage.querySelector('table');
|
|
1185
|
+
if (table) finish(table);
|
|
1186
|
+
});
|
|
1187
|
+
observer.observe(stage, { childList: true, subtree: true });
|
|
1188
|
+
setTimeout(function () {
|
|
1189
|
+
finish(stage.querySelector('table'));
|
|
1190
|
+
}, 10000);
|
|
1191
|
+
}
|
|
910
1192
|
|
|
911
|
-
|
|
912
|
-
.
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
.
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
1193
|
+
function setup(host) {
|
|
1194
|
+
var json = host.querySelector('script[type="application/json"]');
|
|
1195
|
+
if (!json || host.getAttribute(ATTR + '-ready') || typeof SquisqPlayer === 'undefined') return;
|
|
1196
|
+
host.setAttribute(ATTR + '-ready', '1');
|
|
1197
|
+
var payload = JSON.parse(json.textContent);
|
|
1198
|
+
var root = place(host);
|
|
1199
|
+
var stage = document.createElement('div');
|
|
1200
|
+
stage.className = 'hb-data-table-stage';
|
|
1201
|
+
host.appendChild(stage);
|
|
1202
|
+
SquisqPlayer.mount(stage, payload.doc, {
|
|
1203
|
+
mode: 'static',
|
|
1204
|
+
autoPlay: false,
|
|
1205
|
+
showCodeCopyButton: false
|
|
1206
|
+
});
|
|
1207
|
+
whenTable(stage, function (table) {
|
|
1208
|
+
if (!table) {
|
|
1209
|
+
// Never drawn in time: let whatever the player shows stand.
|
|
1210
|
+
stage.className = '';
|
|
1211
|
+
return;
|
|
1212
|
+
}
|
|
1213
|
+
var owned = table.cloneNode(true);
|
|
1214
|
+
SquisqPlayer.unmount(stage);
|
|
1215
|
+
host.removeChild(stage);
|
|
1216
|
+
enhance(host, owned, payload, root);
|
|
1217
|
+
});
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
function enhance(host, table, payload, root) {
|
|
1221
|
+
var body = table.tBodies[0];
|
|
1222
|
+
var heads = table.tHead ? table.tHead.rows[0].cells : [];
|
|
1223
|
+
var facets = payload.facets || null;
|
|
1224
|
+
var groups = payload.groups || null;
|
|
1225
|
+
var rows = [];
|
|
1226
|
+
for (var r = 0; body && r < body.rows.length; r++) {
|
|
1227
|
+
var tr = body.rows[r];
|
|
1228
|
+
var cells = [];
|
|
1229
|
+
for (var c = 0; c < tr.cells.length; c++) cells.push(tr.cells[c].textContent);
|
|
1230
|
+
rows.push({
|
|
1231
|
+
el: tr,
|
|
1232
|
+
cells: cells,
|
|
1233
|
+
index: r,
|
|
1234
|
+
facets: facets ? facets[r] : null,
|
|
1235
|
+
group: groups ? groups[r] : null
|
|
1236
|
+
});
|
|
1237
|
+
}
|
|
1238
|
+
var headings = {};
|
|
1239
|
+
var state = { col: -1, dir: 1, filters: [], view: root ? root.hbScorecardView || null : null };
|
|
1240
|
+
|
|
1241
|
+
var bar = document.createElement('div');
|
|
1242
|
+
bar.className = 'hb-data-table-bar';
|
|
1243
|
+
var status = document.createElement('p');
|
|
1244
|
+
status.className = 'hb-data-table-status';
|
|
1245
|
+
status.setAttribute('role', 'status');
|
|
1246
|
+
var clear = document.createElement('button');
|
|
1247
|
+
clear.type = 'button';
|
|
1248
|
+
clear.className = 'hb-data-table-clear';
|
|
1249
|
+
clear.textContent = 'Clear column filters';
|
|
1250
|
+
bar.appendChild(status);
|
|
1251
|
+
bar.appendChild(clear);
|
|
1252
|
+
var scroll = document.createElement('div');
|
|
1253
|
+
scroll.className = 'hb-data-table-scroll';
|
|
1254
|
+
scroll.appendChild(table);
|
|
1255
|
+
host.appendChild(bar);
|
|
1256
|
+
host.appendChild(scroll);
|
|
1257
|
+
|
|
1258
|
+
var inputs = [];
|
|
1259
|
+
for (var h = 0; h < heads.length; h++) header(h, heads[h]);
|
|
1260
|
+
|
|
1261
|
+
function header(col, th) {
|
|
1262
|
+
var name = th.textContent;
|
|
1263
|
+
th.textContent = '';
|
|
1264
|
+
var sort = document.createElement('button');
|
|
1265
|
+
sort.type = 'button';
|
|
1266
|
+
sort.className = 'hb-data-table-sort';
|
|
1267
|
+
sort.textContent = name;
|
|
1268
|
+
sort.title = 'Sort by ' + name;
|
|
1269
|
+
var input = document.createElement('input');
|
|
1270
|
+
input.type = 'search';
|
|
1271
|
+
input.className = 'hb-data-table-filter';
|
|
1272
|
+
input.placeholder = 'Filter';
|
|
1273
|
+
input.title = HINT;
|
|
1274
|
+
input.setAttribute('aria-label', 'Filter ' + name);
|
|
1275
|
+
input.setAttribute('autocomplete', 'off');
|
|
1276
|
+
input.spellcheck = false;
|
|
1277
|
+
th.appendChild(sort);
|
|
1278
|
+
th.appendChild(input);
|
|
1279
|
+
inputs.push(input);
|
|
1280
|
+
sort.addEventListener('click', function () {
|
|
1281
|
+
if (state.col !== col) {
|
|
1282
|
+
state.col = col;
|
|
1283
|
+
state.dir = 1;
|
|
1284
|
+
} else if (state.dir === 1) {
|
|
1285
|
+
state.dir = -1;
|
|
1286
|
+
} else {
|
|
1287
|
+
state.col = -1;
|
|
1288
|
+
}
|
|
1289
|
+
render();
|
|
1290
|
+
});
|
|
1291
|
+
input.addEventListener('input', function () {
|
|
1292
|
+
state.filters[col] = parseFilter(input.value);
|
|
1293
|
+
render();
|
|
1294
|
+
});
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
clear.addEventListener('click', function () {
|
|
1298
|
+
for (var i = 0; i < inputs.length; i++) inputs[i].value = '';
|
|
1299
|
+
state.filters = [];
|
|
1300
|
+
render();
|
|
1301
|
+
});
|
|
1302
|
+
if (root) {
|
|
1303
|
+
root.addEventListener(VIEW_EVENT, function (event) {
|
|
1304
|
+
state.view = event.detail;
|
|
1305
|
+
render();
|
|
1306
|
+
});
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
function inView(row) {
|
|
1310
|
+
var view = state.view;
|
|
1311
|
+
var f = row.facets;
|
|
1312
|
+
if (!view || !f) return true;
|
|
1313
|
+
return (
|
|
1314
|
+
view.rounds.indexOf(f[0]) !== -1 &&
|
|
1315
|
+
(!view.hardware || f[1] === view.hardware) &&
|
|
1316
|
+
(!view.model || f[2] === view.model) &&
|
|
1317
|
+
(!view.modelClass || f[3] === view.modelClass)
|
|
1318
|
+
);
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
/* One heading row per group, made the first time the group shows. */
|
|
1322
|
+
function heading(group) {
|
|
1323
|
+
if (!headings[group]) {
|
|
1324
|
+
var tr = document.createElement('tr');
|
|
1325
|
+
tr.className = 'hb-data-table-group';
|
|
1326
|
+
var th = document.createElement('th');
|
|
1327
|
+
th.scope = 'rowgroup';
|
|
1328
|
+
th.colSpan = heads.length || 1;
|
|
1329
|
+
var label = document.createElement('span');
|
|
1330
|
+
label.className = 'hb-data-table-group-label';
|
|
1331
|
+
th.appendChild(label);
|
|
1332
|
+
tr.appendChild(th);
|
|
1333
|
+
headings[group] = { el: tr, label: label };
|
|
1334
|
+
}
|
|
1335
|
+
return headings[group];
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
function render() {
|
|
1339
|
+
var order = state.col < 0 ? rows : sortRows(rows, state.col, state.dir);
|
|
1340
|
+
var grouped = !!groups && state.col < 0;
|
|
1341
|
+
var counts = {};
|
|
1342
|
+
var picked = 0;
|
|
1343
|
+
var shown = 0;
|
|
1344
|
+
for (var i = 0; i < order.length; i++) {
|
|
1345
|
+
var row = order[i];
|
|
1346
|
+
row.keep = inView(row);
|
|
1347
|
+
if (row.keep) picked++;
|
|
1348
|
+
row.keep = row.keep && rowMatches(row.cells, state.filters);
|
|
1349
|
+
if (row.keep) {
|
|
1350
|
+
shown++;
|
|
1351
|
+
counts[row.group] = (counts[row.group] || 0) + 1;
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
for (var key in headings) {
|
|
1355
|
+
if (headings[key].el.parentNode) body.removeChild(headings[key].el);
|
|
1356
|
+
}
|
|
1357
|
+
var current = null;
|
|
1358
|
+
for (var j = 0; j < order.length; j++) {
|
|
1359
|
+
var next = order[j];
|
|
1360
|
+
if (grouped && next.keep && next.group !== current) {
|
|
1361
|
+
current = next.group;
|
|
1362
|
+
var head = heading(current);
|
|
1363
|
+
head.label.textContent = current + ' \\u00b7 ' + counts[current] +
|
|
1364
|
+
(counts[current] === 1 ? ' result' : ' results');
|
|
1365
|
+
body.appendChild(head.el);
|
|
1366
|
+
}
|
|
1367
|
+
next.el.hidden = !next.keep;
|
|
1368
|
+
body.appendChild(next.el);
|
|
1369
|
+
}
|
|
1370
|
+
for (var h = 0; h < heads.length; h++) {
|
|
1371
|
+
if (h === state.col) heads[h].setAttribute('aria-sort', state.dir === 1 ? 'ascending' : 'descending');
|
|
1372
|
+
else heads[h].removeAttribute('aria-sort');
|
|
1373
|
+
}
|
|
1374
|
+
var filtering = false;
|
|
1375
|
+
for (var f = 0; f < state.filters.length; f++) if (state.filters[f]) filtering = true;
|
|
1376
|
+
clear.hidden = !filtering;
|
|
1377
|
+
status.textContent = shown === 0
|
|
1378
|
+
? 'No results match these filters.'
|
|
1379
|
+
: 'Showing ' + shown + ' of ' + picked + (picked === 1 ? ' result' : ' results') +
|
|
1380
|
+
(picked < rows.length ? ' in the rounds picked above (' + rows.length + ' in all).' : '.');
|
|
1381
|
+
|
|
1382
|
+
// Tell the scorecard which rounds the visible rows belong to, so its
|
|
1383
|
+
// round list names exactly the rounds behind what is on screen.
|
|
1384
|
+
if (root) {
|
|
1385
|
+
var seen = {};
|
|
1386
|
+
var reached = [];
|
|
1387
|
+
for (var v = 0; v < rows.length; v++) {
|
|
1388
|
+
var round = rows[v].facets ? rows[v].facets[0] : rows[v].group;
|
|
1389
|
+
if (rows[v].keep && round && !seen[round]) {
|
|
1390
|
+
seen[round] = true;
|
|
1391
|
+
reached.push(round);
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
root.dispatchEvent(new CustomEvent(TABLE_EVENT, {
|
|
1395
|
+
detail: { rounds: reached, filtering: filtering }
|
|
1396
|
+
}));
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
928
1399
|
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
display: block;
|
|
932
|
-
width: 160px;
|
|
933
|
-
height: 160px;
|
|
934
|
-
margin: 0 0 1.25rem;
|
|
935
|
-
border-radius: var(--hb-radius-md);
|
|
936
|
-
background: #e8dec7;
|
|
937
|
-
box-shadow: inset 0 0 0 1px rgba(74, 52, 30, 0.14);
|
|
938
|
-
}
|
|
939
|
-
.hb-article .hb-gallery {
|
|
940
|
-
list-style: none;
|
|
941
|
-
margin: 0 0 2rem;
|
|
942
|
-
padding: 0;
|
|
943
|
-
display: grid;
|
|
944
|
-
grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
|
|
945
|
-
gap: 0.75rem;
|
|
946
|
-
}
|
|
947
|
-
.hb-article .hb-gallery li { margin: 0; font-size: inherit; }
|
|
948
|
-
.hb-gallery a {
|
|
949
|
-
display: flex;
|
|
950
|
-
flex-direction: column;
|
|
951
|
-
gap: 0.35rem;
|
|
952
|
-
height: 100%;
|
|
953
|
-
padding: 0.75rem;
|
|
954
|
-
border: 1px solid var(--hb-border);
|
|
955
|
-
border-radius: var(--hb-radius-lg);
|
|
956
|
-
background: var(--hb-panel);
|
|
957
|
-
color: var(--hb-ink);
|
|
958
|
-
text-decoration: none;
|
|
959
|
-
box-shadow: var(--hb-shadow);
|
|
960
|
-
}
|
|
961
|
-
.hb-gallery a:hover { border-color: var(--hb-accent); }
|
|
962
|
-
.hb-gallery img {
|
|
963
|
-
width: 96px;
|
|
964
|
-
height: 96px;
|
|
965
|
-
border-radius: var(--hb-radius-md);
|
|
966
|
-
background: #e8dec7;
|
|
967
|
-
}
|
|
968
|
-
.hb-gallery-title { font-family: var(--hb-font-display); font-weight: 700; color: var(--hb-sage); }
|
|
969
|
-
.hb-gallery-summary { font-size: 0.85rem; line-height: 1.4; color: var(--hb-ink-muted); }
|
|
1400
|
+
render();
|
|
1401
|
+
}
|
|
970
1402
|
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
1403
|
+
function start() {
|
|
1404
|
+
var hosts = document.querySelectorAll('[' + ATTR + ']');
|
|
1405
|
+
for (var i = 0; i < hosts.length; i++) setup(hosts[i]);
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
if (document.readyState === 'loading') {
|
|
1409
|
+
document.addEventListener('DOMContentLoaded', start);
|
|
1410
|
+
} else {
|
|
1411
|
+
start();
|
|
1412
|
+
}
|
|
1413
|
+
})();
|
|
1414
|
+
`;
|
|
1415
|
+
|
|
1416
|
+
// src/handboek-og-cards.ts
|
|
1417
|
+
import { createHash as createHash3 } from "crypto";
|
|
1418
|
+
import { existsSync } from "fs";
|
|
1419
|
+
import { mkdir as mkdir3, readFile as readFile2, readdir, rm, writeFile as writeFile3 } from "fs/promises";
|
|
1420
|
+
import { dirname as dirname2, join as join4, relative as relative2, sep as sep2 } from "path";
|
|
1421
|
+
import { isOgRendererReady, renderOgCard } from "@bendyline/gezel-service/handboek";
|
|
1422
|
+
var MANIFEST = "manifest.json";
|
|
1423
|
+
function ogCardPath(id) {
|
|
1424
|
+
return `${id}.png`;
|
|
980
1425
|
}
|
|
981
|
-
|
|
982
|
-
|
|
1426
|
+
function specHash(plan) {
|
|
1427
|
+
return createHash3("sha256").update(plan.kicker).update("\n").update(plan.headline).digest("hex");
|
|
983
1428
|
}
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
1429
|
+
async function readManifest(dir) {
|
|
1430
|
+
const path = join4(dir, MANIFEST);
|
|
1431
|
+
if (!existsSync(path)) return { version: 1, cards: {} };
|
|
1432
|
+
try {
|
|
1433
|
+
const parsed = JSON.parse(await readFile2(path, "utf8"));
|
|
1434
|
+
if (!parsed || typeof parsed.cards !== "object") throw new Error("no `cards` object");
|
|
1435
|
+
return { version: 1, cards: parsed.cards };
|
|
1436
|
+
} catch {
|
|
1437
|
+
return { version: 1, cards: {} };
|
|
1438
|
+
}
|
|
991
1439
|
}
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
.
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1440
|
+
async function existingCardIds(dir) {
|
|
1441
|
+
const out = [];
|
|
1442
|
+
const walk = async (current) => {
|
|
1443
|
+
for (const item of await readdir(current, { withFileTypes: true })) {
|
|
1444
|
+
const full = join4(current, item.name);
|
|
1445
|
+
if (item.isDirectory()) await walk(full);
|
|
1446
|
+
else if (item.name.endsWith(".png")) {
|
|
1447
|
+
out.push(
|
|
1448
|
+
relative2(dir, full).split(sep2).join("/").replace(/\.png$/, "")
|
|
1449
|
+
);
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
};
|
|
1453
|
+
if (existsSync(dir)) await walk(dir);
|
|
1454
|
+
return out;
|
|
1455
|
+
}
|
|
1456
|
+
async function writeOgCards(opts) {
|
|
1457
|
+
const { home, dir, plans } = opts;
|
|
1458
|
+
if (!await isOgRendererReady(home)) {
|
|
1459
|
+
return {
|
|
1460
|
+
rendered: 0,
|
|
1461
|
+
reused: 0,
|
|
1462
|
+
swept: 0,
|
|
1463
|
+
failed: [],
|
|
1464
|
+
skipped: `managed Chromium is not installed under ${home} \u2014 launch the app once to let it download, then re-run`
|
|
1465
|
+
};
|
|
1466
|
+
}
|
|
1467
|
+
const manifest = await readManifest(dir);
|
|
1468
|
+
const next = { version: 1, cards: {} };
|
|
1469
|
+
const result = { rendered: 0, reused: 0, swept: 0, failed: [] };
|
|
1470
|
+
let done = 0;
|
|
1471
|
+
for (const plan of plans) {
|
|
1472
|
+
const hash = specHash(plan);
|
|
1473
|
+
const file = join4(dir, ...ogCardPath(plan.id).split("/"));
|
|
1474
|
+
if (manifest.cards[plan.id]?.specHash === hash && existsSync(file)) {
|
|
1475
|
+
next.cards[plan.id] = { specHash: hash };
|
|
1476
|
+
result.reused += 1;
|
|
1477
|
+
} else {
|
|
1478
|
+
try {
|
|
1479
|
+
const png = await renderOgCard(home, { kicker: plan.kicker, headline: plan.headline });
|
|
1480
|
+
await mkdir3(dirname2(file), { recursive: true });
|
|
1481
|
+
await writeFile3(file, png);
|
|
1482
|
+
next.cards[plan.id] = { specHash: hash };
|
|
1483
|
+
result.rendered += 1;
|
|
1484
|
+
} catch {
|
|
1485
|
+
result.failed.push(plan.id);
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
done += 1;
|
|
1489
|
+
opts.onProgress?.(done, plans.length);
|
|
1490
|
+
}
|
|
1491
|
+
const wanted = new Set(plans.map((p) => p.id));
|
|
1492
|
+
for (const id of await existingCardIds(dir)) {
|
|
1493
|
+
if (wanted.has(id)) continue;
|
|
1494
|
+
await rm(join4(dir, ...ogCardPath(id).split("/")), { force: true });
|
|
1495
|
+
result.swept += 1;
|
|
1496
|
+
}
|
|
1497
|
+
await mkdir3(dir, { recursive: true });
|
|
1498
|
+
await writeFile3(join4(dir, MANIFEST), `${JSON.stringify(next, null, 2)}
|
|
1499
|
+
`, "utf8");
|
|
1500
|
+
return result;
|
|
1007
1501
|
}
|
|
1008
|
-
.hb-cards a:hover { border-color: var(--hb-accent); text-decoration: none; }
|
|
1009
|
-
.hb-card-title { display: block; font-weight: 600; margin-bottom: 0.25rem; }
|
|
1010
|
-
.hb-card-summary { display: block; font-size: 0.9rem; color: var(--hb-ink-muted); }
|
|
1011
1502
|
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1503
|
+
// src/handboek-scorecard-rounds.ts
|
|
1504
|
+
import { SCORECARD as SCORECARD2 } from "@bendyline/gezel";
|
|
1505
|
+
import {
|
|
1506
|
+
renderScorecardRoundPages,
|
|
1507
|
+
scorecardRoundPageId as scorecardRoundPageId2
|
|
1508
|
+
} from "@bendyline/gezel-service/handboek";
|
|
1016
1509
|
|
|
1017
|
-
.
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1510
|
+
// src/handboek-site-catalog.ts
|
|
1511
|
+
import {
|
|
1512
|
+
CRAFTBOOK_CATEGORY_FAMILY_META,
|
|
1513
|
+
CRAFTBOOK_CATEGORY_META,
|
|
1514
|
+
SCORECARD,
|
|
1515
|
+
catalogGroundFor as catalogGroundFor2,
|
|
1516
|
+
measuredClaim,
|
|
1517
|
+
measuredResultFor,
|
|
1518
|
+
measuredRowsFor,
|
|
1519
|
+
plainRoleTitle as plainRoleTitle2,
|
|
1520
|
+
resolveCraftbookCategory,
|
|
1521
|
+
scorecardSpeeds
|
|
1522
|
+
} from "@bendyline/gezel";
|
|
1523
|
+
import { scorecardRoundPageId, scorecardRoundTitles } from "@bendyline/gezel-service/handboek";
|
|
1524
|
+
import { SCORECARD_SUITE_IDS, SCORECARD_SUITE_LABELS } from "@bendyline/gezel/eval";
|
|
1525
|
+
var CATALOG_COUNTS_FILE = "catalog-counts.json";
|
|
1526
|
+
var CRAFTBOOK_ART_FILE = "logo.webp";
|
|
1527
|
+
var MODEL_CATALOG_ID = "model-catalog";
|
|
1528
|
+
var TOOLSET_CATALOG_ID = "toolset-catalog";
|
|
1529
|
+
var ROLE_CATALOG_ID = "role-catalog";
|
|
1530
|
+
var MODELS_AND_TESTING = {
|
|
1531
|
+
id: "models-and-testing",
|
|
1532
|
+
title: "Models and Testing",
|
|
1533
|
+
order: 4
|
|
1534
|
+
};
|
|
1535
|
+
var HOW_GEZEL_WORKS = {
|
|
1536
|
+
id: "how-gezel-works",
|
|
1537
|
+
title: "How Gezel works",
|
|
1538
|
+
order: 1
|
|
1539
|
+
};
|
|
1540
|
+
var ENGINE_LABELS = [
|
|
1541
|
+
["llamaCpp", "llama.cpp"],
|
|
1542
|
+
["mlx", "MLX"],
|
|
1543
|
+
["ollama", "Ollama"],
|
|
1544
|
+
["ds4", "DwarfStar"]
|
|
1545
|
+
];
|
|
1546
|
+
var CATEGORY_LABELS = {
|
|
1547
|
+
general: "Everyday work",
|
|
1548
|
+
reasoning: "Reasoning",
|
|
1549
|
+
coding: "Coding"
|
|
1550
|
+
};
|
|
1551
|
+
async function buildSiteCatalog(catalog, scorecard = SCORECARD) {
|
|
1552
|
+
const manifests = async (kind) => (await catalog.list(kind)).map((s) => s.manifest);
|
|
1553
|
+
const chat = (await manifests("chat-model")).sort(
|
|
1554
|
+
(a, b) => (b.recoScore ?? -1) - (a.recoScore ?? -1) || a.name.localeCompare(b.name)
|
|
1555
|
+
);
|
|
1556
|
+
const images = (await manifests("image-model")).sort(byName);
|
|
1557
|
+
const videos = (await manifests("video-model")).sort(byName);
|
|
1558
|
+
const toolsets = await catalog.list("toolset");
|
|
1559
|
+
const addOns = toolsets.filter((s) => s.sourceId !== "community" && s.sourceId !== "builtin").map((s) => s.manifest).sort(byName);
|
|
1560
|
+
const communityCount = toolsets.filter((s) => s.sourceId === "community").length;
|
|
1561
|
+
const connectors = (await manifests("connector-type")).sort(byName);
|
|
1562
|
+
const roles = (await manifests("gezel-template")).sort(byName);
|
|
1563
|
+
const projectTypes = await manifests("project-type");
|
|
1564
|
+
const craftbooks = (await manifests("craftbook-template")).sort(
|
|
1565
|
+
byName
|
|
1566
|
+
);
|
|
1567
|
+
const craftbookArt = /* @__PURE__ */ new Map();
|
|
1568
|
+
for (const book of craftbooks) {
|
|
1569
|
+
if (book.logo !== CRAFTBOOK_ART_FILE) continue;
|
|
1570
|
+
const bytes = await catalog.readItemFile("craftbook-template", book.id, CRAFTBOOK_ART_FILE);
|
|
1571
|
+
if (!bytes) continue;
|
|
1572
|
+
const ground = catalogGroundFor2({
|
|
1573
|
+
kind: "craftbook-template",
|
|
1574
|
+
category: book.category,
|
|
1575
|
+
tags: book.tags
|
|
1576
|
+
});
|
|
1577
|
+
craftbookArt.set(book.id, { bytes, ground });
|
|
1578
|
+
}
|
|
1579
|
+
const roleAbouts = /* @__PURE__ */ new Map();
|
|
1580
|
+
for (const role of roles) {
|
|
1581
|
+
if (!role.about) continue;
|
|
1582
|
+
const bytes = await catalog.readItemFile(
|
|
1583
|
+
"gezel-template",
|
|
1584
|
+
role.id,
|
|
1585
|
+
role.about,
|
|
1586
|
+
void 0,
|
|
1587
|
+
role.version
|
|
1588
|
+
);
|
|
1589
|
+
if (bytes) roleAbouts.set(role.id, bytes.toString("utf8"));
|
|
1590
|
+
}
|
|
1591
|
+
const pages = [
|
|
1592
|
+
{
|
|
1593
|
+
entry: {
|
|
1594
|
+
id: MODEL_CATALOG_ID,
|
|
1595
|
+
title: "Every model",
|
|
1596
|
+
area: "technical",
|
|
1597
|
+
order: 14,
|
|
1598
|
+
summary: "Every AI model Gezel can run on your own computer, with size, context and license.",
|
|
1599
|
+
generated: true,
|
|
1600
|
+
subcategory: MODELS_AND_TESTING
|
|
1601
|
+
},
|
|
1602
|
+
markdown: modelCatalogMarkdown(chat, images, videos, scorecard),
|
|
1603
|
+
listed: true
|
|
1604
|
+
},
|
|
1605
|
+
...chat.map((m) => ({
|
|
1606
|
+
entry: {
|
|
1607
|
+
id: `model/${m.id}`,
|
|
1608
|
+
title: m.name,
|
|
1609
|
+
area: "technical",
|
|
1610
|
+
order: 100,
|
|
1611
|
+
summary: firstSentence2(m.description),
|
|
1612
|
+
generated: true,
|
|
1613
|
+
subcategory: MODELS_AND_TESTING
|
|
1614
|
+
},
|
|
1615
|
+
markdown: chatModelMarkdown(m, scorecard),
|
|
1616
|
+
listed: false
|
|
1617
|
+
})),
|
|
1618
|
+
{
|
|
1619
|
+
entry: {
|
|
1620
|
+
id: TOOLSET_CATALOG_ID,
|
|
1621
|
+
title: "Add-on toolsets and connectors",
|
|
1622
|
+
area: "technical",
|
|
1623
|
+
order: 4.5,
|
|
1624
|
+
summary: "Toolsets you can add to a gezel, and connectors that bring outside data into a project.",
|
|
1625
|
+
generated: true,
|
|
1626
|
+
subcategory: HOW_GEZEL_WORKS
|
|
1627
|
+
},
|
|
1628
|
+
markdown: toolsetCatalogMarkdown(addOns, connectors, communityCount),
|
|
1629
|
+
listed: true
|
|
1630
|
+
},
|
|
1631
|
+
{
|
|
1632
|
+
entry: {
|
|
1633
|
+
id: ROLE_CATALOG_ID,
|
|
1634
|
+
title: "Every role template",
|
|
1635
|
+
area: "gezel-roles",
|
|
1636
|
+
order: 1,
|
|
1637
|
+
summary: "Ready-made characters you can add to your crew, from researcher to meal planner.",
|
|
1638
|
+
generated: true
|
|
1639
|
+
},
|
|
1640
|
+
markdown: roleCatalogMarkdown(roles),
|
|
1641
|
+
listed: true
|
|
1642
|
+
},
|
|
1643
|
+
...roles.map((r) => ({
|
|
1644
|
+
entry: {
|
|
1645
|
+
id: `role-template/${r.id}`,
|
|
1646
|
+
title: r.name,
|
|
1647
|
+
area: "gezel-roles",
|
|
1648
|
+
order: 100,
|
|
1649
|
+
summary: firstSentence2(r.description),
|
|
1650
|
+
generated: true
|
|
1651
|
+
},
|
|
1652
|
+
markdown: roleTemplateMarkdown(r, roleAbouts.get(r.id)),
|
|
1653
|
+
listed: false
|
|
1654
|
+
})),
|
|
1655
|
+
{
|
|
1656
|
+
entry: {
|
|
1657
|
+
id: "craftbooks-index",
|
|
1658
|
+
title: "Every craftbook",
|
|
1659
|
+
area: "craftbooks",
|
|
1660
|
+
order: 0,
|
|
1661
|
+
generated: true
|
|
1662
|
+
},
|
|
1663
|
+
markdown: [
|
|
1664
|
+
"# Every craftbook",
|
|
1665
|
+
"",
|
|
1666
|
+
`Craftbooks are step-by-step plans your crew follows to produce a real piece of work. Each one names its steps, who runs them, and the checks the result must pass. There are ${craftbooks.length} of them, grouped here by the kind of work they do.`
|
|
1667
|
+
].join("\n"),
|
|
1668
|
+
html: craftbookGalleryHtml(craftbooks, craftbookArt),
|
|
1669
|
+
listed: false,
|
|
1670
|
+
replaces: true
|
|
1671
|
+
}
|
|
1672
|
+
];
|
|
1673
|
+
const demos = [];
|
|
1674
|
+
const roleById = new Map(roles.map((r) => [r.id, r.role]));
|
|
1675
|
+
for (const pt of projectTypes) {
|
|
1676
|
+
const demo = await projectTypeDemo(catalog, pt, roleById);
|
|
1677
|
+
if (demo) demos.push(demo);
|
|
1678
|
+
}
|
|
1679
|
+
const counts = {
|
|
1680
|
+
craftbooks: craftbooks.length,
|
|
1681
|
+
models: chat.length + images.length + videos.length,
|
|
1682
|
+
characters: roles.length,
|
|
1683
|
+
projectTypes: projectTypes.length,
|
|
1684
|
+
projectTypeDemos: demos.length,
|
|
1685
|
+
connectors: connectors.length
|
|
1686
|
+
};
|
|
1687
|
+
return { pages, demos, craftbookArt, counts };
|
|
1023
1688
|
}
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1689
|
+
function modelCatalogMarkdown(chat, images, videos, scorecard) {
|
|
1690
|
+
const lines = [
|
|
1691
|
+
"# Every model",
|
|
1692
|
+
"",
|
|
1693
|
+
"These are all the AI models in Gezel\u2019s catalog. Each one runs on your own computer through an engine Gezel installs for you, and Gezel recommends the ones that fit your hardware when you set it up. The [model scorecard](model-scorecard) shows how the models we test actually do on real jobs, and [Local models and tiers](local-models-and-tiers) explains how to choose.",
|
|
1694
|
+
"",
|
|
1695
|
+
`## Chat models (${chat.length})`,
|
|
1696
|
+
"",
|
|
1697
|
+
"The models your gezels think and write with, recommended first. **Measured** is the share of tasks the model (or another build of it) passed in its most recent full [scorecard](model-scorecard) round, preferring the general set, with the machine that round ran on. Follow it to every round on the model\u2019s page. Rounds are not comparable with each other, and a number from a workstation is not a promise about a laptop.",
|
|
1698
|
+
"",
|
|
1699
|
+
"| Model | Measured | Size | Context | Tools | Best for | Runs on | License |",
|
|
1700
|
+
"| --- | --- | --- | --- | --- | --- | --- | --- |",
|
|
1701
|
+
...chat.map(
|
|
1702
|
+
(m) => row([
|
|
1703
|
+
`[${cell(m.name)}](model/${m.id})`,
|
|
1704
|
+
measuredCell(scorecard, m.id),
|
|
1705
|
+
formatGB(m.approxSizeBytes),
|
|
1706
|
+
formatContext(m.contextWindow),
|
|
1707
|
+
m.supportsTools === false ? "No" : "Yes",
|
|
1708
|
+
CATEGORY_LABELS[m.category ?? ""] ?? "",
|
|
1709
|
+
engines(m).join(", "),
|
|
1710
|
+
cell(m.licenseShortName ?? m.license ?? "")
|
|
1711
|
+
])
|
|
1712
|
+
)
|
|
1713
|
+
];
|
|
1714
|
+
if (images.length > 0) {
|
|
1715
|
+
lines.push(
|
|
1716
|
+
"",
|
|
1717
|
+
`## Image models (${images.length})`,
|
|
1718
|
+
"",
|
|
1719
|
+
"Models your crew can use to draw pictures, icons and illustrations. Gezel works out what each one needs from its files and offers only the ones your machine can run.",
|
|
1720
|
+
"",
|
|
1721
|
+
"| Model | Size | Commercial use | License |",
|
|
1722
|
+
"| --- | --- | --- | --- |",
|
|
1723
|
+
...images.map(
|
|
1724
|
+
(m) => row([
|
|
1725
|
+
link(m.name, m.upstream),
|
|
1726
|
+
formatGB(m.approxSizeBytes),
|
|
1727
|
+
yesNo(m.commercialUse),
|
|
1728
|
+
cell(m.licenseShortName ?? m.license ?? "")
|
|
1729
|
+
])
|
|
1730
|
+
)
|
|
1731
|
+
);
|
|
1732
|
+
}
|
|
1733
|
+
if (videos.length > 0) {
|
|
1734
|
+
lines.push(
|
|
1735
|
+
"",
|
|
1736
|
+
`## Video models (${videos.length})`,
|
|
1737
|
+
"",
|
|
1738
|
+
"Models that turn a prompt or a picture into a short clip. Gezel works out what each one needs from its files and offers only the ones your machine can run.",
|
|
1739
|
+
"",
|
|
1740
|
+
"| Model | Size | Longest clip | Commercial use | License |",
|
|
1741
|
+
"| --- | --- | --- | --- | --- |",
|
|
1742
|
+
...videos.map(
|
|
1743
|
+
(m) => row([
|
|
1744
|
+
link(m.name, m.upstream),
|
|
1745
|
+
formatGB(m.approxSizeBytes),
|
|
1746
|
+
m.maxDurationSeconds ? `${m.maxDurationSeconds} s` : "",
|
|
1747
|
+
yesNo(m.commercialUse),
|
|
1748
|
+
cell(m.licenseShortName ?? m.license ?? "")
|
|
1749
|
+
])
|
|
1750
|
+
)
|
|
1751
|
+
);
|
|
1752
|
+
}
|
|
1753
|
+
return lines.join("\n");
|
|
1029
1754
|
}
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
.hb-hero h1 { font-size: 2rem; }
|
|
1755
|
+
function measuredCell(scorecard, modelId) {
|
|
1756
|
+
const measured = measuredResultFor(scorecard, modelId);
|
|
1757
|
+
if (!measured) return "Not yet";
|
|
1758
|
+
return `[${cell(measuredClaim(measured))}](model/${modelId}#measured-results)`;
|
|
1035
1759
|
}
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
return value === null ? '' : value;
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
|
-
function tokens(el, name) {
|
|
1065
|
-
var raw = attr(el, name).trim();
|
|
1066
|
-
return raw ? raw.split(/\\s+/) : [];
|
|
1760
|
+
var SCORECARD_ENGINE_LABELS = {
|
|
1761
|
+
"llama-cpp": "llama.cpp",
|
|
1762
|
+
mlx: "MLX",
|
|
1763
|
+
ollama: "Ollama",
|
|
1764
|
+
ds4: "DwarfStar"
|
|
1765
|
+
};
|
|
1766
|
+
var speed = (value) => value === void 0 ? "\u2014" : `${value.toFixed(1)} tok/s`;
|
|
1767
|
+
function measuredResultsMarkdown(scorecard, modelId) {
|
|
1768
|
+
const suiteOrder = (id) => {
|
|
1769
|
+
const index = SCORECARD_SUITE_IDS.indexOf(id);
|
|
1770
|
+
return index === -1 ? SCORECARD_SUITE_IDS.length : index;
|
|
1771
|
+
};
|
|
1772
|
+
const rows = measuredRowsFor(scorecard, modelId).sort(
|
|
1773
|
+
(a, b) => b.run.provenance.startedAt.localeCompare(a.run.provenance.startedAt) || a.run.id.localeCompare(b.run.id) || suiteOrder(a.result.suiteId) - suiteOrder(b.result.suiteId) || a.result.modelId.localeCompare(b.result.modelId)
|
|
1774
|
+
);
|
|
1775
|
+
const lines = ["## Measured results", ""];
|
|
1776
|
+
if (rows.length === 0) {
|
|
1777
|
+
lines.push(
|
|
1778
|
+
"Not measured yet. No [scorecard](model-scorecard) round has run this model or another build of it, which is not a verdict either way. [How we test models](how-we-test-models) explains what a round measures, and you can run the same tests on your own machine:",
|
|
1779
|
+
"",
|
|
1780
|
+
"```sh",
|
|
1781
|
+
`gezel bench --model ${modelId}`,
|
|
1782
|
+
"```"
|
|
1783
|
+
);
|
|
1784
|
+
return lines;
|
|
1067
1785
|
}
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1786
|
+
const titles = scorecardRoundTitles(scorecard.runs);
|
|
1787
|
+
lines.push(
|
|
1788
|
+
"Every [scorecard](model-scorecard) round that ran this model or another build of it, newest first. Each round is one machine, one day, one version of Gezel and one version of the tests, so **rounds are not comparable with each other**: a change to any of those can move a score without the model changing. Where a task ran fewer than three times, the result is a count rather than a percentage. [How we test models](how-we-test-models) explains what each set contains.",
|
|
1789
|
+
"",
|
|
1790
|
+
"| Round | Build | Task set | Passed | Output speed | Prefill speed |",
|
|
1791
|
+
"| --- | --- | --- | --- | --- | --- |",
|
|
1792
|
+
...rows.map(({ run, result, score }) => {
|
|
1793
|
+
const title = titles.get(run.id) ?? run.id;
|
|
1794
|
+
const partial = run.scope === "subset" ? " (partial)" : "";
|
|
1795
|
+
const speeds = scorecardSpeeds(result);
|
|
1796
|
+
const suite = SCORECARD_SUITE_LABELS[result.suiteId] ?? result.suiteId;
|
|
1797
|
+
return row([
|
|
1798
|
+
`[${cell(title)}](${scorecardRoundPageId(run.id)})${partial}`,
|
|
1799
|
+
cell(`${result.modelId} \xB7 ${SCORECARD_ENGINE_LABELS[result.engine] ?? result.engine}`),
|
|
1800
|
+
cell(suite),
|
|
1801
|
+
cell(score.claim),
|
|
1802
|
+
speed(speeds.decode),
|
|
1803
|
+
`${speed(speeds.prefill)}${speeds.prefillObserved ? " (observed)" : ""}`
|
|
1804
|
+
]);
|
|
1805
|
+
})
|
|
1806
|
+
);
|
|
1807
|
+
if (rows.some(({ run }) => run.scope === "subset")) {
|
|
1808
|
+
lines.push(
|
|
1809
|
+
"",
|
|
1810
|
+
"A partial round reran only some of a set\u2019s tasks, usually to check a fix. It is not a score for the whole set."
|
|
1811
|
+
);
|
|
1079
1812
|
}
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
var el = nodes[i];
|
|
1086
|
-
rounds.push({
|
|
1087
|
-
el: el,
|
|
1088
|
-
id: attr(el, ATTR.round),
|
|
1089
|
-
label: attr(el, ATTR.roundLabel) || attr(el, ATTR.date),
|
|
1090
|
-
date: attr(el, ATTR.date),
|
|
1091
|
-
hardware: attr(el, ATTR.hardware),
|
|
1092
|
-
hardwareLabel: attr(el, ATTR.hardwareLabel) || attr(el, ATTR.hardware),
|
|
1093
|
-
models: tokens(el, ATTR.models),
|
|
1094
|
-
tiers: tokens(el, ATTR.tiers),
|
|
1095
|
-
latest: el.hasAttribute(ATTR.latest)
|
|
1096
|
-
});
|
|
1097
|
-
}
|
|
1098
|
-
return rounds;
|
|
1813
|
+
if (rows.some(({ result }) => scorecardSpeeds(result).prefillObserved)) {
|
|
1814
|
+
lines.push(
|
|
1815
|
+
"",
|
|
1816
|
+
"Observed prefill summarizes partial chat-event rates within each trial. It is not the aggregate throughput of every request or a measurement of pure prefill time; see the round for coverage and method."
|
|
1817
|
+
);
|
|
1099
1818
|
}
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1819
|
+
return lines;
|
|
1820
|
+
}
|
|
1821
|
+
function chatModelMarkdown(m, scorecard) {
|
|
1822
|
+
const maker = m.maker?.name ?? m.maintainer?.name;
|
|
1823
|
+
const facts = [
|
|
1824
|
+
["Made by", maker ?? ""],
|
|
1825
|
+
["Download size", formatGB(m.approxSizeBytes)],
|
|
1826
|
+
["Parameters", m.parameterSize ?? ""],
|
|
1827
|
+
["Quantization", quantization(m)],
|
|
1828
|
+
["Context window", m.contextWindow ? `${formatContext(m.contextWindow)} tokens` : ""],
|
|
1829
|
+
["Uses tools", m.supportsTools === false ? "No" : "Yes"],
|
|
1830
|
+
["Best for", CATEGORY_LABELS[m.category ?? ""] ?? ""],
|
|
1831
|
+
["Runs on", engines(m).join(", ")],
|
|
1832
|
+
["License", m.licenseShortName ?? m.license ?? ""],
|
|
1833
|
+
["Added to the catalog", m.releasedAt ? m.releasedAt.slice(0, 10) : ""]
|
|
1834
|
+
];
|
|
1835
|
+
const lines = [
|
|
1836
|
+
`# ${m.name}`,
|
|
1837
|
+
"",
|
|
1838
|
+
m.description.trim(),
|
|
1839
|
+
"",
|
|
1840
|
+
"| At a glance | |",
|
|
1841
|
+
"| --- | --- |",
|
|
1842
|
+
...facts.filter(([, v]) => v).map(([k, v]) => row([k, cell(v)])),
|
|
1843
|
+
"",
|
|
1844
|
+
"Gezel downloads this model the first time a gezel needs it, checks the file against its published hash, and applies tuned settings for it.",
|
|
1845
|
+
"",
|
|
1846
|
+
...measuredResultsMarkdown(scorecard, m.id)
|
|
1847
|
+
];
|
|
1848
|
+
const more = [
|
|
1849
|
+
m.upstream ? `[The model\u2019s own page](${m.upstream})` : "",
|
|
1850
|
+
"[Every model](model-catalog)",
|
|
1851
|
+
"[Model scorecard](model-scorecard)"
|
|
1852
|
+
].filter(Boolean);
|
|
1853
|
+
lines.push("", more.join(" \xB7 "));
|
|
1854
|
+
return lines.join("\n");
|
|
1855
|
+
}
|
|
1856
|
+
function toolsetCatalogMarkdown(addOns, connectors, communityCount) {
|
|
1857
|
+
const lines = [
|
|
1858
|
+
"# Add-on toolsets and connectors",
|
|
1859
|
+
"",
|
|
1860
|
+
"Every gezel starts with the built-in tool groups that fit its role, described in [Tools and toolsets](tools-and-toolsets). This page lists what you can add on top."
|
|
1861
|
+
];
|
|
1862
|
+
if (addOns.length > 0) {
|
|
1863
|
+
lines.push(
|
|
1864
|
+
"",
|
|
1865
|
+
"## Add-on toolsets",
|
|
1866
|
+
"",
|
|
1867
|
+
"Extra tools from Gezel\u2019s own catalog. Add one to a gezel from its Toolsets tab.",
|
|
1868
|
+
"",
|
|
1869
|
+
"| Toolset | What it does |",
|
|
1870
|
+
"| --- | --- |",
|
|
1871
|
+
...addOns.map((t) => row([cell(t.name), cell(firstSentence2(t.description) ?? "")]))
|
|
1872
|
+
);
|
|
1120
1873
|
}
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
};
|
|
1874
|
+
if (connectors.length > 0) {
|
|
1875
|
+
lines.push(
|
|
1876
|
+
"",
|
|
1877
|
+
"## Connectors",
|
|
1878
|
+
"",
|
|
1879
|
+
"Connectors copy data from outside services, such as mail, calendars and issue trackers, into a project as searchable files. Your crew works on that local copy, never on the live account.",
|
|
1880
|
+
"",
|
|
1881
|
+
"| Connector | What it brings in |",
|
|
1882
|
+
"| --- | --- |",
|
|
1883
|
+
...connectors.map((c) => row([cell(c.name), cell(firstSentence2(c.description) ?? "")]))
|
|
1884
|
+
);
|
|
1133
1885
|
}
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1886
|
+
if (communityCount > 0) {
|
|
1887
|
+
lines.push(
|
|
1888
|
+
"",
|
|
1889
|
+
"## Community servers",
|
|
1890
|
+
"",
|
|
1891
|
+
`Gezel\u2019s toolset browser also lists about ${roundDown(communityCount).toLocaleString("en-US")} MCP servers from the public community registry, marked **Community**. They are third-party projects, so review one before you add it to a crew. You can also bring your own: see [Custom MCP toolsets](tools-and-toolsets#custom-mcp-toolsets).`
|
|
1892
|
+
);
|
|
1137
1893
|
}
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
}
|
|
1158
|
-
return narrowed(state) ? rounds : latest(rounds);
|
|
1894
|
+
return lines.join("\n");
|
|
1895
|
+
}
|
|
1896
|
+
function roleCatalogMarkdown(roles) {
|
|
1897
|
+
return [
|
|
1898
|
+
"# Every role template",
|
|
1899
|
+
"",
|
|
1900
|
+
"A role template is a ready-made character for your crew: a name, a job, and a working style that shapes how they think and talk. The Meester picks from these when it builds a crew, and you can add any of them yourself with **New Gezel**. The core roles each have their own page in [Roles](roles-index).",
|
|
1901
|
+
"",
|
|
1902
|
+
"| Role | What they do |",
|
|
1903
|
+
"| --- | --- |",
|
|
1904
|
+
...roles.map(
|
|
1905
|
+
(r) => row([`[${cell(r.name)}](role-template/${r.id})`, cell(firstSentence2(r.description) ?? "")])
|
|
1906
|
+
)
|
|
1907
|
+
].join("\n");
|
|
1908
|
+
}
|
|
1909
|
+
function roleTemplateMarkdown(r, about) {
|
|
1910
|
+
const lines = [`# ${r.name}`, "", r.description.trim()];
|
|
1911
|
+
if (r.meesterCandidate) {
|
|
1912
|
+
lines.push("", "This character can also act as your Meester, the gezel who runs the crew.");
|
|
1159
1913
|
}
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1914
|
+
if (about?.trim()) {
|
|
1915
|
+
lines.push(
|
|
1916
|
+
"",
|
|
1917
|
+
"## How they work",
|
|
1918
|
+
"",
|
|
1919
|
+
"This is the character brief Gezel gives the model, word for word. It shapes how this gezel thinks, works and talks.",
|
|
1920
|
+
"",
|
|
1921
|
+
demoteHeadings(about.trim())
|
|
1922
|
+
);
|
|
1167
1923
|
}
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1924
|
+
lines.push("", "[Every role template](role-catalog) \xB7 [Roles](roles-index)");
|
|
1925
|
+
return lines.join("\n");
|
|
1926
|
+
}
|
|
1927
|
+
function demoteHeadings(markdown) {
|
|
1928
|
+
return markdown.replace(
|
|
1929
|
+
/^(#{1,4})(\s)/gm,
|
|
1930
|
+
(_, hashes, space) => `${"#".repeat(Math.min(hashes.length + 2, 6))}${space}`
|
|
1931
|
+
);
|
|
1932
|
+
}
|
|
1933
|
+
function craftbookGalleryHtml(books, art) {
|
|
1934
|
+
const groups = /* @__PURE__ */ new Map();
|
|
1935
|
+
for (const book of books) {
|
|
1936
|
+
const category = resolveCraftbookCategory(book);
|
|
1937
|
+
const index = CRAFTBOOK_CATEGORY_META.findIndex((item) => item.id === category);
|
|
1938
|
+
const meta = CRAFTBOOK_CATEGORY_META[index] ?? CRAFTBOOK_CATEGORY_META.at(-1);
|
|
1939
|
+
const family = CRAFTBOOK_CATEGORY_FAMILY_META.find((f) => f.id === meta.family);
|
|
1940
|
+
const title = meta.family === "universal" || !family ? meta.label : `${family.label} \xB7 ${meta.label}`;
|
|
1941
|
+
const group = groups.get(meta.id) ?? {
|
|
1942
|
+
title,
|
|
1943
|
+
order: index < 0 ? CRAFTBOOK_CATEGORY_META.length : index,
|
|
1944
|
+
books: []
|
|
1945
|
+
};
|
|
1946
|
+
group.books.push(book);
|
|
1947
|
+
groups.set(meta.id, group);
|
|
1180
1948
|
}
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
if (
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1949
|
+
return [...groups.values()].sort((a, b) => a.order - b.order || a.title.localeCompare(b.title)).map(
|
|
1950
|
+
(group) => `<section class="hb-gallery-group">
|
|
1951
|
+
<h2>${escHtml(group.title)}</h2>
|
|
1952
|
+
<ul class="hb-gallery">
|
|
1953
|
+
${group.books.map((book) => {
|
|
1954
|
+
const href = `../craftbook/${encodeURIComponent(book.id)}/`;
|
|
1955
|
+
const mark2 = art.get(book.id);
|
|
1956
|
+
const img = mark2 ? `<img src="${href}${CRAFTBOOK_ART_FILE}" alt=""${groundAttr(mark2.ground)} width="96" height="96" loading="lazy" decoding="async">` : "";
|
|
1957
|
+
return `<li><a href="${href}">${img}<span class="hb-gallery-title">${escHtml(book.name)}</span><span class="hb-gallery-summary">${escHtml(clip(firstSentence2(book.description) ?? "", 110))}</span></a></li>`;
|
|
1958
|
+
}).join("\n")}
|
|
1959
|
+
</ul>
|
|
1960
|
+
</section>`
|
|
1961
|
+
).join("\n");
|
|
1962
|
+
}
|
|
1963
|
+
function craftbookArtHtml(title, ground) {
|
|
1964
|
+
return `<img class="hb-craftbook-art" src="${CRAFTBOOK_ART_FILE}" alt="${escHtml(title)} illustration"${groundAttr(ground)} width="160" height="160" decoding="async">`;
|
|
1965
|
+
}
|
|
1966
|
+
function groundAttr(ground) {
|
|
1967
|
+
return ground ? ` data-ground="${ground}"` : "";
|
|
1968
|
+
}
|
|
1969
|
+
function insertAfterTitle(body, html) {
|
|
1970
|
+
const end = body.indexOf("</h1>");
|
|
1971
|
+
if (end === -1) return `${html}
|
|
1972
|
+
${body}`;
|
|
1973
|
+
const at = end + "</h1>".length;
|
|
1974
|
+
return `${body.slice(0, at)}
|
|
1975
|
+
${html}${body.slice(at)}`;
|
|
1976
|
+
}
|
|
1977
|
+
function escHtml(s) {
|
|
1978
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1979
|
+
}
|
|
1980
|
+
async function projectTypeDemo(catalog, pt, roleById) {
|
|
1981
|
+
const entry = safeRelativePath(pt.pages?.entry);
|
|
1982
|
+
if (!entry) return null;
|
|
1983
|
+
const prefix = `versions/${pt.version}/pages/`;
|
|
1984
|
+
const paths = (await catalog.listItemFiles("project-type", pt.id)).map((p) => p.replaceAll("\\", "/")).filter((p) => p.startsWith(prefix)).map((p) => p.slice(prefix.length)).filter((p) => safeRelativePath(p) !== void 0);
|
|
1985
|
+
if (!paths.includes(entry)) return null;
|
|
1986
|
+
const files = [];
|
|
1987
|
+
for (const path of paths) {
|
|
1988
|
+
const bytes = await catalog.readItemFile("project-type", pt.id, `${prefix}${path}`);
|
|
1989
|
+
if (bytes) files.push({ path, bytes });
|
|
1990
|
+
}
|
|
1991
|
+
const lead = pt.gezels?.find((g) => g.voorman) ?? pt.gezels?.[0];
|
|
1992
|
+
const role = lead && roleById.get(lead.templateId);
|
|
1993
|
+
return {
|
|
1994
|
+
projectTypeId: pt.id,
|
|
1995
|
+
entry,
|
|
1996
|
+
files,
|
|
1997
|
+
imports: pt.pages?.imports,
|
|
1998
|
+
...role ? { companion: { role: plainRoleTitle2(role) } } : {}
|
|
1999
|
+
};
|
|
2000
|
+
}
|
|
2001
|
+
function demoSectionHtml(demo, title, appsPage) {
|
|
2002
|
+
const src = `demo/${demo.entry.split("/").map(encodeURIComponent).join("/")}`;
|
|
2003
|
+
const esc3 = (s) => s.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<");
|
|
2004
|
+
const library = appsPage ? `<a href="${esc3(appsPage)}">See it full size, with its companion, in the apps library</a> \xB7 ` : "";
|
|
2005
|
+
return `<section class="hb-demo">
|
|
2006
|
+
<h2>Try it</h2>
|
|
2007
|
+
<p>This is the project\u2019s page running on sample data in your browser. It doesn\u2019t connect to Gezel or to your files.</p>
|
|
2008
|
+
<div class="hb-demo-frame"><iframe src="${src}" title="${esc3(title)} demo" loading="lazy" sandbox="allow-forms allow-modals allow-scripts" referrerpolicy="no-referrer"></iframe></div>
|
|
2009
|
+
<p class="hb-demo-open">${library}<a href="${src}" target="_blank" rel="noreferrer">Open the demo in a new tab</a></p>
|
|
2010
|
+
</section>`;
|
|
2011
|
+
}
|
|
2012
|
+
function insertDemoSection(body, section) {
|
|
2013
|
+
const firstParagraphEnd = body.indexOf("</p>");
|
|
2014
|
+
if (firstParagraphEnd === -1) return `${body}
|
|
2015
|
+
${section}`;
|
|
2016
|
+
const at = firstParagraphEnd + "</p>".length;
|
|
2017
|
+
return `${body.slice(0, at)}
|
|
2018
|
+
${section}${body.slice(at)}`;
|
|
2019
|
+
}
|
|
2020
|
+
function safeRelativePath(value) {
|
|
2021
|
+
if (typeof value !== "string") return void 0;
|
|
2022
|
+
const normalized = value.replaceAll("\\", "/").replace(/^\.\//, "");
|
|
2023
|
+
const segments = normalized.split("/");
|
|
2024
|
+
if (!normalized || normalized.startsWith("/") || segments.some((s) => !s || s === "..")) {
|
|
2025
|
+
return void 0;
|
|
1225
2026
|
}
|
|
2027
|
+
return normalized;
|
|
2028
|
+
}
|
|
2029
|
+
function byName(a, b) {
|
|
2030
|
+
return a.name.localeCompare(b.name);
|
|
2031
|
+
}
|
|
2032
|
+
function engines(m) {
|
|
2033
|
+
return ENGINE_LABELS.filter(([key]) => m[key] !== void 0).map(([, label]) => label);
|
|
2034
|
+
}
|
|
2035
|
+
function quantization(m) {
|
|
2036
|
+
const blocks = [m.llamaCpp, m.mlx, m.ds4];
|
|
2037
|
+
return blocks.find((b) => b?.quantization)?.quantization ?? "";
|
|
2038
|
+
}
|
|
2039
|
+
function firstSentence2(text) {
|
|
2040
|
+
const s = text?.trim().split(/\.\s/)[0]?.replace(/\.$/, "").trim();
|
|
2041
|
+
return s ? `${s}.` : void 0;
|
|
2042
|
+
}
|
|
2043
|
+
function clip(text, max) {
|
|
2044
|
+
if (text.length <= max) return text;
|
|
2045
|
+
const cut = text.slice(0, max);
|
|
2046
|
+
const space = cut.lastIndexOf(" ");
|
|
2047
|
+
return `${(space > max * 0.6 ? cut.slice(0, space) : cut).replace(/[\s,;:—–-]+$/, "")}\u2026`;
|
|
2048
|
+
}
|
|
2049
|
+
function formatGB(bytes) {
|
|
2050
|
+
if (typeof bytes !== "number" || !Number.isFinite(bytes) || bytes <= 0) return "";
|
|
2051
|
+
return `${(bytes / 1e9).toFixed(1)} GB`;
|
|
2052
|
+
}
|
|
2053
|
+
function formatContext(tokens) {
|
|
2054
|
+
if (typeof tokens !== "number" || !Number.isFinite(tokens) || tokens <= 0) return "";
|
|
2055
|
+
return tokens >= 1e3 ? `${Math.round(tokens / 1e3)}K` : String(tokens);
|
|
2056
|
+
}
|
|
2057
|
+
function yesNo(value) {
|
|
2058
|
+
return value === void 0 ? "" : value ? "Yes" : "No";
|
|
2059
|
+
}
|
|
2060
|
+
function roundDown(n) {
|
|
2061
|
+
return n >= 1e3 ? Math.floor(n / 100) * 100 : n;
|
|
2062
|
+
}
|
|
2063
|
+
function link(text, url) {
|
|
2064
|
+
return url && /^https?:\/\//.test(url) ? `[${cell(text)}](${url})` : cell(text);
|
|
2065
|
+
}
|
|
2066
|
+
function cell(text) {
|
|
2067
|
+
return text.replace(/\|/g, "\\|").replace(/\s*\n\s*/g, " ").trim();
|
|
2068
|
+
}
|
|
2069
|
+
function row(cells) {
|
|
2070
|
+
return `| ${cells.join(" | ")} |`;
|
|
2071
|
+
}
|
|
1226
2072
|
|
|
1227
|
-
|
|
2073
|
+
// src/handboek-scorecard-rounds.ts
|
|
2074
|
+
function scorecardRoundSitePages(notes) {
|
|
2075
|
+
const pages = renderScorecardRoundPages(SCORECARD2);
|
|
2076
|
+
const titles = new Map(pages.map((page) => [page.runId, page.title]));
|
|
2077
|
+
return pages.map((page) => {
|
|
2078
|
+
const covering = notes.filter((note) => note.runs.includes(page.runId));
|
|
2079
|
+
const markdown = [
|
|
2080
|
+
`# ${page.title}`,
|
|
2081
|
+
"",
|
|
2082
|
+
`${page.summary} Every round is listed in the [model scorecard](../model-scorecard.md), with its results side by side in one table.`,
|
|
2083
|
+
"",
|
|
2084
|
+
page.html,
|
|
2085
|
+
...covering.flatMap((note) => {
|
|
2086
|
+
const siblings = note.runs.filter((id) => id !== page.runId && titles.has(id));
|
|
2087
|
+
return [
|
|
2088
|
+
"",
|
|
2089
|
+
`## ${note.title}`,
|
|
2090
|
+
"",
|
|
2091
|
+
...siblings.length > 0 ? [
|
|
2092
|
+
`This note also covers ${siblings.map((id) => `[${titles.get(id)}](../${id}/)`).join(", ")}.`,
|
|
2093
|
+
""
|
|
2094
|
+
] : [],
|
|
2095
|
+
note.body
|
|
2096
|
+
];
|
|
2097
|
+
}),
|
|
2098
|
+
""
|
|
2099
|
+
].join("\n");
|
|
2100
|
+
return {
|
|
2101
|
+
entry: {
|
|
2102
|
+
id: scorecardRoundPageId2(page.runId),
|
|
2103
|
+
title: page.title,
|
|
2104
|
+
area: "technical",
|
|
2105
|
+
order: 200,
|
|
2106
|
+
summary: page.summary,
|
|
2107
|
+
generated: true,
|
|
2108
|
+
subcategory: MODELS_AND_TESTING
|
|
2109
|
+
},
|
|
2110
|
+
markdown,
|
|
2111
|
+
listed: false
|
|
2112
|
+
};
|
|
2113
|
+
});
|
|
2114
|
+
}
|
|
1228
2115
|
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
}
|
|
2116
|
+
// src/handboek-site-css.ts
|
|
2117
|
+
import { CATALOG_GROUND_TONES } from "@bendyline/gezel";
|
|
2118
|
+
var SITE_GROUND_COLORS = {
|
|
2119
|
+
indigo: { light: "#4f5d7e", dark: "#3e4961" },
|
|
2120
|
+
slate: { light: "#6f8aa0", dark: "#576b7b" },
|
|
2121
|
+
teal: { light: "#5f8a86", dark: "#4b6b67" },
|
|
2122
|
+
sage: { light: "#8a9a76", dark: "#6b775b" },
|
|
2123
|
+
forest: { light: "#4f6249", dark: "#3e4c39" },
|
|
2124
|
+
ochre: { light: "#c49a45", dark: "#977736" },
|
|
2125
|
+
terracotta: { light: "#b0724c", dark: "#88593b" },
|
|
2126
|
+
rose: { light: "#c08a86", dark: "#946b67" },
|
|
2127
|
+
plum: { light: "#7d6378", dark: "#614d5d" }
|
|
2128
|
+
};
|
|
2129
|
+
var groundTokens = (scheme, indent) => CATALOG_GROUND_TONES.map(
|
|
2130
|
+
(tone) => `${indent}--hb-ground-${tone}: ${SITE_GROUND_COLORS[tone][scheme]};`
|
|
2131
|
+
).join("\n");
|
|
2132
|
+
var groundRules = CATALOG_GROUND_TONES.map(
|
|
2133
|
+
(tone) => `[data-ground="${tone}"] { --hb-mark-ground: var(--hb-ground-${tone}); }`
|
|
2134
|
+
).join("\n");
|
|
2135
|
+
var BASELINE_CSS = `:root {
|
|
2136
|
+
--hb-canvas: #eae5d6;
|
|
2137
|
+
--hb-panel: #f3eddf;
|
|
2138
|
+
--hb-reading: #f1e9e1;
|
|
2139
|
+
--hb-inset: #ddd3bd;
|
|
2140
|
+
--hb-ink: #1c1c1c;
|
|
2141
|
+
--hb-ink-warm: #2a2520;
|
|
2142
|
+
--hb-ink-muted: #5a4f42;
|
|
2143
|
+
--hb-ink-quiet: #8b7e6b;
|
|
2144
|
+
--hb-sage: #5c6a4a;
|
|
2145
|
+
--hb-sage-forest: #3d4d3a;
|
|
2146
|
+
--hb-cream-ink: #f3ede0;
|
|
2147
|
+
--hb-accent: #b0724c;
|
|
2148
|
+
--hb-accent-hover: #996142;
|
|
2149
|
+
--hb-border: rgba(127, 127, 127, 0.25);
|
|
2150
|
+
--hb-radius-sm: 4px;
|
|
2151
|
+
--hb-radius-md: 6px;
|
|
2152
|
+
--hb-radius-lg: 10px;
|
|
2153
|
+
--hb-font-display: 'PT Serif', Georgia, 'Times New Roman', serif;
|
|
2154
|
+
--hb-font-ui: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
|
|
2155
|
+
--hb-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
2156
|
+
--hb-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 6px 18px rgba(0, 0, 0, 0.06);
|
|
2157
|
+
--hb-measure: 42rem;
|
|
2158
|
+
${groundTokens("light", " ")}
|
|
2159
|
+
}
|
|
1235
2160
|
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
2161
|
+
@media (prefers-color-scheme: dark) {
|
|
2162
|
+
:root {
|
|
2163
|
+
${groundTokens("dark", " ")}
|
|
2164
|
+
--hb-canvas: #141517;
|
|
2165
|
+
--hb-panel: #1c1d20;
|
|
2166
|
+
--hb-reading: #1a1b1e;
|
|
2167
|
+
--hb-inset: #1f2124;
|
|
2168
|
+
--hb-ink: #f0f0f0;
|
|
2169
|
+
--hb-ink-warm: #ececec;
|
|
2170
|
+
--hb-ink-muted: #999999;
|
|
2171
|
+
--hb-ink-quiet: #808080;
|
|
2172
|
+
--hb-sage: #4d6149;
|
|
2173
|
+
--hb-accent: #c0875d;
|
|
2174
|
+
--hb-accent-hover: #d5a07a;
|
|
2175
|
+
--hb-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.36);
|
|
1251
2176
|
}
|
|
2177
|
+
}
|
|
1252
2178
|
|
|
1253
|
-
|
|
1254
|
-
var mount = root.querySelector('[' + ATTR.controls + ']');
|
|
1255
|
-
var rounds = collect(root);
|
|
1256
|
-
if (!mount || rounds.length === 0) return;
|
|
1257
|
-
var facet = facets(rounds);
|
|
2179
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
1258
2180
|
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
hardwareOptions.push({ value: facet.hardware[h].value, label: facet.hardware[h].label });
|
|
1269
|
-
}
|
|
1270
|
-
var modelOptions = [{ value: ANY, label: 'Any model' }];
|
|
1271
|
-
for (var m = 0; m < facet.models.length; m++) {
|
|
1272
|
-
modelOptions.push({ value: facet.models[m], label: facet.models[m] });
|
|
1273
|
-
}
|
|
1274
|
-
var classOptions = [{ value: ANY, label: 'Any class' }];
|
|
1275
|
-
for (var c = 0; c < facet.tiers.length; c++) {
|
|
1276
|
-
classOptions.push({ value: facet.tiers[c], label: facet.tiers[c] });
|
|
1277
|
-
}
|
|
2181
|
+
body.hb {
|
|
2182
|
+
margin: 0;
|
|
2183
|
+
background: var(--hb-canvas);
|
|
2184
|
+
color: var(--hb-ink);
|
|
2185
|
+
font-family: var(--hb-font-ui);
|
|
2186
|
+
font-size: 1rem;
|
|
2187
|
+
line-height: 1.6;
|
|
2188
|
+
-webkit-font-smoothing: antialiased;
|
|
2189
|
+
}
|
|
1278
2190
|
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
bar.appendChild(model.wrap);
|
|
1287
|
-
bar.appendChild(modelClass.wrap);
|
|
1288
|
-
bar.appendChild(round.wrap);
|
|
2191
|
+
.hb a { color: var(--hb-accent); text-decoration: none; }
|
|
2192
|
+
.hb a:hover { color: var(--hb-accent-hover); text-decoration: underline; }
|
|
2193
|
+
.hb a:focus-visible {
|
|
2194
|
+
outline: 2px solid var(--hb-accent);
|
|
2195
|
+
outline-offset: 2px;
|
|
2196
|
+
border-radius: var(--hb-radius-sm);
|
|
2197
|
+
}
|
|
1289
2198
|
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
2199
|
+
/* Masthead \u2014 sage is a place, never a control. */
|
|
2200
|
+
.hb-masthead {
|
|
2201
|
+
display: flex;
|
|
2202
|
+
flex-wrap: wrap;
|
|
2203
|
+
align-items: baseline;
|
|
2204
|
+
gap: 0.5rem 1.5rem;
|
|
2205
|
+
padding: 0.85rem 1.5rem;
|
|
2206
|
+
background: var(--hb-sage);
|
|
2207
|
+
color: var(--hb-cream-ink);
|
|
2208
|
+
}
|
|
2209
|
+
.hb-brand {
|
|
2210
|
+
font-family: var(--hb-font-display);
|
|
2211
|
+
font-size: 1.15rem;
|
|
2212
|
+
font-weight: 700;
|
|
2213
|
+
}
|
|
1294
2214
|
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
2215
|
+
/* The product wordmark, back out to the surrounding site. Lowercase italic
|
|
2216
|
+
serif at PT Serif's natural 400 \u2014 the family ships only 400 and 700, so
|
|
2217
|
+
anything between synthesizes a weight. Set apart from the Handboek title
|
|
2218
|
+
by a hairline rule rather than by size. */
|
|
2219
|
+
.hb-wordmark {
|
|
2220
|
+
font-family: var(--hb-font-display);
|
|
2221
|
+
font-style: italic;
|
|
2222
|
+
font-weight: 400;
|
|
2223
|
+
font-size: 1.15rem;
|
|
2224
|
+
text-transform: lowercase;
|
|
2225
|
+
padding-right: 0.6rem;
|
|
2226
|
+
margin-right: 0.1rem;
|
|
2227
|
+
border-right: 1px solid rgba(243, 237, 224, 0.35);
|
|
2228
|
+
opacity: 0.9;
|
|
2229
|
+
}
|
|
2230
|
+
.hb-wordmark:hover { opacity: 1; }
|
|
2231
|
+
.hb-masthead a, .hb-masthead a:hover { color: var(--hb-cream-ink); }
|
|
2232
|
+
.hb-areanav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.9rem; }
|
|
2233
|
+
.hb-areanav a { opacity: 0.85; }
|
|
2234
|
+
.hb-areanav a:hover, .hb-areanav a[aria-current='true'] { opacity: 1; }
|
|
2235
|
+
.hb-areanav a[aria-current='true'] { text-decoration: underline; text-underline-offset: 4px; }
|
|
1298
2236
|
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
2237
|
+
/* Three-column reading layout: nav, article, on-this-page.
|
|
2238
|
+
The third column is reserved even on the ~300 generated catalog articles
|
|
2239
|
+
that carry too few headings to warrant a list, so the article body holds
|
|
2240
|
+
the same position as you click between pages instead of jumping. */
|
|
2241
|
+
.hb-layout {
|
|
2242
|
+
display: grid;
|
|
2243
|
+
grid-template-columns: 15rem minmax(0, 1fr) 13rem;
|
|
2244
|
+
gap: 2.5rem;
|
|
2245
|
+
align-items: start;
|
|
2246
|
+
max-width: 84rem;
|
|
2247
|
+
margin: 0 auto;
|
|
2248
|
+
padding: 2rem 1.5rem 4rem;
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
/* A sticky panel taller than the window pins its top and leaves the rest
|
|
2252
|
+
unreachable until the page ends, so each side panel is capped at the
|
|
2253
|
+
viewport and scrolls on its own. The left padding, cancelled by the
|
|
2254
|
+
negative margin, keeps the current-page marker (which sits 0.6rem
|
|
2255
|
+
outside the list) and focus rings inside the scroll box, which would
|
|
2256
|
+
otherwise clip them. */
|
|
2257
|
+
.hb-sidebar, .hb-onthispage {
|
|
2258
|
+
position: sticky;
|
|
2259
|
+
top: 1.5rem;
|
|
2260
|
+
max-height: calc(100vh - 3rem);
|
|
2261
|
+
overflow-y: auto;
|
|
2262
|
+
overscroll-behavior: contain;
|
|
2263
|
+
scrollbar-width: thin;
|
|
2264
|
+
margin-left: -0.6rem;
|
|
2265
|
+
padding: 0 0.25rem 1rem 0.6rem;
|
|
2266
|
+
font-size: 0.9rem;
|
|
2267
|
+
}
|
|
2268
|
+
.hb-sidebar section { margin-bottom: 1.5rem; }
|
|
2269
|
+
.hb-sidebar h2, .hb-onthispage h2 {
|
|
2270
|
+
margin: 0 0 0.5rem;
|
|
2271
|
+
font-family: var(--hb-font-ui);
|
|
2272
|
+
font-size: 0.72rem;
|
|
2273
|
+
font-weight: 600;
|
|
2274
|
+
letter-spacing: 0.08em;
|
|
2275
|
+
text-transform: uppercase;
|
|
2276
|
+
color: var(--hb-ink-quiet);
|
|
2277
|
+
}
|
|
2278
|
+
.hb-sidebar h2 a { color: inherit; }
|
|
2279
|
+
.hb-sidebar h2.hb-current { color: var(--hb-ink-warm); }
|
|
2280
|
+
.hb-sidebar ul, .hb-onthispage ul { list-style: none; margin: 0; padding: 0; }
|
|
2281
|
+
.hb-sidebar li { margin: 0.15rem 0; }
|
|
2282
|
+
.hb-sidebar .hb-sidebar-subcategory { margin-top: 0.8rem; }
|
|
2283
|
+
.hb-sidebar .hb-sidebar-subcategory:first-child { margin-top: 0; }
|
|
2284
|
+
.hb-sidebar .hb-sidebar-subcategory-title {
|
|
2285
|
+
margin: 0 0 0.25rem;
|
|
2286
|
+
font-family: var(--hb-font-ui);
|
|
2287
|
+
font-size: 0.68rem;
|
|
2288
|
+
font-weight: 600;
|
|
2289
|
+
letter-spacing: 0.06em;
|
|
2290
|
+
text-transform: uppercase;
|
|
2291
|
+
color: var(--hb-ink-quiet);
|
|
2292
|
+
}
|
|
2293
|
+
.hb-sidebar .hb-sidebar-subcategory ul { padding-left: 0.45rem; }
|
|
2294
|
+
.hb-sidebar a, .hb-onthispage a { color: var(--hb-ink-muted); }
|
|
2295
|
+
.hb-sidebar a:hover, .hb-onthispage a:hover { color: var(--hb-accent); }
|
|
2296
|
+
.hb-sidebar a.hb-current {
|
|
2297
|
+
color: var(--hb-accent);
|
|
2298
|
+
font-weight: 600;
|
|
2299
|
+
border-left: 2px solid var(--hb-accent);
|
|
2300
|
+
margin-left: -0.6rem;
|
|
2301
|
+
padding-left: 0.45rem;
|
|
2302
|
+
}
|
|
2303
|
+
.hb-onthispage li { margin: 0.2rem 0; }
|
|
2304
|
+
.hb-onthispage .hb-h3 { padding-left: 0.75rem; font-size: 0.85rem; }
|
|
2305
|
+
.hb-more { margin: 0.4rem 0 0; font-size: 0.85rem; }
|
|
1306
2306
|
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
bar.appendChild(reset);
|
|
2307
|
+
.hb-breadcrumb { font-size: 0.85rem; color: var(--hb-ink-quiet); margin-bottom: 1rem; }
|
|
2308
|
+
.hb-breadcrumb a { color: var(--hb-ink-muted); }
|
|
2309
|
+
.hb-breadcrumb span { margin: 0 0.35rem; }
|
|
1311
2310
|
|
|
1312
|
-
|
|
2311
|
+
/* Article \u2014 the editorial register. Headings serif, everything else sans. */
|
|
2312
|
+
.hb-article {
|
|
2313
|
+
max-width: var(--hb-measure);
|
|
2314
|
+
background: var(--hb-reading);
|
|
2315
|
+
border: 1px solid var(--hb-border);
|
|
2316
|
+
border-radius: var(--hb-radius-lg);
|
|
2317
|
+
box-shadow: var(--hb-shadow);
|
|
2318
|
+
padding: 2.5rem 2.75rem 3rem;
|
|
2319
|
+
color: var(--hb-ink-warm);
|
|
2320
|
+
}
|
|
2321
|
+
.hb-article h1, .hb-article h2, .hb-article h3,
|
|
2322
|
+
.hb-article h4, .hb-article h5, .hb-article h6 {
|
|
2323
|
+
font-family: var(--hb-font-display);
|
|
2324
|
+
font-weight: 700;
|
|
2325
|
+
line-height: 1.25;
|
|
2326
|
+
color: var(--hb-ink-warm);
|
|
2327
|
+
margin: 2rem 0 0.75rem;
|
|
2328
|
+
}
|
|
2329
|
+
.hb-article a { font-family: var(--hb-font-ui); }
|
|
2330
|
+
.hb-article h1 { font-size: 2rem; margin-top: 0; }
|
|
2331
|
+
.hb-article h2 {
|
|
2332
|
+
font-size: 1.4rem;
|
|
2333
|
+
padding-bottom: 0.3rem;
|
|
2334
|
+
border-bottom: 1px solid var(--hb-border);
|
|
2335
|
+
}
|
|
2336
|
+
.hb-article h3 { font-size: 1.1rem; }
|
|
2337
|
+
.hb-article p, .hb-article li { font-size: 1rem; }
|
|
2338
|
+
.hb-article p { margin: 0 0 1rem; }
|
|
2339
|
+
.hb-article ul, .hb-article ol { margin: 0 0 1rem; padding-left: 1.35rem; }
|
|
2340
|
+
.hb-article li { margin: 0.3rem 0; }
|
|
2341
|
+
.hb-article li > p { margin: 0; }
|
|
2342
|
+
.hb-article img { max-width: 100%; height: auto; border-radius: var(--hb-radius-md); }
|
|
2343
|
+
.hb-article hr { border: 0; border-top: 1px solid var(--hb-border); margin: 2rem 0; }
|
|
2344
|
+
.hb-article blockquote {
|
|
2345
|
+
margin: 0 0 1rem;
|
|
2346
|
+
padding: 0.25rem 0 0.25rem 1rem;
|
|
2347
|
+
border-left: 3px solid var(--hb-accent);
|
|
2348
|
+
color: var(--hb-ink-muted);
|
|
2349
|
+
}
|
|
2350
|
+
.hb-article code {
|
|
2351
|
+
font-family: var(--hb-font-mono);
|
|
2352
|
+
font-size: 0.875em;
|
|
2353
|
+
background: var(--hb-inset);
|
|
2354
|
+
border-radius: var(--hb-radius-sm);
|
|
2355
|
+
padding: 0.1em 0.35em;
|
|
2356
|
+
}
|
|
2357
|
+
.hb-article pre {
|
|
2358
|
+
background: var(--hb-inset);
|
|
2359
|
+
border: 1px solid var(--hb-border);
|
|
2360
|
+
border-radius: var(--hb-radius-md);
|
|
2361
|
+
padding: 0.9rem 1.1rem;
|
|
2362
|
+
overflow-x: auto;
|
|
2363
|
+
margin: 0 0 1rem;
|
|
2364
|
+
}
|
|
2365
|
+
.hb-article pre code { background: none; padding: 0; font-size: 0.85rem; }
|
|
1313
2366
|
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
2367
|
+
/* Wide content scrolls inside its own box; the page never scrolls sideways.
|
|
2368
|
+
The scroll lives on a wrapper, not on the table itself: display:block
|
|
2369
|
+
on a table makes it shrink-to-content and stop filling the column. */
|
|
2370
|
+
.hb-table-scroll {
|
|
2371
|
+
overflow-x: auto;
|
|
2372
|
+
max-width: 100%;
|
|
2373
|
+
margin: 0 0 1.25rem;
|
|
2374
|
+
}
|
|
2375
|
+
/* A step down from body copy: the model scorecard puts eight columns of
|
|
2376
|
+
figures inside a 42rem reading measure, and at prose size the numbers get
|
|
2377
|
+
less room than the words around them. */
|
|
2378
|
+
.hb-article table {
|
|
2379
|
+
border-collapse: collapse;
|
|
2380
|
+
width: 100%;
|
|
2381
|
+
font-size: 0.82rem;
|
|
2382
|
+
line-height: 1.45;
|
|
2383
|
+
}
|
|
2384
|
+
/* Prose cells wrap. Catalog tables pair a short name against a full sentence
|
|
2385
|
+
of description, so white-space:nowrap would push the description off the
|
|
2386
|
+
page and force a horizontal scroll to read every row.
|
|
1318
2387
|
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
2388
|
+
break-word, not anywhere: both keep an over-long token from spilling out
|
|
2389
|
+
of the table, but "anywhere" also lets the browser count a single
|
|
2390
|
+
character as a column's minimum width, so a squeezed table shreds its
|
|
2391
|
+
headings mid-word ("Rea" / "ds" / "at"). With break-word a column never
|
|
2392
|
+
narrows past its longest word, and the excess goes to the scroller. */
|
|
2393
|
+
.hb-article th, .hb-article td {
|
|
2394
|
+
border: 1px solid var(--hb-border);
|
|
2395
|
+
padding: 0.4rem 0.45rem;
|
|
2396
|
+
text-align: left;
|
|
2397
|
+
vertical-align: top;
|
|
2398
|
+
overflow-wrap: break-word;
|
|
2399
|
+
min-width: 3rem;
|
|
2400
|
+
}
|
|
2401
|
+
.hb-article th { background: var(--hb-inset); font-weight: 600; }
|
|
2402
|
+
/* Keep the leading label column from collapsing to one word per line while
|
|
2403
|
+
the description column takes the slack. */
|
|
2404
|
+
.hb-article tbody td:first-child { min-width: 6rem; }
|
|
1329
2405
|
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
2406
|
+
/* Sidecar data tables (handboek-data-tables.ts): a file the article links,
|
|
2407
|
+
drawn once by the squisq player in static mode and then handed to
|
|
2408
|
+
assets/data-table.js, which keeps a copy it can sort and filter. Hundreds
|
|
2409
|
+
of rows scroll inside a box with the header row (names, sort buttons,
|
|
2410
|
+
filter boxes) and the naming first column pinned, rather than pushing the
|
|
2411
|
+
rest of the article down a screen per dozen rows. The table takes its
|
|
2412
|
+
content's width (max-content), so these rows of figures read across on
|
|
2413
|
+
one line and the box scrolls sideways \u2014 unlike the catalog tables above,
|
|
2414
|
+
whose prose cells must wrap. */
|
|
2415
|
+
.hb-data-table { margin: 0 0 1.5rem; }
|
|
2416
|
+
/* Out of sight while the player draws. */
|
|
2417
|
+
.hb-data-table-stage {
|
|
2418
|
+
position: absolute;
|
|
2419
|
+
width: 1px;
|
|
2420
|
+
height: 1px;
|
|
2421
|
+
overflow: hidden;
|
|
2422
|
+
clip-path: inset(50%);
|
|
2423
|
+
}
|
|
2424
|
+
/* Should the hand-off never happen, the player's own table stands, reset to
|
|
2425
|
+
sit in the article without a second heading. The player paints its theme
|
|
2426
|
+
background as an inline style, which only !important outranks. */
|
|
2427
|
+
.hb-article .hb-data-table :is(.squisq-linear, .squisq-linear-content, .squisq-page-section, .squisq-page-section-inner) {
|
|
2428
|
+
background: none;
|
|
2429
|
+
color: inherit;
|
|
2430
|
+
font-family: var(--hb-font-ui);
|
|
2431
|
+
max-width: none;
|
|
2432
|
+
min-height: 0;
|
|
2433
|
+
margin: 0;
|
|
2434
|
+
padding: 0;
|
|
2435
|
+
}
|
|
2436
|
+
.hb-article .hb-data-table .squisq-linear { background: transparent !important; }
|
|
2437
|
+
.hb-article .hb-data-table .squisq-page-table-title { display: none; }
|
|
2438
|
+
.hb-article .hb-data-table :is(.hb-data-table-scroll, .squisq-page-table-scroll) {
|
|
2439
|
+
max-height: 70vh;
|
|
2440
|
+
overflow: auto;
|
|
2441
|
+
border: 1px solid var(--hb-border);
|
|
2442
|
+
border-radius: var(--hb-radius-md);
|
|
2443
|
+
background: var(--hb-panel);
|
|
2444
|
+
box-shadow: none;
|
|
2445
|
+
}
|
|
2446
|
+
.hb-data-table-bar {
|
|
2447
|
+
display: flex;
|
|
2448
|
+
flex-wrap: wrap;
|
|
2449
|
+
align-items: center;
|
|
2450
|
+
justify-content: space-between;
|
|
2451
|
+
gap: 0.4rem 1rem;
|
|
2452
|
+
margin: 0 0 0.5rem;
|
|
2453
|
+
}
|
|
2454
|
+
.hb-article .hb-data-table-status { margin: 0; font-size: 0.85rem; color: var(--hb-ink-muted); }
|
|
2455
|
+
.hb-data-table-clear {
|
|
2456
|
+
font: inherit;
|
|
2457
|
+
font-size: 0.8rem;
|
|
2458
|
+
padding: 0.2rem 0.6rem;
|
|
2459
|
+
border: 1px solid var(--hb-border);
|
|
2460
|
+
border-radius: var(--hb-radius-sm);
|
|
2461
|
+
background: var(--hb-panel);
|
|
2462
|
+
color: var(--hb-ink);
|
|
2463
|
+
cursor: pointer;
|
|
2464
|
+
}
|
|
2465
|
+
.hb-data-table-clear:hover { border-color: var(--hb-accent); }
|
|
2466
|
+
.hb-data-table-clear[hidden] { display: none; }
|
|
2467
|
+
.hb-article .hb-data-table table {
|
|
2468
|
+
border-collapse: separate;
|
|
2469
|
+
border-spacing: 0;
|
|
2470
|
+
width: max-content;
|
|
2471
|
+
min-width: 100%;
|
|
2472
|
+
margin: 0;
|
|
2473
|
+
font-size: 0.78rem;
|
|
2474
|
+
line-height: 1.4;
|
|
2475
|
+
font-variant-numeric: tabular-nums;
|
|
2476
|
+
}
|
|
2477
|
+
.hb-article .hb-data-table tr { background: none; }
|
|
2478
|
+
.hb-article .hb-data-table :is(th, td) {
|
|
2479
|
+
border: 0;
|
|
2480
|
+
border-bottom: 1px solid var(--hb-border);
|
|
2481
|
+
padding: 0.35rem 0.6rem;
|
|
2482
|
+
min-width: 0;
|
|
2483
|
+
color: var(--hb-ink);
|
|
2484
|
+
}
|
|
2485
|
+
.hb-article .hb-data-table thead th {
|
|
2486
|
+
position: sticky;
|
|
2487
|
+
top: 0;
|
|
2488
|
+
z-index: 3;
|
|
2489
|
+
background: var(--hb-inset);
|
|
2490
|
+
font-weight: 600;
|
|
2491
|
+
vertical-align: bottom;
|
|
2492
|
+
}
|
|
2493
|
+
/* The first column names the row, so it stays put while the figures scroll
|
|
2494
|
+
past it; its header cell is pinned both ways and sits above the rest. */
|
|
2495
|
+
.hb-article .hb-data-table td:first-child {
|
|
2496
|
+
position: sticky;
|
|
2497
|
+
left: 0;
|
|
2498
|
+
z-index: 1;
|
|
2499
|
+
background: var(--hb-panel);
|
|
2500
|
+
font-weight: 600;
|
|
2501
|
+
}
|
|
2502
|
+
.hb-article .hb-data-table thead th:first-child { left: 0; z-index: 4; }
|
|
2503
|
+
.hb-article .hb-data-table tbody tr:hover td { background: var(--hb-reading); }
|
|
2504
|
+
/* A heading row per group (the scorecard's rounds). Its cell spans the whole
|
|
2505
|
+
table, so the label itself is pinned to stay readable while it scrolls. */
|
|
2506
|
+
.hb-article .hb-data-table .hb-data-table-group th {
|
|
2507
|
+
padding: 0.55rem 0.6rem 0.3rem;
|
|
2508
|
+
background: var(--hb-reading);
|
|
2509
|
+
color: var(--hb-ink-muted);
|
|
2510
|
+
font-weight: 600;
|
|
2511
|
+
text-align: left;
|
|
2512
|
+
}
|
|
2513
|
+
.hb-data-table-group-label { position: sticky; left: 0.6rem; }
|
|
2514
|
+
.hb-data-table-sort {
|
|
2515
|
+
display: block;
|
|
2516
|
+
width: 100%;
|
|
2517
|
+
margin: 0;
|
|
2518
|
+
padding: 0;
|
|
2519
|
+
border: 0;
|
|
2520
|
+
background: none;
|
|
2521
|
+
font: inherit;
|
|
2522
|
+
font-weight: 600;
|
|
2523
|
+
color: inherit;
|
|
2524
|
+
text-align: inherit;
|
|
2525
|
+
cursor: pointer;
|
|
2526
|
+
}
|
|
2527
|
+
.hb-data-table-sort:hover { color: var(--hb-accent); }
|
|
2528
|
+
.hb-data-table-sort::after { content: ' \u2195'; opacity: 0.35; }
|
|
2529
|
+
th[aria-sort='ascending'] .hb-data-table-sort::after { content: ' \u2191'; opacity: 1; }
|
|
2530
|
+
th[aria-sort='descending'] .hb-data-table-sort::after { content: ' \u2193'; opacity: 1; }
|
|
2531
|
+
.hb-data-table-filter {
|
|
2532
|
+
display: block;
|
|
2533
|
+
box-sizing: border-box;
|
|
2534
|
+
width: 100%;
|
|
2535
|
+
min-width: 5.5rem;
|
|
2536
|
+
margin: 0.3rem 0 0;
|
|
2537
|
+
padding: 0.15rem 0.35rem;
|
|
2538
|
+
border: 1px solid var(--hb-border);
|
|
2539
|
+
border-radius: var(--hb-radius-sm);
|
|
2540
|
+
background: var(--hb-panel);
|
|
2541
|
+
color: var(--hb-ink);
|
|
2542
|
+
font: inherit;
|
|
2543
|
+
font-size: 0.75rem;
|
|
2544
|
+
font-weight: 400;
|
|
2545
|
+
}
|
|
2546
|
+
.hb-data-table-filter:focus { outline: 2px solid var(--hb-accent); outline-offset: -1px; }
|
|
1335
2547
|
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
2548
|
+
/* Model scorecard.
|
|
2549
|
+
|
|
2550
|
+
The stack of test rounds is complete in the markup; assets/scorecard.js
|
|
2551
|
+
narrows it. Everything here has to read correctly before that script runs
|
|
2552
|
+
and after it hides most of the page, so the rounds are self-describing
|
|
2553
|
+
panels rather than a run of headings, and the control bar reserves its own
|
|
2554
|
+
height instead of appearing under the reader's first paragraph. */
|
|
2555
|
+
.hb-scorecard { margin: 0 0 1.5rem; }
|
|
2556
|
+
.hb-scorecard [hidden] { display: none !important; }
|
|
2557
|
+
.hb-scorecard-controls:empty { display: none; }
|
|
2558
|
+
.hb-scorecard-controlbar {
|
|
2559
|
+
display: flex;
|
|
2560
|
+
flex-wrap: wrap;
|
|
2561
|
+
align-items: flex-end;
|
|
2562
|
+
gap: 0.6rem;
|
|
2563
|
+
padding: 0.8rem 0.9rem;
|
|
2564
|
+
background: var(--hb-inset);
|
|
2565
|
+
border: 1px solid var(--hb-border);
|
|
2566
|
+
border-radius: var(--hb-radius-lg);
|
|
2567
|
+
}
|
|
2568
|
+
.hb-scorecard-field {
|
|
2569
|
+
display: flex;
|
|
2570
|
+
flex-direction: column;
|
|
2571
|
+
gap: 0.25rem;
|
|
2572
|
+
min-width: 0;
|
|
2573
|
+
/* Grows to share a row, but never to the whole bar: the round picker wraps
|
|
2574
|
+
onto its own line inside the reading measure, and a full-width control
|
|
2575
|
+
there reads as a search field rather than as one key of four. */
|
|
2576
|
+
flex: 1 1 9rem;
|
|
2577
|
+
max-width: 14rem;
|
|
2578
|
+
}
|
|
2579
|
+
.hb-scorecard-field-label {
|
|
2580
|
+
font-family: var(--hb-font-ui);
|
|
2581
|
+
font-size: 0.72rem;
|
|
2582
|
+
letter-spacing: 0.06em;
|
|
2583
|
+
text-transform: uppercase;
|
|
2584
|
+
color: var(--hb-ink-muted);
|
|
2585
|
+
}
|
|
2586
|
+
/* Keys, not capsules: --radius-md inside a --radius-lg tray, matching the
|
|
2587
|
+
app's choice-control recipe in docs/ux.md. */
|
|
2588
|
+
.hb-scorecard-select {
|
|
2589
|
+
font-family: var(--hb-font-ui);
|
|
2590
|
+
font-size: 0.9rem;
|
|
2591
|
+
color: var(--hb-ink-warm);
|
|
2592
|
+
background: var(--hb-panel);
|
|
2593
|
+
border: 1px solid var(--hb-border);
|
|
2594
|
+
border-radius: var(--hb-radius-md);
|
|
2595
|
+
padding: 0.35rem 0.5rem;
|
|
2596
|
+
max-width: 100%;
|
|
2597
|
+
}
|
|
2598
|
+
.hb-scorecard-select:hover { border-color: var(--hb-ink-quiet); }
|
|
2599
|
+
.hb-scorecard-reset {
|
|
2600
|
+
font-family: var(--hb-font-ui);
|
|
2601
|
+
font-size: 0.85rem;
|
|
2602
|
+
color: var(--hb-ink-warm);
|
|
2603
|
+
background: var(--hb-panel);
|
|
2604
|
+
border: 1px solid var(--hb-border);
|
|
2605
|
+
border-radius: var(--hb-radius-md);
|
|
2606
|
+
padding: 0.4rem 0.7rem;
|
|
2607
|
+
cursor: pointer;
|
|
2608
|
+
}
|
|
2609
|
+
.hb-scorecard-reset:hover { color: var(--hb-accent); border-color: var(--hb-accent); }
|
|
2610
|
+
.hb-scorecard-status {
|
|
2611
|
+
font-family: var(--hb-font-ui);
|
|
2612
|
+
font-size: 0.85rem;
|
|
2613
|
+
color: var(--hb-ink-muted);
|
|
2614
|
+
margin: 0.55rem 0 0;
|
|
2615
|
+
}
|
|
2616
|
+
.hb-article .hb-scorecard-help {
|
|
2617
|
+
font-family: var(--hb-font-ui);
|
|
2618
|
+
font-size: 0.82rem;
|
|
2619
|
+
color: var(--hb-ink-quiet);
|
|
2620
|
+
margin: 0.15rem 0 0;
|
|
2621
|
+
}
|
|
2622
|
+
.hb-scorecard-round { margin: 1.75rem 0 0; }
|
|
2623
|
+
/* On the site each round is a line in a list, linking to its own page; the
|
|
2624
|
+
page itself opens straight into the stamp under its title. */
|
|
2625
|
+
.hb-article .hb-scorecard-runs-title { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }
|
|
2626
|
+
.hb-article .hb-scorecard-runs { list-style: none; margin: 0 0 1.5rem; padding: 0; }
|
|
2627
|
+
.hb-scorecard-round.hb-scorecard-run {
|
|
2628
|
+
margin: 0;
|
|
2629
|
+
padding: 0.55rem 0;
|
|
2630
|
+
border-bottom: 1px solid var(--hb-border);
|
|
2631
|
+
}
|
|
2632
|
+
.hb-scorecard-run-link { font-weight: 600; }
|
|
2633
|
+
.hb-scorecard-run-meta {
|
|
2634
|
+
display: block;
|
|
2635
|
+
margin-top: 0.15rem;
|
|
2636
|
+
font-size: 0.82rem;
|
|
2637
|
+
color: var(--hb-ink-muted);
|
|
2638
|
+
}
|
|
2639
|
+
.hb-scorecard-round.hb-scorecard-round-page { margin-top: 0.5rem; }
|
|
2640
|
+
.hb-article .hb-scorecard-round-title { font-size: 1.1rem; margin-top: 0; }
|
|
2641
|
+
.hb-article .hb-scorecard-suite-title { font-size: 0.95rem; margin: 1.25rem 0 0.5rem; }
|
|
2642
|
+
.hb-scorecard-stamp { font-size: 0.85rem; margin: 0 0 0.75rem; }
|
|
2643
|
+
.hb-article .hb-scorecard-withheld,
|
|
2644
|
+
.hb-article .hb-scorecard-memory-note,
|
|
2645
|
+
.hb-article .hb-scorecard-taskcount {
|
|
2646
|
+
font-size: 0.82rem;
|
|
2647
|
+
color: var(--hb-ink-muted);
|
|
2648
|
+
margin: 0 0 0.75rem;
|
|
2649
|
+
}
|
|
1341
2650
|
|
|
1342
|
-
|
|
1343
|
-
* Rows and whole suite tables hide together with what they contain: a
|
|
1344
|
-
* suite whose every row was filtered out would otherwise leave a
|
|
1345
|
-
* heading over an empty table, which reads as "measured nothing" rather
|
|
1346
|
-
* than "not what you asked for". Returns whether the round kept
|
|
1347
|
-
* anything at all.
|
|
1348
|
-
*/
|
|
1349
|
-
function rowsMatch(roundEl) {
|
|
1350
|
-
var suites = roundEl.querySelectorAll('[' + ATTR.suite + ']');
|
|
1351
|
-
var kept = 0;
|
|
1352
|
-
for (var i = 0; i < suites.length; i++) {
|
|
1353
|
-
var rows = suites[i].querySelectorAll('[' + ATTR.model + ']');
|
|
1354
|
-
var visibleRows = 0;
|
|
1355
|
-
for (var j = 0; j < rows.length; j++) {
|
|
1356
|
-
var row = rows[j];
|
|
1357
|
-
var ok =
|
|
1358
|
-
(!state.model || attr(row, ATTR.model) === state.model) &&
|
|
1359
|
-
(!state.modelClass || attr(row, ATTR.tier) === state.modelClass);
|
|
1360
|
-
row.hidden = !ok;
|
|
1361
|
-
if (ok) visibleRows++;
|
|
1362
|
-
}
|
|
1363
|
-
suites[i].hidden = visibleRows === 0;
|
|
1364
|
-
if (visibleRows > 0) kept++;
|
|
1365
|
-
}
|
|
1366
|
-
return kept > 0;
|
|
1367
|
-
}
|
|
2651
|
+
.hb-watch { max-width: var(--hb-measure); margin: 1.25rem 0 0; font-size: 0.9rem; }
|
|
1368
2652
|
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
2653
|
+
/* A project type's page demo, framed like a window onto the room. */
|
|
2654
|
+
.hb-demo-frame {
|
|
2655
|
+
border: 1px solid var(--hb-border);
|
|
2656
|
+
border-radius: var(--hb-radius-lg);
|
|
2657
|
+
background: var(--hb-panel);
|
|
2658
|
+
box-shadow: var(--hb-shadow);
|
|
2659
|
+
padding: 6px;
|
|
2660
|
+
}
|
|
2661
|
+
.hb-demo-frame iframe {
|
|
2662
|
+
display: block;
|
|
2663
|
+
width: 100%;
|
|
2664
|
+
height: 34rem;
|
|
2665
|
+
border: 0;
|
|
2666
|
+
border-radius: var(--hb-radius-md);
|
|
2667
|
+
background: #fff;
|
|
2668
|
+
}
|
|
2669
|
+
.hb-demo-open { font-size: 0.9rem; }
|
|
1376
2670
|
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
2671
|
+
/* Craftbook marks: one under each craftbook's title, and a gallery shelf.
|
|
2672
|
+
Marks are transparent cut-outs, so the image's own background is the
|
|
2673
|
+
colored paper the app paints behind them, picked by data-ground. Cream
|
|
2674
|
+
stays as the fallback for a mark that names no ground. */
|
|
2675
|
+
${groundRules}
|
|
2676
|
+
.hb-craftbook-art {
|
|
2677
|
+
display: block;
|
|
2678
|
+
width: 160px;
|
|
2679
|
+
height: 160px;
|
|
2680
|
+
margin: 0 0 1.25rem;
|
|
2681
|
+
border-radius: var(--hb-radius-md);
|
|
2682
|
+
background: var(--hb-mark-ground, #e8dec7);
|
|
2683
|
+
}
|
|
2684
|
+
.hb-article .hb-gallery {
|
|
2685
|
+
list-style: none;
|
|
2686
|
+
margin: 0 0 2rem;
|
|
2687
|
+
padding: 0;
|
|
2688
|
+
display: grid;
|
|
2689
|
+
grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
|
|
2690
|
+
gap: 0.75rem;
|
|
2691
|
+
}
|
|
2692
|
+
.hb-article .hb-gallery li { margin: 0; font-size: inherit; }
|
|
2693
|
+
.hb-gallery a {
|
|
2694
|
+
display: flex;
|
|
2695
|
+
flex-direction: column;
|
|
2696
|
+
gap: 0.35rem;
|
|
2697
|
+
height: 100%;
|
|
2698
|
+
padding: 0.75rem;
|
|
2699
|
+
border: 1px solid var(--hb-border);
|
|
2700
|
+
border-radius: var(--hb-radius-lg);
|
|
2701
|
+
background: var(--hb-panel);
|
|
2702
|
+
color: var(--hb-ink);
|
|
2703
|
+
text-decoration: none;
|
|
2704
|
+
box-shadow: var(--hb-shadow);
|
|
2705
|
+
}
|
|
2706
|
+
.hb-gallery a:hover { border-color: var(--hb-accent); }
|
|
2707
|
+
.hb-gallery img {
|
|
2708
|
+
width: 96px;
|
|
2709
|
+
height: 96px;
|
|
2710
|
+
border-radius: var(--hb-radius-md);
|
|
2711
|
+
background: var(--hb-mark-ground, #e8dec7);
|
|
2712
|
+
}
|
|
2713
|
+
.hb-gallery-title { font-family: var(--hb-font-display); font-weight: 700; color: var(--hb-sage); }
|
|
2714
|
+
.hb-gallery-summary { font-size: 0.85rem; line-height: 1.4; color: var(--hb-ink-muted); }
|
|
1399
2715
|
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
2716
|
+
/* Home */
|
|
2717
|
+
.hb-home-main { max-width: 62rem; margin: 0 auto; padding: 3rem 1.5rem 4rem; }
|
|
2718
|
+
.hb-hero { max-width: var(--hb-measure); margin-bottom: 3rem; }
|
|
2719
|
+
.hb-hero h1 {
|
|
2720
|
+
font-family: var(--hb-font-display);
|
|
2721
|
+
font-size: 2.6rem;
|
|
2722
|
+
line-height: 1.15;
|
|
2723
|
+
margin: 0 0 1rem;
|
|
2724
|
+
color: var(--hb-sage-forest);
|
|
2725
|
+
}
|
|
2726
|
+
@media (prefers-color-scheme: dark) {
|
|
2727
|
+
.hb-hero h1 { color: var(--hb-ink-warm); }
|
|
2728
|
+
}
|
|
2729
|
+
.hb-lede { font-size: 1.15rem; line-height: 1.6; color: var(--hb-ink-muted); margin: 0; }
|
|
1403
2730
|
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
2731
|
+
.hb-home h2 {
|
|
2732
|
+
font-family: var(--hb-font-display);
|
|
2733
|
+
font-size: 1.3rem;
|
|
2734
|
+
margin: 0 0 0.75rem;
|
|
2735
|
+
color: var(--hb-ink-warm);
|
|
2736
|
+
}
|
|
2737
|
+
.hb-home h2 a { color: inherit; }
|
|
2738
|
+
.hb-home h2 a:hover { color: var(--hb-accent); }
|
|
1408
2739
|
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
2740
|
+
.hb-cards { list-style: none; margin: 0 0 3rem; padding: 0; display: grid; gap: 0.75rem;
|
|
2741
|
+
grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
|
|
2742
|
+
.hb-cards a {
|
|
2743
|
+
display: block;
|
|
2744
|
+
height: 100%;
|
|
2745
|
+
padding: 1rem 1.1rem;
|
|
2746
|
+
background: var(--hb-panel);
|
|
2747
|
+
border: 1px solid var(--hb-border);
|
|
2748
|
+
border-radius: var(--hb-radius-lg);
|
|
2749
|
+
box-shadow: var(--hb-shadow);
|
|
2750
|
+
color: var(--hb-ink-warm);
|
|
2751
|
+
text-decoration: none;
|
|
2752
|
+
}
|
|
2753
|
+
.hb-cards a:hover { border-color: var(--hb-accent); text-decoration: none; }
|
|
2754
|
+
.hb-card-title { display: block; font-weight: 600; margin-bottom: 0.25rem; }
|
|
2755
|
+
.hb-card-summary { display: block; font-size: 0.9rem; color: var(--hb-ink-muted); }
|
|
1416
2756
|
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
import { dirname as dirname2, join as join3, relative as relative2 } from "path";
|
|
1422
|
-
import { fileURLToPath } from "url";
|
|
1423
|
-
import { injectPageDemo, pageDemoBootstrapSource } from "@bendyline/gezel";
|
|
2757
|
+
.hb-areas { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
|
|
2758
|
+
.hb-area-blurb { color: var(--hb-ink-muted); margin: 0 0 0.6rem; font-size: 0.95rem; }
|
|
2759
|
+
.hb-arealist { list-style: none; margin: 0 0 0.5rem; padding: 0; font-size: 0.95rem; }
|
|
2760
|
+
.hb-arealist li { margin: 0.2rem 0; }
|
|
1424
2761
|
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
/url\("\.\/([a-z0-9-]+\.woff2)"\)/g,
|
|
1432
|
-
(_, name) => `url("data:font/woff2;base64,${readFileSync(join2(fonts, name)).toString("base64")}")`
|
|
1433
|
-
);
|
|
1434
|
-
return [
|
|
1435
|
-
faces,
|
|
1436
|
-
readFileSync(join2(fonts, "typography-tokens.css"), "utf8"),
|
|
1437
|
-
readFileSync(join2(fonts, "page-defaults.css"), "utf8")
|
|
1438
|
-
].join("\n");
|
|
2762
|
+
.hb-footer {
|
|
2763
|
+
border-top: 1px solid var(--hb-border);
|
|
2764
|
+
padding: 1.5rem;
|
|
2765
|
+
text-align: center;
|
|
2766
|
+
font-size: 0.85rem;
|
|
2767
|
+
color: var(--hb-ink-quiet);
|
|
1439
2768
|
}
|
|
2769
|
+
.hb-footer p { margin: 0; }
|
|
1440
2770
|
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
const fonts = fileURLToPath(new URL("../../ui/src/assets/fonts/", import.meta.url));
|
|
1445
|
-
const css = sourceMode ? buildProjectPageTypography(fileURLToPath(new URL("../../ui", import.meta.url))) : readFileSync2(new URL("./page-typography.css", import.meta.url), "utf8");
|
|
1446
|
-
const versioned = (stem, extension, source) => ({
|
|
1447
|
-
path: `${stem}-${createHash2("sha256").update(source).digest("hex").slice(0, 16)}.${extension}`,
|
|
1448
|
-
bytes: Buffer.from(source)
|
|
1449
|
-
});
|
|
1450
|
-
return [
|
|
1451
|
-
versioned("bootstrap", "js", pageDemoBootstrapSource()),
|
|
1452
|
-
versioned("typography", "css", css),
|
|
1453
|
-
...["LICENSE-HankenGrotesk-OFL-1.1.txt", "LICENSE-PTSerif-OFL-1.1.txt"].map((path) => ({
|
|
1454
|
-
path,
|
|
1455
|
-
bytes: readFileSync2(sourceMode ? join3(fonts, path) : new URL(`./${path}`, import.meta.url))
|
|
1456
|
-
}))
|
|
1457
|
-
];
|
|
1458
|
-
}
|
|
1459
|
-
async function writePageDemoAssets(directory) {
|
|
1460
|
-
const assets = pageDemoAssets();
|
|
1461
|
-
await mkdir2(directory, { recursive: true });
|
|
1462
|
-
for (const asset of assets) await writeFile2(join3(directory, asset.path), asset.bytes);
|
|
1463
|
-
return assets;
|
|
2771
|
+
@media (max-width: 68rem) {
|
|
2772
|
+
.hb-layout { grid-template-columns: 13rem minmax(0, 1fr); }
|
|
2773
|
+
.hb-onthispage { display: none; }
|
|
1464
2774
|
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
throw new Error(`Unsafe demo asset path: ${file.path}`);
|
|
1471
|
-
}
|
|
1472
|
-
const target = join3(directory, file.path);
|
|
1473
|
-
let bytes = file.bytes;
|
|
1474
|
-
if (/\.html?$/i.test(file.path)) {
|
|
1475
|
-
const url = (name) => relative2(dirname2(target), join3(shared.directory, name)).split(/[\\/]/).map((part) => part === ".." ? part : encodeURIComponent(part)).join("/");
|
|
1476
|
-
bytes = Buffer.from(
|
|
1477
|
-
injectPageDemo(bytes.toString("utf8"), config, {
|
|
1478
|
-
scriptUrl: url(script.path),
|
|
1479
|
-
styleUrl: url(style.path)
|
|
1480
|
-
})
|
|
1481
|
-
);
|
|
1482
|
-
}
|
|
1483
|
-
await mkdir2(dirname2(target), { recursive: true });
|
|
1484
|
-
await writeFile2(target, bytes);
|
|
1485
|
-
}
|
|
2775
|
+
@media (max-width: 48rem) {
|
|
2776
|
+
.hb-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding: 1.25rem 1rem 3rem; }
|
|
2777
|
+
.hb-sidebar { position: static; max-height: none; overflow: visible; }
|
|
2778
|
+
.hb-article { padding: 1.5rem 1.25rem 2rem; }
|
|
2779
|
+
.hb-hero h1 { font-size: 2rem; }
|
|
1486
2780
|
}
|
|
2781
|
+
`;
|
|
1487
2782
|
|
|
1488
2783
|
// src/handboek-export.ts
|
|
1489
2784
|
var NAV_INLINE_MAX = 40;
|
|
1490
2785
|
var SCORECARD_SCRIPT = "scorecard.js";
|
|
2786
|
+
var PLAYER_SCRIPT = "squisq-player.js";
|
|
1491
2787
|
function pageScripts(body) {
|
|
1492
|
-
return
|
|
2788
|
+
return [
|
|
2789
|
+
...body.includes(SCORECARD_DATA_ATTRS3.root) ? [SCORECARD_SCRIPT] : [],
|
|
2790
|
+
// Deferred scripts run in order: the player must exist before the mount.
|
|
2791
|
+
...body.includes(DATA_TABLE_ATTR) ? [PLAYER_SCRIPT, DATA_TABLE_SCRIPT] : []
|
|
2792
|
+
];
|
|
1493
2793
|
}
|
|
1494
2794
|
var AREA_BLURBS = {
|
|
1495
2795
|
conceptual: "What gezel is, who your crew are, and how the pieces fit together.",
|
|
@@ -1502,7 +2802,7 @@ var AREA_BLURBS = {
|
|
|
1502
2802
|
var START_HERE = ["welcome", "the-crew", "projects-and-threads", "craftbooks-overview"];
|
|
1503
2803
|
var WORDMARK = "gezel";
|
|
1504
2804
|
async function runHandboekExport(opts) {
|
|
1505
|
-
const out =
|
|
2805
|
+
const out = resolve2(opts.out);
|
|
1506
2806
|
const css = opts.css ?? [];
|
|
1507
2807
|
const siteUrl = opts.siteUrl;
|
|
1508
2808
|
const contentDir = findHandboekContent();
|
|
@@ -1519,9 +2819,10 @@ async function runHandboekExport(opts) {
|
|
|
1519
2819
|
});
|
|
1520
2820
|
const toc = await engine.toc();
|
|
1521
2821
|
const site = await buildSiteCatalog(catalog);
|
|
2822
|
+
site.pages.push(...scorecardRoundSitePages(loadScorecardRoundNotes(contentDir)));
|
|
1522
2823
|
const sitePages = new Map(site.pages.map((p) => [p.entry.id, p]));
|
|
1523
2824
|
const demos = new Map(site.demos.map((d) => [`project-type/${d.projectTypeId}`, d]));
|
|
1524
|
-
const demoAssetsDirectory =
|
|
2825
|
+
const demoAssetsDirectory = join5(out, "_gezel-demo");
|
|
1525
2826
|
const demoAssets = site.demos.length ? await writePageDemoAssets(demoAssetsDirectory) : [];
|
|
1526
2827
|
const areas = toc.areas.map((a) => ({
|
|
1527
2828
|
...a,
|
|
@@ -1540,10 +2841,12 @@ async function runHandboekExport(opts) {
|
|
|
1540
2841
|
const stem = e.id.split("/").pop();
|
|
1541
2842
|
if (stem && !byStem.has(stem)) byStem.set(stem, e.id);
|
|
1542
2843
|
}
|
|
1543
|
-
await
|
|
1544
|
-
await
|
|
1545
|
-
await
|
|
2844
|
+
await mkdir4(join5(out, "assets"), { recursive: true });
|
|
2845
|
+
await writeFile4(join5(out, "assets", PLAYER_SCRIPT), PLAYER_BUNDLE, "utf8");
|
|
2846
|
+
await writeFile4(join5(out, "assets", SCORECARD_SCRIPT), SCORECARD_FILTER_JS, "utf8");
|
|
2847
|
+
await writeFile4(join5(out, "assets", DATA_TABLE_SCRIPT), DATA_TABLE_JS, "utf8");
|
|
1546
2848
|
const skipped = [];
|
|
2849
|
+
const warnings = [];
|
|
1547
2850
|
let pages = 0;
|
|
1548
2851
|
const headlines = readOgHeadlines(contentDir);
|
|
1549
2852
|
const canonicalBase = normalizeBase(opts.canonicalBase);
|
|
@@ -1567,27 +2870,38 @@ async function runHandboekExport(opts) {
|
|
|
1567
2870
|
entry.id,
|
|
1568
2871
|
ids,
|
|
1569
2872
|
byStem,
|
|
1570
|
-
(asset) => existsSync2(
|
|
2873
|
+
(asset) => existsSync2(join5(contentDir, asset))
|
|
1571
2874
|
);
|
|
1572
2875
|
const parsed = parseMarkdown(markdown);
|
|
2876
|
+
const doc = markdownToDoc(parsed, {
|
|
2877
|
+
articleId: article.id,
|
|
2878
|
+
defaultDuration: article.defaultDuration ?? 6
|
|
2879
|
+
});
|
|
1573
2880
|
const demo = demos.get(entry.id);
|
|
1574
2881
|
const art = entry.id.startsWith("craftbook/") ? site.craftbookArt.get(entry.id.slice("craftbook/".length)) : void 0;
|
|
1575
2882
|
let rendered = wrapTables(
|
|
1576
2883
|
extractBody(markdownDocToPlainHtml(parsed, { title: article.title }))
|
|
1577
2884
|
);
|
|
2885
|
+
rendered = insertDataTables(
|
|
2886
|
+
rendered,
|
|
2887
|
+
await dataTableMounts(doc, contentDir, (note) => warnings.push(`${entry.id}: ${note}`))
|
|
2888
|
+
);
|
|
1578
2889
|
if (sitePage?.html) rendered = `${rendered}
|
|
1579
2890
|
${sitePage.html}`;
|
|
1580
|
-
if (demo)
|
|
1581
|
-
|
|
2891
|
+
if (demo) {
|
|
2892
|
+
const appsPage = opts.appsOut ? `/apps/${demo.projectTypeId}/` : void 0;
|
|
2893
|
+
rendered = insertDemoSection(rendered, demoSectionHtml(demo, entry.title, appsPage));
|
|
2894
|
+
}
|
|
2895
|
+
if (art) rendered = insertAfterTitle(rendered, craftbookArtHtml(entry.title, art.ground));
|
|
1582
2896
|
const { html: body, headings } = withHeadingIds(rendered);
|
|
1583
|
-
const dir =
|
|
1584
|
-
await
|
|
1585
|
-
if (art) await
|
|
2897
|
+
const dir = join5(out, ...entry.id.split("/"));
|
|
2898
|
+
await mkdir4(dir, { recursive: true });
|
|
2899
|
+
if (art) await writeFile4(join5(dir, CRAFTBOOK_ART_FILE), art.bytes);
|
|
1586
2900
|
if (demo) {
|
|
1587
2901
|
await writePageDemo(
|
|
1588
|
-
|
|
2902
|
+
join5(dir, "demo"),
|
|
1589
2903
|
demo.files,
|
|
1590
|
-
{ imports: demo.imports },
|
|
2904
|
+
{ imports: demo.imports, ...demo.companion ? { companion: demo.companion } : {} },
|
|
1591
2905
|
{
|
|
1592
2906
|
directory: demoAssetsDirectory,
|
|
1593
2907
|
assets: demoAssets
|
|
@@ -1604,8 +2918,8 @@ ${sitePage.html}`;
|
|
|
1604
2918
|
image: ogBase ? `${ogBase}${ogCardPath(entry.id)}` : void 0,
|
|
1605
2919
|
imageAlt: headline
|
|
1606
2920
|
} : void 0;
|
|
1607
|
-
await
|
|
1608
|
-
|
|
2921
|
+
await writeFile4(
|
|
2922
|
+
join5(dir, "index.html"),
|
|
1609
2923
|
articlePage({
|
|
1610
2924
|
entry,
|
|
1611
2925
|
body,
|
|
@@ -1619,14 +2933,10 @@ ${sitePage.html}`;
|
|
|
1619
2933
|
}),
|
|
1620
2934
|
"utf8"
|
|
1621
2935
|
);
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
defaultDuration: article.defaultDuration ?? 6
|
|
1625
|
-
});
|
|
1626
|
-
await writeFile3(
|
|
1627
|
-
join4(dir, "watch.html"),
|
|
2936
|
+
await writeFile4(
|
|
2937
|
+
join5(dir, "watch.html"),
|
|
1628
2938
|
generateExternalHtml(doc, {
|
|
1629
|
-
playerScriptPath: `${up(depth)}assets
|
|
2939
|
+
playerScriptPath: `${up(depth)}assets/${PLAYER_SCRIPT}`,
|
|
1630
2940
|
mode: "slideshow",
|
|
1631
2941
|
title: article.title,
|
|
1632
2942
|
autoPlay: true,
|
|
@@ -1648,19 +2958,30 @@ ${sitePage.html}`;
|
|
|
1648
2958
|
headline: "The Gezel Handboek"
|
|
1649
2959
|
});
|
|
1650
2960
|
}
|
|
1651
|
-
await
|
|
2961
|
+
await writeFile4(join5(out, "index.html"), landingPage(areas, css, siteUrl, landingSocial), "utf8");
|
|
1652
2962
|
pages += 1;
|
|
1653
|
-
const assetsSrc =
|
|
2963
|
+
const assetsSrc = join5(contentDir, "assets");
|
|
1654
2964
|
if (existsSync2(assetsSrc)) {
|
|
1655
|
-
await cp(assetsSrc,
|
|
2965
|
+
await cp(assetsSrc, join5(out, "assets"), { recursive: true });
|
|
1656
2966
|
}
|
|
1657
|
-
await
|
|
2967
|
+
await writeFile4(join5(out, "assets", "handboek.css"), BASELINE_CSS, "utf8");
|
|
2968
|
+
await writeFile4(
|
|
2969
|
+
join5(out, CATALOG_COUNTS_FILE),
|
|
2970
|
+
`${JSON.stringify(site.counts, null, 2)}
|
|
2971
|
+
`,
|
|
2972
|
+
"utf8"
|
|
2973
|
+
);
|
|
1658
2974
|
const cards = ogBase && opts.ogOut ? await writeOgCards({
|
|
1659
2975
|
home: opts.home ?? gezelHome(),
|
|
1660
|
-
dir:
|
|
2976
|
+
dir: resolve2(opts.ogOut),
|
|
1661
2977
|
plans: cardPlans
|
|
1662
2978
|
}) : void 0;
|
|
1663
|
-
|
|
2979
|
+
const apps = opts.appsOut ? await writeAppsSite(catalog, site, {
|
|
2980
|
+
out: resolve2(opts.appsOut),
|
|
2981
|
+
docsBase: "/docs/",
|
|
2982
|
+
...canonicalBase ? { siteOrigin: new URL(canonicalBase).origin } : {}
|
|
2983
|
+
}) : void 0;
|
|
2984
|
+
return { out, pages, skipped, warnings, cards, apps };
|
|
1664
2985
|
}
|
|
1665
2986
|
var LANDING_CARD_ID = "index";
|
|
1666
2987
|
function normalizeBase(base) {
|
|
@@ -1691,7 +3012,7 @@ function splitLinkSuffix(raw) {
|
|
|
1691
3012
|
}
|
|
1692
3013
|
var PUBLISHED_HANDBOEK = "https://gezel.com/docs/";
|
|
1693
3014
|
var up = (depth) => "../".repeat(depth);
|
|
1694
|
-
var
|
|
3015
|
+
var esc2 = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1695
3016
|
function extractBody(page) {
|
|
1696
3017
|
const match = page.match(/<body[^>]*>([\s\S]*)<\/body>/i);
|
|
1697
3018
|
return (match?.[1] ?? page).trim();
|
|
@@ -1719,7 +3040,7 @@ function withHeadingIds(body) {
|
|
|
1719
3040
|
used.set(base, seen + 1);
|
|
1720
3041
|
const id = seen === 0 ? base : `${base}-${seen + 1}`;
|
|
1721
3042
|
headings.push({ id, text, level: Number(lvl) });
|
|
1722
|
-
return `<h${lvl}${attrs ?? ""} id="${
|
|
3043
|
+
return `<h${lvl}${attrs ?? ""} id="${esc2(id)}">${inner}</h${lvl}>`;
|
|
1723
3044
|
}
|
|
1724
3045
|
);
|
|
1725
3046
|
return { html, headings };
|
|
@@ -1734,30 +3055,30 @@ function resolveCssHref(href, depth) {
|
|
|
1734
3055
|
return `${up(depth)}${href}`;
|
|
1735
3056
|
}
|
|
1736
3057
|
function cssLinks(css, depth) {
|
|
1737
|
-
return [`${up(depth)}assets/handboek.css`, ...css.map((h) => resolveCssHref(h, depth))].map((href) => `<link rel="stylesheet" href="${
|
|
3058
|
+
return [`${up(depth)}assets/handboek.css`, ...css.map((h) => resolveCssHref(h, depth))].map((href) => `<link rel="stylesheet" href="${esc2(href)}">`).join("\n");
|
|
1738
3059
|
}
|
|
1739
3060
|
function socialTags(description, social) {
|
|
1740
3061
|
const title = social.title;
|
|
1741
3062
|
const lines = [
|
|
1742
|
-
`<link rel="canonical" href="${
|
|
3063
|
+
`<link rel="canonical" href="${esc2(social.url)}">`,
|
|
1743
3064
|
'<meta property="og:type" content="article">',
|
|
1744
3065
|
'<meta property="og:site_name" content="Gezel">',
|
|
1745
|
-
`<meta property="og:url" content="${
|
|
1746
|
-
`<meta property="og:title" content="${
|
|
1747
|
-
`<meta name="twitter:title" content="${
|
|
3066
|
+
`<meta property="og:url" content="${esc2(social.url)}">`,
|
|
3067
|
+
`<meta property="og:title" content="${esc2(title)}">`,
|
|
3068
|
+
`<meta name="twitter:title" content="${esc2(title)}">`
|
|
1748
3069
|
];
|
|
1749
3070
|
if (description) {
|
|
1750
|
-
lines.push(`<meta property="og:description" content="${
|
|
1751
|
-
lines.push(`<meta name="twitter:description" content="${
|
|
3071
|
+
lines.push(`<meta property="og:description" content="${esc2(description)}">`);
|
|
3072
|
+
lines.push(`<meta name="twitter:description" content="${esc2(description)}">`);
|
|
1752
3073
|
}
|
|
1753
3074
|
if (social.image) {
|
|
1754
3075
|
const alt = social.imageAlt ?? title;
|
|
1755
|
-
lines.push(`<meta property="og:image" content="${
|
|
3076
|
+
lines.push(`<meta property="og:image" content="${esc2(social.image)}">`);
|
|
1756
3077
|
lines.push(`<meta property="og:image:width" content="${OG_CARD_WIDTH}">`);
|
|
1757
3078
|
lines.push(`<meta property="og:image:height" content="${OG_CARD_HEIGHT}">`);
|
|
1758
|
-
lines.push(`<meta property="og:image:alt" content="${
|
|
1759
|
-
lines.push(`<meta name="twitter:image" content="${
|
|
1760
|
-
lines.push(`<meta name="twitter:image:alt" content="${
|
|
3079
|
+
lines.push(`<meta property="og:image:alt" content="${esc2(alt)}">`);
|
|
3080
|
+
lines.push(`<meta name="twitter:image" content="${esc2(social.image)}">`);
|
|
3081
|
+
lines.push(`<meta name="twitter:image:alt" content="${esc2(alt)}">`);
|
|
1761
3082
|
}
|
|
1762
3083
|
lines.push(
|
|
1763
3084
|
`<meta name="twitter:card" content="${social.image ? "summary_large_image" : "summary"}">`
|
|
@@ -1765,24 +3086,24 @@ function socialTags(description, social) {
|
|
|
1765
3086
|
return `
|
|
1766
3087
|
${lines.join("\n")}`;
|
|
1767
3088
|
}
|
|
1768
|
-
function
|
|
3089
|
+
function head2(title, css, depth, description, social) {
|
|
1769
3090
|
return `<!DOCTYPE html>
|
|
1770
3091
|
<html lang="en">
|
|
1771
3092
|
<head>
|
|
1772
3093
|
<meta charset="UTF-8">
|
|
1773
3094
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
1774
|
-
<title>${
|
|
1775
|
-
<meta name="description" content="${
|
|
3095
|
+
<title>${esc2(title)}</title>${description ? `
|
|
3096
|
+
<meta name="description" content="${esc2(description)}">` : ""}${social ? socialTags(description, social) : ""}
|
|
1776
3097
|
${cssLinks(css, depth)}
|
|
1777
3098
|
</head>`;
|
|
1778
3099
|
}
|
|
1779
|
-
function
|
|
3100
|
+
function masthead2(areas, depth, siteUrl, currentArea) {
|
|
1780
3101
|
const links = areas.map((a) => {
|
|
1781
3102
|
const target = areaLanding(a);
|
|
1782
3103
|
const current = a.area === currentArea ? ' aria-current="true"' : "";
|
|
1783
|
-
return `<a${current} href="${up(depth)}${
|
|
3104
|
+
return `<a${current} href="${up(depth)}${esc2(target)}/">${esc2(a.title)}</a>`;
|
|
1784
3105
|
}).join("\n");
|
|
1785
|
-
const wordmark = siteUrl ? `<a class="hb-wordmark" href="${
|
|
3106
|
+
const wordmark = siteUrl ? `<a class="hb-wordmark" href="${esc2(siteUrl)}">${WORDMARK}</a>
|
|
1786
3107
|
` : "";
|
|
1787
3108
|
return `<header class="hb-masthead">
|
|
1788
3109
|
${wordmark}<a class="hb-brand" href="${up(depth)}">Gezel Handboek</a>
|
|
@@ -1804,8 +3125,8 @@ function sidebar(areas, entry, depth) {
|
|
|
1804
3125
|
const isCurrent = area.area === entry.area;
|
|
1805
3126
|
const items = isCurrent && area.entries.length <= NAV_INLINE_MAX ? area.entries : isCurrent ? dedupeById([...area.entries.filter((e) => e.id === areaLanding(area)), entry]) : [];
|
|
1806
3127
|
const list = items.length ? sidebarEntryList(items, entry.id, depth) : "";
|
|
1807
|
-
const more = isCurrent && area.entries.length > NAV_INLINE_MAX ? `<p class="hb-more"><a href="${up(depth)}${
|
|
1808
|
-
const heading = isCurrent ? `<h2 class="hb-current">${
|
|
3128
|
+
const more = isCurrent && area.entries.length > NAV_INLINE_MAX ? `<p class="hb-more"><a href="${up(depth)}${esc2(areaLanding(area))}/">All ${articleCount(area)} ${esc2(area.title.toLowerCase())}</a></p>` : "";
|
|
3129
|
+
const heading = isCurrent ? `<h2 class="hb-current">${esc2(area.title)}</h2>` : `<h2><a href="${up(depth)}${esc2(areaLanding(area))}/">${esc2(area.title)}</a></h2>`;
|
|
1809
3130
|
return `<section>
|
|
1810
3131
|
${heading}
|
|
1811
3132
|
${list}
|
|
@@ -1838,7 +3159,7 @@ function sidebarEntryList(entries, currentId, depth) {
|
|
|
1838
3159
|
(a, b) => a.order - b.order || a.title.localeCompare(b.title)
|
|
1839
3160
|
)) {
|
|
1840
3161
|
items.push(`<li class="hb-sidebar-subcategory">
|
|
1841
|
-
<h3 class="hb-sidebar-subcategory-title">${
|
|
3162
|
+
<h3 class="hb-sidebar-subcategory-title">${esc2(group.title)}</h3>
|
|
1842
3163
|
<ul>
|
|
1843
3164
|
${group.entries.map((entry) => sidebarEntryLink(entry, currentId, depth)).join("\n")}
|
|
1844
3165
|
</ul>
|
|
@@ -1850,7 +3171,7 @@ ${items.join("\n")}
|
|
|
1850
3171
|
}
|
|
1851
3172
|
function sidebarEntryLink(entry, currentId, depth) {
|
|
1852
3173
|
const current = entry.id === currentId ? ' class="hb-current" aria-current="page"' : "";
|
|
1853
|
-
return `<li><a${current} href="${up(depth)}${
|
|
3174
|
+
return `<li><a${current} href="${up(depth)}${esc2(entry.id)}/">${esc2(entry.title)}</a></li>`;
|
|
1854
3175
|
}
|
|
1855
3176
|
function dedupeById(list) {
|
|
1856
3177
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -1858,7 +3179,7 @@ function dedupeById(list) {
|
|
|
1858
3179
|
}
|
|
1859
3180
|
function onThisPage(headings) {
|
|
1860
3181
|
if (headings.length < 2) return "";
|
|
1861
|
-
const items = headings.map((h) => `<li class="hb-h${h.level}"><a href="#${
|
|
3182
|
+
const items = headings.map((h) => `<li class="hb-h${h.level}"><a href="#${esc2(h.id)}">${esc2(h.text)}</a></li>`).join("\n");
|
|
1862
3183
|
return `<aside class="hb-onthispage">
|
|
1863
3184
|
<nav aria-label="On this page">
|
|
1864
3185
|
<h2>On this page</h2>
|
|
@@ -1872,15 +3193,15 @@ function articlePage(args) {
|
|
|
1872
3193
|
const { entry, body, headings, areas, depth, css, siteUrl, social, scripts } = args;
|
|
1873
3194
|
const area = areas.find((a) => a.area === entry.area);
|
|
1874
3195
|
const aside = onThisPage(headings);
|
|
1875
|
-
const scriptTags = scripts.map((name) => `<script defer src="${up(depth)}assets/${
|
|
1876
|
-
return `${
|
|
3196
|
+
const scriptTags = scripts.map((name) => `<script defer src="${up(depth)}assets/${esc2(name)}"></script>`).join("\n");
|
|
3197
|
+
return `${head2(`${entry.title} \u2014 Gezel Handboek`, css, depth, entry.summary, social)}
|
|
1877
3198
|
<body class="hb hb-article-page">
|
|
1878
|
-
${
|
|
3199
|
+
${masthead2(areas, depth, siteUrl, entry.area)}
|
|
1879
3200
|
<div class="hb-layout">
|
|
1880
3201
|
${sidebar(areas, entry, depth)}
|
|
1881
3202
|
<main class="hb-main">
|
|
1882
3203
|
<nav class="hb-breadcrumb" aria-label="Breadcrumb">
|
|
1883
|
-
<a href="${up(depth)}">Handboek</a>${area ? ` <span>/</span> <a href="${up(depth)}${
|
|
3204
|
+
<a href="${up(depth)}">Handboek</a>${area ? ` <span>/</span> <a href="${up(depth)}${esc2(areaLanding(area))}/">${esc2(area.title)}</a>` : ""}
|
|
1884
3205
|
</nav>
|
|
1885
3206
|
<article class="hb-article">
|
|
1886
3207
|
${body}
|
|
@@ -1889,12 +3210,12 @@ ${body}
|
|
|
1889
3210
|
</main>
|
|
1890
3211
|
${aside}
|
|
1891
3212
|
</div>
|
|
1892
|
-
${
|
|
3213
|
+
${footer2(depth)}
|
|
1893
3214
|
${scriptTags}
|
|
1894
3215
|
</body>
|
|
1895
3216
|
</html>`;
|
|
1896
3217
|
}
|
|
1897
|
-
function
|
|
3218
|
+
function footer2(depth) {
|
|
1898
3219
|
return `<footer class="hb-footer">
|
|
1899
3220
|
<p><a href="${up(depth)}">Gezel Handboek</a> \u2014 documentation for gezel, a crew of AI companions that works for you, from your own computer.</p>
|
|
1900
3221
|
</footer>`;
|
|
@@ -1908,7 +3229,7 @@ function landingPage(areas, css, siteUrl, social) {
|
|
|
1908
3229
|
<h2>Start here</h2>
|
|
1909
3230
|
<ul class="hb-cards">
|
|
1910
3231
|
${startHere.map(
|
|
1911
|
-
(e) => `<li><a href="${
|
|
3232
|
+
(e) => `<li><a href="${esc2(e.id)}/"><span class="hb-card-title">${esc2(e.title)}</span>${e.summary ? `<span class="hb-card-summary">${esc2(e.summary)}</span>` : ""}</a></li>`
|
|
1912
3233
|
).join("\n")}
|
|
1913
3234
|
</ul>
|
|
1914
3235
|
</section>` : "";
|
|
@@ -1917,18 +3238,18 @@ ${startHere.map(
|
|
|
1917
3238
|
const featured = area.entries.filter((e) => e.id !== landing);
|
|
1918
3239
|
const listed = area.entries.length <= NAV_INLINE_MAX ? featured.slice(0, 8) : [];
|
|
1919
3240
|
const list = listed.length ? `<ul class="hb-arealist">
|
|
1920
|
-
${listed.map((e) => `<li><a href="${
|
|
3241
|
+
${listed.map((e) => `<li><a href="${esc2(e.id)}/">${esc2(e.title)}</a></li>`).join("\n")}
|
|
1921
3242
|
</ul>` : "";
|
|
1922
3243
|
return `<section class="hb-area">
|
|
1923
|
-
<h2><a href="${
|
|
1924
|
-
<p class="hb-area-blurb">${
|
|
3244
|
+
<h2><a href="${esc2(landing)}/">${esc2(area.title)}</a></h2>
|
|
3245
|
+
<p class="hb-area-blurb">${esc2(AREA_BLURBS[area.area] ?? "")}</p>
|
|
1925
3246
|
${list}
|
|
1926
|
-
<p class="hb-more"><a href="${
|
|
3247
|
+
<p class="hb-more"><a href="${esc2(landing)}/">Browse all ${articleCount(area)} ${esc2(area.title.toLowerCase())}</a></p>
|
|
1927
3248
|
</section>`;
|
|
1928
3249
|
}).join("\n");
|
|
1929
|
-
return `${
|
|
3250
|
+
return `${head2("Gezel Handboek", css, 0, "Documentation for gezel \u2014 a crew of AI companions that works for you, from your own computer.", social)}
|
|
1930
3251
|
<body class="hb hb-home">
|
|
1931
|
-
${
|
|
3252
|
+
${masthead2(areas, 0, siteUrl)}
|
|
1932
3253
|
<main class="hb-main hb-home-main">
|
|
1933
3254
|
<section class="hb-hero">
|
|
1934
3255
|
<h1>The Gezel Handboek</h1>
|
|
@@ -1939,7 +3260,7 @@ ${startBlock}
|
|
|
1939
3260
|
${areaBlocks}
|
|
1940
3261
|
</div>
|
|
1941
3262
|
</main>
|
|
1942
|
-
${
|
|
3263
|
+
${footer2(0)}
|
|
1943
3264
|
</body>
|
|
1944
3265
|
</html>`;
|
|
1945
3266
|
}
|