[Bug][pdf-plugin] pdf.py 引用不存在的 html2pdf.js,convert.html 入口对所有用户失效
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, python
- Domain
- cli
Research direction
The stale reference is in pdf.py: the convert.html path (around L1878-1882) builds js_path from html2pdf.js, and a second use near L2086-2088 does the same. Confirm the scripts directory only contains html2pdf-next.js, then point every html2pdf.js reference at html2pdf-next.js. Done when python pdf.py convert.html any.html -o out.pdf produces a PDF instead of the DependencyMissing error.
Written by the indexing model from the issue text.
Description
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 分支同样存在
- Dominant language
- Python
- Stars
- 103
- Forks
- 78
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from zai-org/zcode-plugins
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
zai-org/zcode-plugins#107 ·
Maintainers usually reply within 1 day
-
video-agent-kit (0.4.3): hooks invoke python3, which doesn't exist on Windows — SessionStart/UserPromptSubmit/Stop hooks fail on every triggerPossibly taken @dvd233 claimed this 26 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
zai-org/zcode-plugins#14 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 74/100
zai-org/zcode-plugins#109 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 18/100
zai-org/zcode-plugins#105 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
zai-org/zcode-plugins#88 · 1 comment ·
Maintainers usually reply within 1 day
All issues in zai-org/zcode-plugins
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Status: Triaged Type: Enhancement
Difficulty 1/5 Under an hour Newbie friendliness 82/100
canonical/craft-store#448 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
good first issue research size:s skill:numerics sub-issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
SKaiNET-developers/SKaiNET#1372 ·
Maintainers usually reply within 1 day
-
debt
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoft/vscode-flake8#601 ·
Maintainers usually reply within 1 day