feat: 整合 Demo 终端输出到 PPT
CI / test (push) Has been cancelled Details

- 新增 2 页终端风格输出(社区周报 + Release Notes 真实数据)
- 模拟终端界面(圆点标题栏 + 彩色语法高亮)
- PPT 从 17 页扩展到 19 页
- 演示时无需切换浏览器查看输出结果

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
赵昌 2026-06-30 10:32:51 +08:00
parent fa31e09dc4
commit 2bedb68ef7
2 changed files with 66 additions and 2 deletions

View File

@ -268,7 +268,71 @@ outputs.forEach((o, i) => {
s11.addText(o[1], { x: x + 0.15, y: 2.15, w: 1.9, h: 2.4, fontSize: 11, color: C.lightBlue, fontFace: "Consolas", align: "left" });
});
// ===== Slide 12: 子任务四 - 科研 =====
// ===== Slide 12: 终端输出 - 周报 =====
let s12r = pres.addSlide();
s12r.background = { fill: C.navy };
s12r.addNotes("这是社区周报的实际输出数据。\\n综合评分 3.5/10因为项目较新、Star 较少、且未检测到开源许可证。");
s12r.addText("社区周报 · 实际输出", { x: 0.8, y: 0.3, w: 8, h: 0.5, fontSize: 22, bold: true, color: C.white, fontFace: "Consolas" });
s12r.addShape(pres.shapes.RECTANGLE, { x: 0.8, y: 0.8, w: 1.2, h: 0.04, fill: { color: C.teal } });
s12r.addText("$ cat _output/weekly-health-report.md", { x: 0.8, y: 1.0, w: 8, h: 0.3, fontSize: 10, color: C.gray, fontFace: "Consolas" });
// Terminal box
s12r.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 0.5, y: 1.4, w: 9.0, h: 3.8, fill: { color: "0A0E17" }, line: { color: "1E293B", width: 1 } });
// Title bar dots
[["FF5F57","FFBD2E","28C840"],["1E2A3A","1E2A3A","1E2A3A"]].forEach((row,ri) => row.forEach((c,ci) => {
s12r.addShape(pres.shapes.OVAL, { x: 0.7 + ci*0.2, y: 1.55 + ri*0.01, w: 0.1, h: 0.1, fill: { color: c } });
}));
const rptLines = [
["# 综合评分3.5/10 🔴 堪忧", "F96167"],
["", ""],
["| 指标 | 数据 |","94A3B8"],
["|---------------|-----------------------|","94A3B8"],
["| Issue 总数 | 19关闭 4/打开 15 |","94A3B8"],
["| 关闭率 | 21% 🔴 偏低 |","EF4444"],
["| PR 总数 | 2合并 0 |","94A3B8"],
["| 贡献者数 | 1 人 |","94A3B8"],
["| 平均响应 | 24.3 天 🟡 正常 |","F59E0B"],
["", ""],
["# Issue 分析评分3/10","3B82F6"],
["# PR 分析评分3/10","3B82F6"],
["# 贡献者活跃度评分3/10","3B82F6"],
];
rptLines.forEach((l, i) => {
if (l[0]) s12r.addText(l[0], { x: 0.8, y: 1.8 + i*0.22, w: 8, h: 0.22, fontSize: 9, color: l[1], fontFace: "Consolas", margin: 0 });
});
// ===== Slide 13: 终端输出 - Release Notes =====
let s13r = pres.addSlide();
s13r.background = { fill: C.navy };
s13r.addNotes("Release Notes 从提交历史自动生成。\\n100 次提交、7 位贡献者、204 个文件变更。\\n版本推荐v0.1.0(有 feat 次版本+1。");
s13r.addText("Release Notes · 实际输出", { x: 0.8, y: 0.3, w: 8, h: 0.5, fontSize: 22, bold: true, color: C.white, fontFace: "Consolas" });
s13r.addShape(pres.shapes.RECTANGLE, { x: 0.8, y: 0.8, w: 1.2, h: 0.04, fill: { color: C.blue } });
s13r.addText("$ cat _output/release-notes-v0.1.0.md", { x: 0.8, y: 1.0, w: 8, h: 0.3, fontSize: 10, color: C.gray, fontFace: "Consolas" });
s13r.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 0.5, y: 1.4, w: 9.0, h: 3.8, fill: { color: "0A0E17" }, line: { color: "1E293B", width: 1 } });
[["FF5F57","FFBD2E","28C840"],["1E2A3A","1E2A3A","1E2A3A"]].forEach((row,ri) => row.forEach((c,ci) => {
s13r.addShape(pres.shapes.OVAL, { x: 0.7 + ci*0.2, y: 1.55 + ri*0.01, w: 0.1, h: 0.1, fill: { color: c } });
}));
const rnLines = [
["## v0.1.0 (2026-06-30)", "22C55E"],
["", ""],
["### 版本概览","3B82F6"],
["- 基于 v0.0.0,包含 100 次提交","94A3B8"],
["- 涉及 204 个文件","94A3B8"],
["- 新增 +16483 / 删除 -3644 行","94A3B8"],
["- 贡献者7 人","94A3B8"],
["", ""],
["### 分类统计","F59E0B"],
["✨ 新功能 20 次 (20%)","22C55E"],
["🐛 Bug 修复 19 次 (19%)","EF4444"],
["📝 文档 44 次 (44%)","3B82F6"],
["✅ 测试 3 次 (3%) ","A78BFA"],
["🔧 工程 2 次 (2%) ","F59E0B"],
["📦 其他 11 次 (11%)","94A3B8"],
];
rnLines.forEach((l, i) => {
if (l[0]) s13r.addText(l[0], { x: 0.8, y: 1.8 + i*0.22, w: 8, h: 0.22, fontSize: 9, color: l[1], fontFace: "Consolas", margin: 0 });
});
// ===== Slide 14: 子任务四 - 科研 =====
let s12 = pres.addSlide();
s12.background = { fill: C.white };
s12.addNotes("子任务四是科研辅助,是加分项。\n模块 C 是科研项目洞悉,可以采集 8 维仓库数据,从成熟度、文档质量、贡献模式和社区健康度四个维度进行评分。\n模块 D 是热点追踪与知识图谱,支持多关键词搜索并自动构建交互式知识图谱。");
@ -377,5 +441,5 @@ s17.addText("Q & A", { x: 0, y: 1.5, w: 10, h: 1.2, fontSize: 48, bold: true, co
s17.addText("感谢聆听 · 欢迎提问", { x: 0, y: 2.8, w: 10, h: 0.5, fontSize: 16, color: C.lightBlue, fontFace: "Arial", align: "center" });
// ===== Save =====
const outPath = "e:/gitlink-cli/gitlink-cli/doc/汇报PPT.pptx";
const outPath = "e:/gitlink-cli/gitlink-cli/tmp_ppt.pptx";
pres.writeFile({ fileName: outPath }).then(() => console.log("Done: " + outPath));