当前位置: 首页 > Skill >

Guizang HTML to PPTX

Guizang HTML to PPTX

Guizang HTML to PPTX

将 guizang-ppt-skill 杂志 HTML 幻灯片转换为可编辑的 PowerPoint PPTX文件。当用户请求导出、转换或重新构建时使用此技能。

1.0.0 2026.11.23 195
获取Skill文件查看使用说明
作 者:许知 许可证: 更新时间:2026.11.23
本文目录展开

Guizang HTML To PPTX

Source And Scope

This skill is an export-only companion for the original guizang PPT skill:

  • Original guizang PPT skill: https://github.com/op7418/guizang-ppt-skill
  • This skill's job: take an existing guizang HTML deck and rebuild it as a real editable PPTX

Do not treat this skill as a replacement for guizang-ppt-skill. It does not create the magazine-style HTML deck from scratch; it starts after the HTML deck already exists.

What This Skill Does

Turn a guizang-ppt-skill 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 skill or writes only something like:

[$guizang-html-to-pptx]

and does not provide more details, treat the request as:

把当前 guizang HTML PPT 导出为真正可编辑 PPTX,不要截图,字体和 HTML 保持一致。

Use the current working directory as the project root. Look first for ppt/index.html, then for index.html. If neither exists, search for a likely guizang 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 skill when the user has a guizang/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 request. Otherwise, default to editable rebuild.

Inputs And Expected Output

Typical input:

project/
└── ppt/
    ├── index.html
    └── images/

Expected output:

project/
└── ppt/
    ├── deck-name.pptx
    ├── export_editable_pptx.py or export_editable_pptx.js
    └── pptx-qa/
        ├── deck-name.pdf
        ├── slide-01.png
        └── contact-sheet.png

Tool Choice

Prefer the repo's existing tooling if present. If there is already an export_editable_pptx.py or similar export script, inspect and improve it instead of starting over.

If creating the exporter 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.

Workflow

1. Locate And Inspect The HTML Deck

Find the deck root and confirm the page count.

Useful commands:

rg -n '<section class="slide|class="slide' ppt/index.html
rg -n 'font-family|--serif|--sans|--mono|--ink|--paper' ppt/index.html
rg -n 'images/|media/' ppt/index.html

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 exporting.

2. Preserve Guizang Typography

Match the HTML font stack in the PPTX. The default guizang typography is:

HTML role PPTX role 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, setting run.font.name alone may only affect Latin text. Also set DrawingML Latin, East Asian, and complex script typefaces.

from pptx.oxml.ns import qn
from pptx.oxml.xmlchemy import OxmlElement

def set_run_font(run, font_name):
    if isinstance(font_name, tuple):
        latin_font, east_asian_font = font_name
    else:
        latin_font = east_asian_font = font_name

    run.font.name = latin_font
    rpr = run._r.get_or_add_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.append(node)
        node.set("typeface", typeface)

Use tuple fonts for mixed roles:

SERIF = "Noto Serif SC"
SANS = "Noto Sans SC"
SERIF_EN = ("Playfair Display", SERIF)
MONO = ("IBM Plex Mono", SANS)

3. Rebuild Slides As Native Objects

Use a 16:9 wide layout, commonly 13.333 x 7.5 inches.

For every slide:

  • Add a PowerPoint background rectangle using the HTML theme color.
  • Add top chrome and footer as editable text.
  • Add headings and body copy as editable text boxes.
  • Add rules, dividers, callout blocks, and stat cards as PowerPoint shapes.
  • Insert source images as separate image objects, not baked into a full-slide screenshot.
  • Keep images visually related to the slide content.

Preserve the slide count unless the user asks for a different count.

4. Fit Images Deliberately

Use contain for screenshots, product UI, charts, and anything that must remain legible. Use cover only for decorative or full-bleed imagery.

For screenshots:

  • Keep the whole UI visible whenever possible.
  • Add a subtle panel background if the screenshot needs contrast.
  • Avoid repeating the same image across adjacent slides unless the HTML intentionally does so.
  • Do not swap in unrelated images to "fill space".

5. Validate Editability

After generating the PPTX, check that it is not a screenshot deck.

Good signs:

  • Each slide has many text/shape objects.
  • Slide text appears in PPTX XML.
  • Images correspond to source assets, not 15 full-slide PNG screenshots.

