用途
md-to-modern-pptx 用于把 Markdown(.md)文档转换为排版精致的现代风格 .pptx 幻灯片。其核心流程为:用 theme-factory 选择主题配色,用 PptxGenJS 稳定生成 PPTX,再用 markitdown 做内容 QA,可选再做视觉 QA。
主要能力
- 主题选择:内置多套主题 slug,包括 ocean-depths、sunset-boulevard、forest-canopy、modern-minimalist、golden-hour、arctic-frost、desert-rose、tech-innovation、botanical-garden、midnight-galaxy,对应 ~/.agents/skills/theme-factory/themes/*.md,可在 ~/.agents/skills/theme-factory/theme-showcase.pdf 预览。
- 脚本化生成:自带脚本面向“Deep Research 风格 Markdown”,通过命令行参数指定输入文件、输出文件和主题。
- 可选配图:用 gemini-3-pro-image-preview 等文生图模型为 Detailed Analysis 页生成插画(每小节 1 张,最多 5 张),Title/Executive Summary/Key Findings/Consensus/Debate/Sources 默认不配图。配图提示词由语义、视觉风格、主题约束和硬约束(no text, no logos, no watermarks, no brand marks)组成,脚本可自动生成可手改的 plan。
- 内容 QA:用 markitdown 提取 PPTX 文本,检查段落遗漏、顺序错误、残留 Markdown 标记和占位符文本。
- 视觉 QA(可选):本机有 LibreOffice(soffice)与 Poppler(pdftoppm)时,可用 pptx skill 的 thumbnail.py 生成缩略图网格检查溢出、遮挡、边距问题。
使用方式
- 安装依赖(一次即可):
npm i pptxgenjs
python -m pip install "markitdown[pptx]"
- 生成 PPTX:
node .\skills\md-to-modern-pptx\scripts\md-deepresearch-to-pptx.js --in .\YOUR.md --out .\YOUR.pptx --theme golden-hour
若 Markdown 不符合 Deep Research 结构,需先整理为 references/deepresearch-md-contract.md 所述结构。
- 可选配图流程:
- 准备 .env(全局 ~/.agents/skills/md-to-modern-pptx/.env 或项目根目录 .env),内容参考 .env.example,包含 CHERRY_BASE_URL、CHERRY_API_KEY、CHERRY_MODEL;脚本优先读 CHERRY_* 并兼容旧的 GEMINI_* 命名。对 Gemini 生图模型默认走 POST /v1beta/models/<model>:generateContent(responseModalities=["IMAGE"]);网关不支持时回退到 OpenAI-like 的 POST /v1/images/generations(部分中转站使用 task_id 轮询)。
- 生成配图计划:
python .\skills\md-to-modern-pptx\scripts\gemini_image_pack.py make-plan --in .\YOUR.md --theme golden-hour --out .\images.plan.json
- 生成图片:
python .\skills\md-to-modern-pptx\scripts\gemini_image_pack.py generate --plan .\images.plan.json --out-dir .\images
输出命名默认与 deck 页码对齐,如 images/slide-05.png。
- 重新生成 PPTX 并自动贴图:
node .\skills\md-to-modern-pptx\scripts\md-deepresearch-to-pptx.js --in .\YOUR.md --out .\YOUR.pptx --theme golden-hour --images-dir .\images
临时不贴图可加 --no-images。
- QA:
python -m markitdown .\YOUR.pptx
python -m markitdown .\YOUR.pptx | Select-String -Pattern "xxxx|lorem|ipsum|this.*(page|slide).*layout" -CaseSensitive:$false
视觉 QA(可选):
python "$HOME\.agents\skills\pptx\scripts\thumbnail.py" .\YOUR.pptx deck-thumbs --cols 4
适用场景
适合把 Deep Research 风格的结构化 Markdown 报告转换为演示幻灯片,并希望统一主题配色、可选自动配图、附带内容与视觉质检的场合。
限制与注意事项
- 输入需符合 Deep Research 结构,否则需先整理。
- 配图能力依赖网关/中转站账号是否开通对应模型的 IMAGE 输出;若报“无可用渠道(distributor)”/model_not_found 或“not supported model for image generation”,需在网关侧开通、切换分组或更换可用模型。
- PptxGenJS 使用时颜色不要带 #,不要用 8 位 hex 夹带透明度(会损坏文件);列表用 bullet: true,别直接写“•”;不要复用同一个 options 对象(PptxGenJS 会原地 mutate)。更完整的注意事项参见 pptx skill 的 pptxgenjs.md。
- 收费、价格等信息暂未提供。