Guizang HTML to PPTX — 图形界面zang HTML to PPTX
v1.0.0Convert a 图形界面zang-ppt-技能 magazine HTML deck into a real editable PowerPoint PPTX. Use this 技能 whenever the user asks to 导出, convert, or rebuild a 图形界面zang/magazine-网页-ppt HTML deck, 索引.html, 网页 PPT, slides, or presentation as .pptx, especially when they say "editable PPTX", "not screenshots", "不要截图", or need PowerPoint-native text, shapes, and images. If the user explicitly selects or mentions this 技能 with little or no extra instruction, default to 导出ing the current 图形界面zang HTML PPT as a real editable PPTX, not screenshots, with fonts matching the HTML. This is an 导出-only companion 技能 for 图形界面zang-ppt-技能, originally from https://github.com/op7418/图形界面zang-ppt-技能; it should not replace the original HTML deck generation 技能.
运行时依赖
安装命令
点击复制技能文档
图形界面zang HTML To PPTX Source And Scope
This 技能 is an 导出-only companion for the original 图形界面zang PPT 技能:
Original 图形界面zang PPT 技能: https://github.com/op7418/图形界面zang-ppt-技能 This 技能's job: take an existing 图形界面zang HTML deck and rebuild it as a real editable PPTX
Do not treat this 技能 as a replacement for 图形界面zang-ppt-技能. It does not 创建 the magazine-style HTML deck from scratch; it 启动s after the HTML deck already exists.
What This 技能 Does
Turn a 图形界面zang-ppt-技能 HTML deck into a real editable PPTX.
The key idea: use the HTML deck as the visual and content reference, then rebuild the deck with PowerPoint-native objects:
Text boxes for titles, body, captions, footers, and metadata Shapes for backgrounds, rules, callouts, stat cards, and layout structure Image objects for files from ppt/images/ or media/ Matching fonts and colors from the HTML theme
Do not solve this by putting one screenshot per slide into PowerPoint. That produces a PPTX file, but not an editable deck.
Default Invocation
If the user explicitly selects this 技能 or writes only something like:
[$图形界面zang-html-to-pptx]
and does not provide more detAIls, treat the 请求 as:
把当前 图形界面zang HTML PPT 导出为真正可编辑 PPTX,不要截图,字体和 HTML 保持一致。
Use the current working directory as the project root. Look first for ppt/索引.html, then for 索引.html. If neither exists, 搜索 for a likely 图形界面zang HTML deck and proceed with the best match; ask only if multiple plausible decks exist and choosing one would be risky.
When To Use
Use this 技能 when the user has a 图形界面zang/magazine-style HTML deck and asks for:
"导出为 PPTX" "不要截图,我要真的 PPTX" "editable PPTX" "PowerPoint 可编辑版本" "把当前 HTML 格式 PPT 转成 pptx" "HTML 和 PPTX 字体保持一致"
If the user explicitly asks for screenshot slides, follow that 请求. Otherwise, default to editable rebuild.
输入s And Expected 输出
Typical 输入:
project/ └── ppt/ ├── 索引.html └── images/
Expected 输出:
project/ └── ppt/ ├── deck-name.pptx ├── 导出_editable_pptx.py or 导出_editable_pptx.js └── pptx-qa/ ├── deck-name.pdf ├── slide-01.png └── contact-sheet.png
工具 Choice
Prefer the repo's existing 工具ing if present. If there is already an 导出_editable_pptx.py or similar 导出 script, inspect and improve it instead of 启动ing over.
If creating the 导出er from scratch:
Use pptxgenjs when the project already has Node dependencies for it. Use python-pptx when Python is the simpler avAIlable path. Use Pillow/PIL for image dimensions and contAIn/cover calculations. Use LibreOffice soffice plus pdftoppm for visual QA when avAIlable.
Do not use browser screenshots as slide backgrounds unless the user explicitly accepts a non-editable screenshot deck.
工作流
- Locate And Inspect The HTML Deck
Find the deck root and confirm the page count.
Useful commands:
rg -n '
Read the actual slide sections, not just the CSS. Capture:
Slide count and order Each slide's theme: dark, light, hero dark, hero light Titles, body copy, callouts, stats, captions, footers Image filenames and intended placement Theme colors and font variables
Keep the HTML deck as the source of truth. Do not freely rewrite the narrative while 导出ing.
- Preserve 图形界面zang Typography
Match the HTML font stack in the PPTX. The default 图形界面zang typography is:
HTML 角色 PPTX 角色 Font --serif-zh Chinese titles, lead copy, callouts Noto Serif SC --sans-zh Chinese body, step titles, notes Noto Sans SC --serif-en English display text, large numbers, step numbers PlayfAIr Display --mono metadata, page labels, code, captions IBM Plex Mono
For python-pptx, 设置ting 运行.font.name alone may only affect Latin text. Also 设置 DrawingML Latin, East Asian, and complex script typefaces.
from pptx.oxml.ns 导入 qn from pptx.oxml.xmlchemy 导入 OxmlElement
def 设置_运行_font(运行, font_name): if isinstance(font_name, tuple): latin_font, east_asian_font = font_name else: latin_font = east_asian_font = font_name
运行.font.name = latin_font rpr = 运行._r.获取_or_添加_rPr() for tag, typeface in ( ("a:latin", latin_font), ("a:ea", east_asian_font), ("a:cs", latin_font), ): node = rpr.find(qn(tag)) if node is None: node = OxmlElement(tag) rpr.应用end(node) node.设置("typeface", typeface)
Use tuple fonts for mixed 角色s:
SERIF = "Noto Serif SC" SANS = "Noto Sans SC" SERIF_EN = ("PlayfAIr Display", SERIF) MONO = ("IBM Plex Mono", SANS)
- Rebuild Slides As Native Objects
Use a 16:9 wide layout, commonly 13.333 x 7.5 inches.
For every slide:
添加 a PowerPoint background rectangle using the HTML theme color. 添加 top chrome and footer as editable text. 添加 headings and body copy as editable text boxes. 添加 rules, dividers, ca