diff --git a/apps/web/client/app.css b/apps/web/client/app.css index 5601bdf8..02e19c3f 100644 --- a/apps/web/client/app.css +++ b/apps/web/client/app.css @@ -57,6 +57,7 @@ h1,h2,h3,h4{text-wrap:balance} .brand img{width:26px;height:26px} .brand-os{color:var(--blue-500);font-weight:500} :root[data-theme=dark] .brand-os{color:var(--blue-600)} +:root[data-theme=dark] :is(.brand img,.chat-welcome>img,.chat-start-emblem>img,.research-conversation-byline>img){filter:invert(.94) hue-rotate(180deg) saturate(1.18) brightness(1.06)} .topbar-actions{display:flex;align-items:center;gap:7px;min-width:0;flex-shrink:0;margin-left:auto} .workbench-entrypoints{display:flex;flex-wrap:wrap;align-items:center;gap:4px;min-width:0;margin-right:auto} body>.workbench-entrypoints{display:none} diff --git a/apps/web/client/explain.html b/apps/web/client/explain.html index 24c6babc..7aed399a 100644 --- a/apps/web/client/explain.html +++ b/apps/web/client/explain.html @@ -7,7 +7,7 @@ 证明讲解 · TheoremOS - + diff --git a/apps/web/client/formalization.html b/apps/web/client/formalization.html index b91ac1fd..370979a8 100644 --- a/apps/web/client/formalization.html +++ b/apps/web/client/formalization.html @@ -7,7 +7,7 @@ 形式化对照 · TheoremOS - + diff --git a/apps/web/client/formalize.html b/apps/web/client/formalize.html index 8de54c6d..2372d663 100644 --- a/apps/web/client/formalize.html +++ b/apps/web/client/formalize.html @@ -4,7 +4,7 @@ 自然语言 → Lean · TheoremOS - + diff --git a/apps/web/client/guide.html b/apps/web/client/guide.html index 206223fd..287b2222 100644 --- a/apps/web/client/guide.html +++ b/apps/web/client/guide.html @@ -6,7 +6,7 @@ 使用说明 · TheoremOS - + diff --git a/apps/web/client/index.html b/apps/web/client/index.html index 83a12674..9055efd1 100644 --- a/apps/web/client/index.html +++ b/apps/web/client/index.html @@ -6,7 +6,7 @@ TheoremOS · 研究工作台 - + diff --git a/apps/web/client/invite.html b/apps/web/client/invite.html index 4bb2b838..2f714950 100644 --- a/apps/web/client/invite.html +++ b/apps/web/client/invite.html @@ -3,7 +3,7 @@ - 研究邀请 · TheoremOS + 研究邀请 · TheoremOS diff --git a/apps/web/client/library.html b/apps/web/client/library.html index 914fe302..b8fcfb39 100644 --- a/apps/web/client/library.html +++ b/apps/web/client/library.html @@ -3,7 +3,7 @@ - Library · TheoremOS + Library · TheoremOS diff --git a/apps/web/client/login.html b/apps/web/client/login.html index 1ae49b21..5d1ebc20 100644 --- a/apps/web/client/login.html +++ b/apps/web/client/login.html @@ -6,7 +6,7 @@ 登录 · TheoremOS 研究工作台 - + diff --git a/apps/web/client/people.html b/apps/web/client/people.html index 086f1ce7..2ded204c 100644 --- a/apps/web/client/people.html +++ b/apps/web/client/people.html @@ -3,7 +3,7 @@ - 数学家 · TheoremOS + 数学家 · TheoremOS diff --git a/apps/web/client/practice.html b/apps/web/client/practice.html index eab74862..958b20ac 100644 --- a/apps/web/client/practice.html +++ b/apps/web/client/practice.html @@ -3,7 +3,7 @@ - 研究演练 · TheoremOS + 研究演练 · TheoremOS diff --git a/apps/web/client/privacy.html b/apps/web/client/privacy.html index b5bea7e5..25b9caf6 100644 --- a/apps/web/client/privacy.html +++ b/apps/web/client/privacy.html @@ -6,7 +6,7 @@ 隐私说明 · TheoremOS - + diff --git a/apps/web/client/problem.html b/apps/web/client/problem.html index 282cef48..7f32d373 100644 --- a/apps/web/client/problem.html +++ b/apps/web/client/problem.html @@ -3,7 +3,7 @@ - 题目工作区 · TheoremOS + 题目工作区 · TheoremOS diff --git a/apps/web/client/share.html b/apps/web/client/share.html index 1da7673a..f8df4658 100644 --- a/apps/web/client/share.html +++ b/apps/web/client/share.html @@ -7,7 +7,7 @@ 研究成果 · TheoremOS - + diff --git a/apps/web/client/terms.html b/apps/web/client/terms.html index 757aa946..bcd39eb1 100644 --- a/apps/web/client/terms.html +++ b/apps/web/client/terms.html @@ -6,7 +6,7 @@ 使用条款 · TheoremOS - + diff --git a/apps/web/client/theorems.html b/apps/web/client/theorems.html index 33ca0589..84bc3642 100644 --- a/apps/web/client/theorems.html +++ b/apps/web/client/theorems.html @@ -3,7 +3,7 @@ - 定理 · TheoremOS + 定理 · TheoremOS diff --git a/apps/web/client/workspace.html b/apps/web/client/workspace.html index 3b9a1bd8..c8c0837e 100644 --- a/apps/web/client/workspace.html +++ b/apps/web/client/workspace.html @@ -3,7 +3,7 @@ - 我的研究 · TheoremOS + 我的研究 · TheoremOS diff --git a/apps/web/preview/index.html b/apps/web/preview/index.html index 2ff461bf..a1cf37ef 100644 --- a/apps/web/preview/index.html +++ b/apps/web/preview/index.html @@ -5,7 +5,7 @@ TheoremOS · Components - + diff --git a/apps/web/staticReport.ts b/apps/web/staticReport.ts index f7d58fed..746ab84e 100644 --- a/apps/web/staticReport.ts +++ b/apps/web/staticReport.ts @@ -64,6 +64,7 @@ function mathStylesheet(web: string): string { export function staticReportHtml(root: string, report: StaticReportPage): string { const web = path.join(root, 'out/web'), pages = path.join(root, templates[report.page]); const mark = dataUri('image/svg+xml', bytes(path.join(web, 'assets/mark.svg'))); + const favicon = dataUri('image/svg+xml', bytes(path.join(web, 'assets/favicon.svg'))); // The template's tags are swapped for placeholders and checked first, so nothing inlined is read as markup. const inlined: Record = { theme: ``, @@ -74,7 +75,7 @@ export function staticReportHtml(root: string, report: StaticReportPage): string let html = read(fs.existsSync(reportTemplate) ? reportTemplate : path.join(pages, `${report.page}.html`)); if (html.includes('\0')) throw new Error('static_report_template_changed'); html = once(html, '', `\n `); - html = once(html, '', ``); + html = once(html, '', ``); html = once(html, '', '\0theme\0'); html = once(html, '', '\0style\0'); diff --git a/docs/archive.html b/docs/archive.html index 8ed5de32..d496e1d6 100644 --- a/docs/archive.html +++ b/docs/archive.html @@ -11,7 +11,7 @@ - + diff --git a/docs/assets/favicon.svg b/docs/assets/favicon.svg new file mode 100644 index 00000000..e6d19da0 --- /dev/null +++ b/docs/assets/favicon.svg @@ -0,0 +1,11 @@ + + + + + + + diff --git a/docs/assets/mark.png b/docs/assets/mark.png index 41c22d52..021c0ed6 100644 Binary files a/docs/assets/mark.png and b/docs/assets/mark.png differ diff --git a/docs/assets/mark.svg b/docs/assets/mark.svg index 176179ef..66b3baab 100644 --- a/docs/assets/mark.svg +++ b/docs/assets/mark.svg @@ -1 +1,6 @@ - + + + + + + diff --git a/docs/assets/readme-mark-dark.svg b/docs/assets/readme-mark-dark.svg index 5756e41b..910a4b10 100644 --- a/docs/assets/readme-mark-dark.svg +++ b/docs/assets/readme-mark-dark.svg @@ -1,6 +1,6 @@ - + - + diff --git a/docs/assets/readme-mark.svg b/docs/assets/readme-mark.svg index 983760cf..349a03ac 100644 --- a/docs/assets/readme-mark.svg +++ b/docs/assets/readme-mark.svg @@ -1,6 +1,6 @@ - + - + diff --git a/docs/assets/social-preview-en.png b/docs/assets/social-preview-en.png index 2ba157ae..5765654c 100644 Binary files a/docs/assets/social-preview-en.png and b/docs/assets/social-preview-en.png differ diff --git a/docs/assets/social-preview.png b/docs/assets/social-preview.png index 39378fec..ad52db36 100644 Binary files a/docs/assets/social-preview.png and b/docs/assets/social-preview.png differ diff --git a/docs/en/archive.html b/docs/en/archive.html index 202f97f8..042a173a 100644 --- a/docs/en/archive.html +++ b/docs/en/archive.html @@ -11,7 +11,7 @@ - + diff --git a/docs/en/feedback.html b/docs/en/feedback.html index c8994414..7e06d003 100644 --- a/docs/en/feedback.html +++ b/docs/en/feedback.html @@ -11,7 +11,7 @@ - + TheoremOS | Feedback diff --git a/docs/en/index.html b/docs/en/index.html index 1c4a3b48..8ca8c468 100644 --- a/docs/en/index.html +++ b/docs/en/index.html @@ -13,7 +13,7 @@ - + TheoremOS | From problems to Lean proofs diff --git a/docs/en/privacy.html b/docs/en/privacy.html index 4610e861..d8340fb1 100644 --- a/docs/en/privacy.html +++ b/docs/en/privacy.html @@ -12,7 +12,7 @@ - + TheoremOS | Privacy and terms diff --git a/docs/feedback.html b/docs/feedback.html index 4585a802..d12f4b02 100644 --- a/docs/feedback.html +++ b/docs/feedback.html @@ -11,7 +11,7 @@ - + TheoremOS | 反馈与建议 diff --git a/docs/index.html b/docs/index.html index e7c15701..447cb131 100644 --- a/docs/index.html +++ b/docs/index.html @@ -13,7 +13,7 @@ - + TheoremOS | 从原题到 Lean 证明 diff --git a/docs/privacy.html b/docs/privacy.html index ba220348..d5f2f20c 100644 --- a/docs/privacy.html +++ b/docs/privacy.html @@ -11,7 +11,7 @@ - + TheoremOS | 隐私与条款 diff --git a/docs/site.css b/docs/site.css index 7fe54699..284a1530 100644 --- a/docs/site.css +++ b/docs/site.css @@ -55,7 +55,11 @@ --orange-border: #4a3c20; --shadow: #0000004d; } +:root[data-theme="dark"] :is(.brand-mark, .brand img) { + filter: invert(.94) hue-rotate(180deg) saturate(1.18) brightness(1.06); +} @media print { + :root[data-theme="dark"] :is(.brand-mark, .brand img) { filter: none; } :root, :root[data-theme="dark"] { color-scheme: light; --paper: #faf9f5; diff --git a/docs/website.md b/docs/website.md index 24643643..99dbc059 100644 --- a/docs/website.md +++ b/docs/website.md @@ -143,7 +143,7 @@ bun run export:site /home/lzh/theorem-os-site ## 视觉素材 -`docs/assets/mark.svg` 是首页、档案与工作台共用的墨色项目标记(陶土色方块),`mark.png` 保留为位图版本。首页正文使用本地 Geist 字体,标题与品牌名的西文使用 Lora(与档案页同一文件 `TheoremOSSerif-latin.woff2`,字体名 “TheoremOS Serif Latin”),中文仍回退到思源黑体与思源宋体;2026-11-16 曾短暂使用窄体 Instrument Serif,当时首页标题与小标题的字号放大了一档,换回 Lora 后沿用(`--step-display` 72px、`--step-head` 46px、`--step-lead` 24px)。字面代码使用 Fira Code;档案页正文使用 Inter;工作台自 2026-11-16 起与首页一致,正文使用 Geist(`Geist-latin.woff2`,可变字重),代码仍使用 JetBrains Mono。档案页继续嵌入完整的 `InterVariable.woff2`,工作台不再加载 `InterVariable-latin.woff2`;该拉丁子集当初保留两个可变轴与全部排版特性,只用拉丁、拉丁扩展 A、希腊字母、通用标点、上下标、字母式符号、箭头与数学运算符(352 KB 降到 157 KB)。三处的中文正文都使用思源黑体(Noto Sans SC),以 “TheoremOS Sans SC” 的名称加载,覆盖 400–600 字重,同样按 `NotoSansSC-ui` 与 `NotoSansSC-common` 两个 unicode-range 子集拆分。档案页的标题与品牌名使用衬线字体:西文为 Lora 的拉丁子集,中文为思源宋体(Noto Serif SC)600 字重的两个子集。按 OFL 保留字体名的要求,修改后的 Lora 子集改名为 “TheoremOS Serif Latin”,中文子集为 “TheoremOS Serif SC”。工作台自 2026-11-16 起与首页一致:西文使用 “TheoremOS Serif Latin”(Lora,`TheoremOSSerif-latin.woff2`,400–700 可变字重),中文仍用 “TheoremOS Serif SC”。工作台的衬线标题(包括 `font:` 简写)统一写 `font-weight: 400`,与首页标题字重一致;这条约定始于此前使用只有 400 字重的 Instrument Serif 时,用来避免同一标题里西文常规、中文宋体变粗。工作台的 `--radius-*` 变量和写死的单值圆角统一为 4px,按钮为全圆角胶囊,头像与状态点的 50%、999px 保留。中文子集按 unicode-range 拆分:`NotoSerifSC-ui` 收录工作台与官网源码中出现的汉字,`NotoSerifSC-common` 收录其余 GB2312 一级字,仅在标题用到时加载。界面新增而不在 `-ui` 子集中的汉字由额外子集承载,当前黑体包含 150 个码位、宋体包含 148 个码位,保存在 `NotoSansSC-ui-extra.woff2` 与 `NotoSerifSC-ui-extra.woff2`(黑体约 38 KB、宋体约 30 KB,官网样式不引用),并从 `app.css` 中 `-common` 的 unicode-range 里移除,否则中文界面首次打开就会因为「轨迹」「万」这类字多下载 760 KB 的 `-common`。`tests/webFonts.test.ts` 检查界面文字(`scripts/web-i18n.ts` 列出的全部中文键)只用到 `-ui` 与 `-ui-extra`。界面再出现新字时,`-common` 文件里仍有这些字形,从中重新取出:`pyftsubset NotoSansSC-common.woff2 --unicodes=<原有加新增的码位> --layout-features='*' --flavor=woff2 --output-file=NotoSansSC-ui-extra.woff2`(宋体同理),再把新增码位从 `app.css` 的 `-common` 范围移到 `-ui-extra`。黑体的 `-ui-extra` 另含「中」「文」两字:英文界面唯一可见的中文是语言切换上的「中文」,两字的 unicode-range 从 `-ui` 移到 `-ui-extra` 后,英文页只下载约 38 KB 的 `-ui-extra`,不再为两个字下载 217 KB 的 `-ui`。这两个字不在 `-common` 文件里,不能仅用 `-common` 覆盖现有黑体 `-ui-extra`。可从 [Noto Sans SC 原始可变字体](https://github.com/google/fonts/blob/main/ofl/notosanssc/NotoSansSC%5Bwght%5D.ttf)重新生成(当前字体版本为 2.004):与 `-ui` 相同,先用 fontTools 的 instancer 把字重轴截到 400–600,再按全部码位子集化。新增的「家、纯、若、贡、献、远、础、歧、订、碍、撰、技」复用本地同版本 `-common` 字形:保留现有 `-ui-extra` 表与名称,补入字形、度量和黑体的 `gvar` 变化,并核对 400、450、500、550、600 字重下既有字形未变。字体及各自的 SIL Open Font License 保存在 `docs/assets/fonts/`。构建时将拉丁字体嵌入样式,确保直接打开本地文件时也能加载;中文子集体积较大,保留为外部文件,页面不依赖外部字体服务。 +`docs/assets/mark.svg` 是首页、档案与工作台共用的几何证明棱钻与陶土色 QED 印记(`favicon.svg` 为适配浏览器明暗标签栏的图标版本,`mark.png` 保留为位图版本)。首页正文使用本地 Geist 字体,标题与品牌名的西文使用 Lora(与档案页同一文件 `TheoremOSSerif-latin.woff2`,字体名 “TheoremOS Serif Latin”),中文仍回退到思源黑体与思源宋体;2026-11-16 曾短暂使用窄体 Instrument Serif,当时首页标题与小标题的字号放大了一档,换回 Lora 后沿用(`--step-display` 72px、`--step-head` 46px、`--step-lead` 24px)。字面代码使用 Fira Code;档案页正文使用 Inter;工作台自 2026-11-16 起与首页一致,正文使用 Geist(`Geist-latin.woff2`,可变字重),代码仍使用 JetBrains Mono。档案页继续嵌入完整的 `InterVariable.woff2`,工作台不再加载 `InterVariable-latin.woff2`;该拉丁子集当初保留两个可变轴与全部排版特性,只用拉丁、拉丁扩展 A、希腊字母、通用标点、上下标、字母式符号、箭头与数学运算符(352 KB 降到 157 KB)。三处的中文正文都使用思源黑体(Noto Sans SC),以 “TheoremOS Sans SC” 的名称加载,覆盖 400–600 字重,同样按 `NotoSansSC-ui` 与 `NotoSansSC-common` 两个 unicode-range 子集拆分。档案页的标题与品牌名使用衬线字体:西文为 Lora 的拉丁子集,中文为思源宋体(Noto Serif SC)600 字重的两个子集。按 OFL 保留字体名的要求,修改后的 Lora 子集改名为 “TheoremOS Serif Latin”,中文子集为 “TheoremOS Serif SC”。工作台自 2026-11-16 起与首页一致:西文使用 “TheoremOS Serif Latin”(Lora,`TheoremOSSerif-latin.woff2`,400–700 可变字重),中文仍用 “TheoremOS Serif SC”。工作台的衬线标题(包括 `font:` 简写)统一写 `font-weight: 400`,与首页标题字重一致;这条约定始于此前使用只有 400 字重的 Instrument Serif 时,用来避免同一标题里西文常规、中文宋体变粗。工作台的 `--radius-*` 变量和写死的单值圆角统一为 4px,按钮为全圆角胶囊,头像与状态点的 50%、999px 保留。中文子集按 unicode-range 拆分:`NotoSerifSC-ui` 收录工作台与官网源码中出现的汉字,`NotoSerifSC-common` 收录其余 GB2312 一级字,仅在标题用到时加载。界面新增而不在 `-ui` 子集中的汉字由额外子集承载,当前黑体包含 150 个码位、宋体包含 148 个码位,保存在 `NotoSansSC-ui-extra.woff2` 与 `NotoSerifSC-ui-extra.woff2`(黑体约 38 KB、宋体约 30 KB,官网样式不引用),并从 `app.css` 中 `-common` 的 unicode-range 里移除,否则中文界面首次打开就会因为「轨迹」「万」这类字多下载 760 KB 的 `-common`。`tests/webFonts.test.ts` 检查界面文字(`scripts/web-i18n.ts` 列出的全部中文键)只用到 `-ui` 与 `-ui-extra`。界面再出现新字时,`-common` 文件里仍有这些字形,从中重新取出:`pyftsubset NotoSansSC-common.woff2 --unicodes=<原有加新增的码位> --layout-features='*' --flavor=woff2 --output-file=NotoSansSC-ui-extra.woff2`(宋体同理),再把新增码位从 `app.css` 的 `-common` 范围移到 `-ui-extra`。黑体的 `-ui-extra` 另含「中」「文」两字:英文界面唯一可见的中文是语言切换上的「中文」,两字的 unicode-range 从 `-ui` 移到 `-ui-extra` 后,英文页只下载约 38 KB 的 `-ui-extra`,不再为两个字下载 217 KB 的 `-ui`。这两个字不在 `-common` 文件里,不能仅用 `-common` 覆盖现有黑体 `-ui-extra`。可从 [Noto Sans SC 原始可变字体](https://github.com/google/fonts/blob/main/ofl/notosanssc/NotoSansSC%5Bwght%5D.ttf)重新生成(当前字体版本为 2.004):与 `-ui` 相同,先用 fontTools 的 instancer 把字重轴截到 400–600,再按全部码位子集化。新增的「家、纯、若、贡、献、远、础、歧、订、碍、撰、技」复用本地同版本 `-common` 字形:保留现有 `-ui-extra` 表与名称,补入字形、度量和黑体的 `gvar` 变化,并核对 400、450、500、550、600 字重下既有字形未变。字体及各自的 SIL Open Font License 保存在 `docs/assets/fonts/`。构建时将拉丁字体嵌入样式,确保直接打开本地文件时也能加载;中文子集体积较大,保留为外部文件,页面不依赖外部字体服务。 以下截图素材已不在官网首页使用,仍供站点仓库 README、GETTING-STARTED 与反馈页引用。`workbench-desktop.png` 和 `workbench-mobile.png` 来自真实本地工作台新会话中的原题输入区域,桌面近景为 900×520 逻辑像素,手机近景为 350×520。`workbench-full-desktop.png` 与 `workbench-full-mobile.png` 为完整截图,视口分别是 1440×900 和 390×844;英文版使用对应的 `-en.png` 文件。入口与完整预览按 2 倍像素密度捕获,保留真实界面比例;测试从 PNG 读取实际像素尺寸,再与页面中的 CSS 显示尺寸比较。截图脚本启动一次性本地服务,阻止非 GET API 请求,不需要模型或 Key: diff --git a/scripts/build-web-preview.ts b/scripts/build-web-preview.ts index 859759f8..1948f188 100644 --- a/scripts/build-web-preview.ts +++ b/scripts/build-web-preview.ts @@ -13,6 +13,6 @@ await build({ entryPoints: [path.join(root, 'apps/web/preview/preview.tsx')], ou jsx: 'automatic', jsxImportSource: 'preact' }); fs.copyFileSync(path.join(root, 'apps/web/client/app.css'), path.join(output, 'app.css')); for (const file of ['index.html', 'preview.css']) fs.copyFileSync(path.join(root, 'apps/web/preview', file), path.join(output, file)); -for (const file of ['mark.svg', ...fs.readdirSync(path.join(root, 'docs/assets/fonts')).filter(name => name.endsWith('.woff2')).map(font => `fonts/${font}`)]) +for (const file of ['mark.svg', 'favicon.svg', ...fs.readdirSync(path.join(root, 'docs/assets/fonts')).filter(name => name.endsWith('.woff2')).map(font => `fonts/${font}`)]) fs.copyFileSync(path.join(root, 'docs/assets', file), path.join(output, 'assets', file)); console.log('Built component preview in out/web-preview'); diff --git a/scripts/build-web.ts b/scripts/build-web.ts index 66180614..a3f557cb 100644 --- a/scripts/build-web.ts +++ b/scripts/build-web.ts @@ -63,7 +63,7 @@ fs.writeFileSync(path.join(output, 'research.css'), ['research.css', 'collaborat const fonts = ['Geist-latin.woff2', 'Geist-OFL.txt', 'TheoremOSSerif-latin.woff2', 'Lora-OFL.txt', 'JetBrainsMono.woff2', 'JetBrainsMono-OFL.txt', 'TheoremOSWorkbenchHeading.woff2', 'NotoSerifSC-ui.woff2', 'NotoSerifSC-ui-extra.woff2', 'NotoSerifSC-common.woff2', 'NotoSerifSC-OFL.txt', 'NotoSansSC-ui.woff2', 'NotoSansSC-ui-extra.woff2', 'NotoSansSC-common.woff2', 'NotoSansSC-OFL.txt']; -for (const file of ['mark.svg', ...fonts.map(font => `fonts/${font}`)]) +for (const file of ['mark.svg', 'favicon.svg', ...fonts.map(font => `fonts/${font}`)]) fs.copyFileSync(path.join(root, 'docs/assets', file), path.join(output, 'assets', file)); fs.mkdirSync(path.join(output, 'assets/licenses'), { recursive: true }); fs.cpSync(path.join(root, 'node_modules/katex/dist/fonts'), path.join(output, 'assets/katex/fonts'), { recursive: true }); diff --git a/scripts/build-workbench-classics.ts b/scripts/build-workbench-classics.ts index eb0a0c6c..842cbaad 100644 --- a/scripts/build-workbench-classics.ts +++ b/scripts/build-workbench-classics.ts @@ -152,7 +152,7 @@ if (themeToggle) { fs.copyFileSync(path.join(root, 'docs/replay.css'), path.join(output, 'replay.css')); fs.mkdirSync(path.join(output, 'assets'), { recursive: true }); fs.cpSync(path.join(root, 'docs/assets/fonts'), path.join(output, 'assets/fonts'), { recursive: true }); - for (const file of ['mark.svg', 'replay.png', 'replay.json']) fs.copyFileSync(path.join(root, 'docs/assets', file), path.join(output, 'assets', file)); + for (const file of ['mark.svg', 'favicon.svg', 'replay.png', 'replay.json']) fs.copyFileSync(path.join(root, 'docs/assets', file), path.join(output, 'assets', file)); fs.copyFileSync(path.join(root, 'node_modules/lucide/LICENSE'), path.join(output, 'lucide-LICENSE.txt')); return catalog.records.length; } diff --git a/tests/staticReport.test.ts b/tests/staticReport.test.ts index 10fc15ee..7b41ebec 100644 --- a/tests/staticReport.test.ts +++ b/tests/staticReport.test.ts @@ -9,7 +9,7 @@ const roots: string[] = []; afterEach(() => { for (const root of roots.splice(0)) fs.rmSync(root, { recursive: true, force: true }); }); const page = (name: string, extra = '') => ['', '', '', ' ', - ` ${name}`, ' ', ' ', + ` ${name}`, ' ', ' ', ' ', '', '', ' ', `
${extra}`, ` `, '', '', ''].join('\n'); const face = (family: string, file: string) => `@font-face{font-family:${family};src:url("assets/fonts/${file}") format("woff2")}`; @@ -25,6 +25,7 @@ function build(edit: Record = {}) { 'out/web/assets/katex/katex.min.css': '@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff"),url(fonts/KaTeX_Main-Regular.ttf) format("truetype")}', 'out/web/assets/katex/fonts/KaTeX_Main-Regular.woff2': 'math-font', 'out/web/assets/mark.svg': '', + 'out/web/assets/favicon.svg': '', 'out/web/assets/fonts/Geist-latin.woff2': 'inter', 'out/web/assets/fonts/TheoremOSSerif-latin.woff2': 'serif', 'out/web/assets/fonts/JetBrainsMono.woff2': 'mono', 'out/web/assets/fonts/NotoSansSC-ui.woff2': 'noto', 'out/web/explain.html': page('explain'), 'out/web/explain.js': 'window.explainBundle = 1;', @@ -48,8 +49,8 @@ describe('static report pages', () => { expect(html).toContain(`\n `); expect(html).toContain(''); - expect(html).toContain(`')}">`); - expect(html).toContain('')}">`); + expect(html).toContain(`')}"`); for (const [file, body] of [['Geist-latin', 'inter'], ['TheoremOSSerif-latin', 'serif'], ['JetBrainsMono', 'mono']]) { expect(html).toContain(`url("data:font/woff2;base64,${base64(body!)}")`); expect(html).not.toContain(file); @@ -80,6 +81,7 @@ describe('static report pages', () => { ['a missing bundle', { 'out/web-report/formalization.js': null }, /^static_report_build_missing: .*\/out\/web-report\/formalization\.js \(run bun run build:web\)$/u], ['a missing font', { 'out/web/assets/fonts/JetBrainsMono.woff2': null }, /^static_report_build_missing: .*JetBrainsMono\.woff2/u], ['a missing mark', { 'out/web/assets/mark.svg': null }, /^static_report_build_missing: .*mark\.svg/u], + ['a missing favicon', { 'out/web/assets/favicon.svg': null }, /^static_report_build_missing: .*favicon\.svg/u], ['a missing formula runtime', { 'out/web/math.js': null }, /^static_report_build_missing: .*math\.js/u], ['a missing formula font', { 'out/web/assets/katex/fonts/KaTeX_Main-Regular.woff2': null }, /^static_report_build_missing: .*KaTeX_Main-Regular\.woff2/u], ['an external formula stylesheet asset', { 'out/web/assets/katex/katex.min.css': 'body{background:url(https://example.com/image.png)}' }, 'static_report_math_stylesheet_reference'],