[Bug][pdf-plugin] pdf.py 引用不存在的 html2pdf.js,convert.html 入口对所有用户失效
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 85/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, python
- 领域
- cli
调研方向
过时的引用在 pdf.py 中:convert.html 路径(约 L1878-1882)中,js_path 由 html2pdf.js 构建,L2086-2088 附近的第二处用法也做了同样的事。请先确认 scripts 目录中只包含 html2pdf-next.js,然后将所有指向 html2pdf.js 的引用改为指向 html2pdf-next.js。当 python pdf.py convert.html any.html -o out.pdf 生成 PDF 而不是报 DependencyMissing 错误时,即为完成。
由索引模型根据 Issue 内容生成。
描述
Description
pdf.py 的 convert.html 命令引用 html2pdf.js,但插件包内的实际文件是 html2pdf-next.js。该入口随包即失效,对所有用户可复现——推测是脚本改名为 -next 版本时未同步更新引用方。
Steps to Reproduce
- 进入 pdf skill 的
scripts/目录(随 ZCode 安装包内置路径resources/glm/packages/pdf-plugin/skills/pdf/scripts/,或插件缓存副本); - 执行:
python pdf.py convert.html any.html -o out.pdf。
Expected Behavior
convert.html 走通 HTML→PDF 转换。
Actual Behavior
{ "status": "error", "error": "DependencyMissing", "message": "html2pdf.js not found in scripts directory" }
Evidence
上游 main 分支 apps/zcode-cli/packages/pdf-plugin/skills/pdf/scripts/pdf.py:
- L1878:
"""Convert HTML to PDF via node html2pdf.js.""" - L1882:
js_path = _SCRIPT_DIR / "html2pdf.js" - L2086/L2088:注释与
js_script = _SCRIPT_DIR / "html2pdf.js"
同目录文件清单只有 html2pdf-next.js,无 html2pdf.js:
https://github.com/zai-org/ZCode/tree/main/apps/zcode-cli/packages/pdf-plugin/skills/pdf/scripts
发行包 0.1.8(随安装程序内置)同样如此。直跑 html2pdf-next.js 可绕开这条入口。
Suggested Fix
将 pdf.py 中全部 html2pdf.js 引用改为 html2pdf-next.js(或在 scripts 目录提供别名文件)。实测 html2pdf-next.js 功能完整,是唯一现存入口。
Environment
- OS:Windows 11
- 版本:pdf-plugin 0.1.8(ZCode 安装包内置);上游 main 分支同样存在
- 主要语言
- Python
- 星标
- 103
- 派生
- 78
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
zai-org/zcode-plugins 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
zai-org/zcode-plugins#107 ·
维护者通常 1 天内回复
-
video-agent-kit (0.4.3): hooks invoke python3, which doesn't exist on Windows — SessionStart/UserPromptSubmit/Stop hooks fail on every trigger可能已有人在做 @dvd233 于 26 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
zai-org/zcode-plugins#14 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 74/100
zai-org/zcode-plugins#109 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 18/100
zai-org/zcode-plugins#105 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
zai-org/zcode-plugins#88 · 1 条评论 ·
维护者通常 1 天内回复
查看 zai-org/zcode-plugins 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
Status: Triaged Type: Enhancement
难度 1/5 1 小时以内 新手友好度 82/100
canonical/craft-store#448 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
good first issue research size:s skill:numerics sub-issue
难度 2/5 1-3 小时 新手友好度 78/100
SKaiNET-developers/SKaiNET#1372 ·
维护者通常 1 天内回复
-
debt
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/vscode-flake8#601 ·
维护者通常 1 天内回复