Quick XML text/font check:

python3 - <<'PY'
from pathlib import Path
from zipfile import ZipFile

pptx = Path("ppt/deck-name.pptx")
with ZipFile(pptx) as z:
    slides = [n for n in z.namelist() if n.startswith("ppt/slides/slide") and n.endswith(".xml")]
    xml = "n".join(z.read(n).decode("utf-8", "ignore") for n in slides)

print("slides", len(slides))
for needle in ["Songti SC", "PingFang SC", "Noto Serif SC", "Noto Sans SC", "IBM Plex Mono", "Playfair Display"]:
    print(needle, xml.count(needle))
PY

Old fallback fonts from a prior export should not remain if the HTML uses the guizang defaults.

6. Visual QA

Render the PPTX and inspect it. Font changes often create wrapping or overflow, so QA after every font or layout pass.

mkdir -p ppt/pptx-qa
soffice --headless --convert-to pdf --outdir ppt/pptx-qa ppt/deck-name.pptx
pdftoppm -png -r 120 ppt/pptx-qa/deck-name.pdf ppt/pptx-qa/slide

Create a contact sheet and inspect it for:

  • Missing slides
  • Wrong page order
  • Text overflow or clipped titles
  • Font mismatch against HTML
  • Lines crossing text
  • Images too small, repeated, stretched, or unrelated
  • Footer/chrome collisions
  • Placeholder text

If soffice fails inside a sandbox because it needs system cache access, rerun it with the required approval instead of skipping QA.

7. Deliver Clearly

In the final response, state:

  • The PPTX path
  • That it is a real editable PPTX, not screenshot slides
  • Any caveat about fonts needing to be installed on the user's machine
  • What QA was performed

Example:

已导出真正可编辑 PPTX:文字、形状和图片都是独立对象,不是整页截图。
字体已对齐 HTML:Noto Serif SC / Noto Sans SC / Playfair Display / IBM Plex Mono。
我已转 PDF/PNG 做过 15 页目检,没有发现明显溢出或错位。

Common Pitfalls

  • Screenshot deck: Fast, but wrong for "editable PPTX".
  • Font drift: HTML uses Noto Serif SC, but PPTX silently falls back to Songti or PingFang. Set East Asian fonts explicitly.
  • Over-rewriting: Exporting should preserve the approved HTML content and structure.
  • Image mismatch: Do not use decorative images where the HTML used evidence screenshots.
  • Skipping QA: PPTX layout bugs often only show up after rendering through PowerPoint/LibreOffice.
  • Expecting WebGL/animations to export: Rebuild the static visual result; PPTX will not preserve the HTML shader or Motion One page animations.

更多 AI SEO 技能详见:https://domainrank.app/ai-seo-skills

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,013
Skill 文件
  • SKILL.md
    • Guizang HTML To PPTX
    • Source And Scope
    • What This Skill Does
    • Default Invocation
    • When To Use
    • Inputs And Expected Output
    • Tool Choice
    • Workflow
      • 1. Locate And Inspect The HTML Deck
      • 2. Preserve Guizang Typography
      • 3. Rebuild Slides As Native Objects
      • 4. Fit Images Deliberately
      • 5. Validate Editability
      • 6. Visual QA
      • 7. Deliver Clearly
    • Common Pitfalls
  • 项目或源文件

相关 Skill

更多
Powerpoint / PPTX Powerpoint / PPTX 创建、检查和编辑 Microsoft PowerPoint 演示文稿及 PPTX 文件,支持可靠的布局、模板、占位符、备注、图表和视觉质检。使用...
PPTX to Image Converter PPTX to Image Converter 在Windows上将PowerPoint PPTX文件转换为高质量JPG或PNG图像,支持自定义DPI设置,保持原始幻灯片比例和方向。
PowerPoint Template Master Fixer PowerPoint Template Master Fixer Repair and maintain PowerPoint PPTX templates with slide masters, placeholders, theme fonts, theme colors, chart links, and branded layouts. Use when Codex n...
Ppt Ocr Ppt Ocr OCR for PowerPoint (.ppt, .pptx) presentations with scanned or image-embedded slides. Uses MinerU to extract text from image-based presentation content. Feat...
ppt-turn-web-generator ppt-turn-web-generator 从操作流程、截图、视频、链接、参考图片和分步文档生成可重用的分页HTML教程指南。适用于...