Repository navigation
feat: add review-rendered-diff skill - #1252
Merged
Merged
Conversation
…on rendered pages Builds a page before and after a PO change in isolation (temp locale_dirs, no changes to the working tree or ../cpython), then highlights each changed paragraph on the real rendered HTML and screenshots it: - small edits as inline red/green diffs - new translations and heavy rewrites as stacked before/after blocks Also lists the skill in README and ignores its default output dir. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014pJTfUKUkCc4HFprcvhxRe
josix
marked this pull request as ready for review
October 26, 2026 15:22
- Treat fuzzy msgstr as untranslated, since Sphinx does not render it - Pick the closest, not-yet-highlighted block when the snippet appears in several paragraphs (asdict/astuple, class C/D __init__ examples) - Ignore URLs when measuring CJK share, so short Chinese text around a long URL is not labelled as English - Show whitespace-only changes as ␣ instead of an empty colored box - Resolve --out to an absolute path - Fix ruff warnings (explicit check=False, narrow Playwright exception) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014pJTfUKUkCc4HFprcvhxRe
mattwang44
previously approved these changes
Oct 27, 2026
`uv run <script>` now installs polib, beautifulsoup4, playwright and pillow itself, so the --no-project/--with flags are no longer needed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014pJTfUKUkCc4HFprcvhxRe
mattwang44
approved these changes
Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
Review 翻譯 PR 時,通常只看得到
.po的 diff。但 reST 標記、斷行、全半形標點的效果,要 render 成網頁後才看得出來,例如括號在頁面上的實際寬度、強調語法是否生效。目前只能手動make build、自己開頁面比對,很難把結果分享到 PR 上。這個 PR 做了什麼
新增
review-rendered-diffskill(.claude/skills/review-rendered-diff/)。它會把 po 檔的翻譯修改 render 成實際的 Python 文件頁面,直接在頁面上標示差異,並為每個修改的段落截圖。相依套件以 PEP 723 inline metadata 宣告在 script 開頭,
uv run會自動安裝。依修改的類型,自動選擇呈現方式:
其他特點:
locale_dirs,只 build 那一頁。不會覆蓋工作目錄裡的 po,也不會像make build那樣把 po 硬連結進../cpython。--base <sha>^ --new <sha>)。其他修改:
README.rst:在「使用 Skills 協助翻譯」章節加入這個 skill,並補上第三步的使用範例。.gitignore:忽略 skill 的預設輸出目錄.render-review/。Codex 透過
.codex/skills符號連結載入 skill,所以也會自動載入這個 skill。驗證
howto/logging.po新翻譯):143 段用「原文/譯文」區塊,3 段短標題用行內標示,1 段整段改寫用「修改前/修改後」,沒有段落被跳過。表格內的條目放在儲存格裡,表格結構不受影響。howto/logging.po的小幅修正):7 段都用行內紅綠標示。::結尾時找不到段落的 bug,也指出 SKILL.md 有幾處不清楚,都已修正。ruff check:通過。🤖 Generated with Claude Code
https://claude.ai/code/session_014pJTfUKUkCc4HFprcvhxRe