Converts HTML files into high-fidelity PPTX decks by rendering CSS layouts as retina images using Playwright and Chromium.
- GitHub stars
- 72
- Files
- 8
- Last commit
- Nov 10, 2026
- License
- MIT
- Allowed tools
- —
What does the lov-html2pptx skill do?
lov-html2pptx converts HTML files into high-fidelity PPTX decks by rendering CSS layouts as retina images using Playwright and Chromium.
Summary generated from the skill's SKILL.md.
About the lov-html2pptx skill
Converting HTML mockups into high-fidelity PowerPoint presentations is what this skill enables for designers and developers. By using Playwright and Chromium to render web content, it captures CSS layouts, webfonts, gradients, and SVG elements as retina-quality images. This ensures that complex designs using flexbox or grid remain pixel-perfect when embedded into a .pptx deck.
An agent should load this skill when a user provides an HTML file or asks to build a deck from web code. The tool offers two distinct workflows: a direct conversion via html2pptx.py for quick exports, and an interactive mode using edit_html.py. The latter provides a local live editor where users can tweak HTML in a browser with a side-by-side preview before clicking an export button. The process relies on python-pptx for file generation and requires Chromium to be installed via Playwright to handle the rendering engine.
What an agent can do with it
- 1Convert HTML mockups to PPTXTransform a polished HTML design into a professional slide deck with one command.
- 2Iterate on slide designs liveUse a browser-based editor to modify HTML code and see real-time updates before exporting.
- 3Maintain complex CSS layoutsEnsure that advanced web layouts like CSS grid and custom webfonts are preserved in the final presentation.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the lov-html2pptx skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the lov-html2pptx skill in Plugin
/plugin marketplace add lovstudio/skills /plugin install office-automation@lovstudio
Install the lov-html2pptx skill in Claude Code
~/.claude/skills/lov-html2pptx/SKILL.md
$ npx degit lovstudio/skills/skills/html2pptx ~/.claude/skills/lov-html2pptxInstall the lov-html2pptx skill in Claude Code (project)
.claude/skills/lov-html2pptx/SKILL.md
$ npx degit lovstudio/skills/skills/html2pptx .claude/skills/lov-html2pptxInstall the lov-html2pptx skill in Codex
~/.agents/skills/lov-html2pptx/SKILL.md
$ npx degit lovstudio/skills/skills/html2pptx ~/.agents/skills/lov-html2pptxInstall the lov-html2pptx skill in Gemini CLI
~/.gemini/skills/lov-html2pptx/SKILL.md
$ npx degit lovstudio/skills/skills/html2pptx ~/.gemini/skills/lov-html2pptxInstall the lov-html2pptx skill in Claude.ai
npx degit lovstudio/skills/skills/html2pptx lov-html2pptx && zip -r lov-html2pptx.zip lov-html2pptx # claude.ai → Customize → Skills → + → Create skill → Upload a skill → lov-html2pptx.zip
Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the scripts before you let an agent run them. How checks work · What to fix for more points
- Source repository linked and reachablelovstudio/skills/skills/html2pptx is public and reachablegithub.com/lovstudio/skills/tree/HEAD/skills/html2pptx ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit 2026-11-10github.com/lovstudio/skills/commits ↗Pass
- No download-and-run or credential theft in scripts2 scripts read; no download-and-run, remote eval, base64 execution or credential uploadPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/lovstudio/skills/blob/HEAD/skills/html2pptx/SKILL ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/lovstudio/skills/blob/HEAD/skills/html2pptx/SKILL ↗Pass
- SKILL.md follows the Agent Skills formatname "lov-html2pptx" differs from the folder "html2pptx"github.com/lovstudio/skills/blob/HEAD/skills/html2pptx/SKILL ↗Finding
SKILL.md
View on GitHub网页转幻灯 · HTML to Slides
Render any HTML file into a polished .pptx deck. One .slide element →
one pptx page. Each page is screenshotted at 1920×1080 @ 2× by Chromium
and embedded as a full-bleed image, so CSS-grid layouts, webfonts and SVG
all reproduce pixel-perfect.
Two modes:
- Direct: HTML in, PPTX out (
html2pptx.py). - Interactive: live editor in the browser with a Save / Export PPTX
toolbar (
edit_html.py).
When to Use
- User has a polished HTML mockup and wants it as PPTX.
- User wants pixel-perfect control over slide design via CSS — going beyond
what
python-pptxtemplate hacks allow. - User wants to iterate on slides interactively in the browser.
- User says: "用 html 做 ppt", "html 转 pptx", "把这个 html 导出成幻灯片", "build a deck from this html", "edit html ppt", "html2pptx".
Workflow (MANDATORY)
You MUST follow these steps in order:
Step 1 — Confirm dependencies
If this is the first run on the machine, install:
pip install playwright python-pptx --break-system-packages
python3 -m playwright install chromium
The skill won't work without Chromium downloaded by Playwright.
Step 2 — Ask the user (use AskUserQuestion)
Collect these BEFORE running the script:
| Question | Header | Options |
|---|---|---|
| One-shot conversion or live editor? | Mode | Direct convert / Live editor |
| Slide size? | Size | 1920×1080 (16:9, default) / 1280×720 / 1024×768 (4:3) / Custom |
| How are slides separated in the HTML? | Split mode | Auto-detect (default) / By selector (.slide) / Single page |
Skip questions whose answer is obvious from context (e.g. user already provided a path AND said "convert it" → mode = direct).
Step 3 — Run
Direct mode:
python3 scripts/html2pptx.py \
--input path/to/deck.html \
--output ./output/deck.pptx \
--size 1920x1080 \
--scale 2
Live editor mode:
python3 scripts/edit_html.py \
--input path/to/deck.html
The editor opens at http://127.0.0.1:5757 with two panes (HTML on the
left, live preview on the right) and an Export PPTX button. If
--input doesn't exist, a starter template is created.
Step 4 — Output location
Per the user's global convention, write deliverables to
./output/articles/ or ./output/data/. PPTX files default to
./output/品牌方-{topic}-{YYYY-MM-DD}-v0.1.pptx.
Slide Splitting Rules
--split |
Behavior |
|---|---|
auto (default) |
If .slide, section.slide, or [data-slide] matches → use selector. Otherwise single. |
selector |
Each element matching --selector becomes one pptx page (its width/height are forced to the slide size before screenshot). |
single |
Render the whole HTML as ONE pptx page. |
CLI Reference — html2pptx.py
| Argument | Default | Description |
|---|---|---|
--input, -i |
(required) | Source .html path |
--output, -o |
(required) | Destination .pptx path |
--size |
1920x1080 |
Slide pixel dimensions WxH |
--scale |
2.0 |
Device pixel ratio (2.0 = retina) |
--split |
auto |
auto / selector / single |
--selector |
.slide, section.slide, [data-slide] |
CSS selector for slide elements |
CLI Reference — edit_html.py
| Argument | Default | Description |
|---|---|---|
--input, -i |
(required) | .html to edit (created if missing) |
--port |
5757 |
Server port |
--host |
127.0.0.1 |
Bind host |
--size |
1920x1080 |
Forwarded to html2pptx.py on export |
--scale |
2.0 |
Forwarded |
--split |
auto |
Forwarded |
--selector |
.slide, section.slide, [data-slide] |
Forwarded |
--no-open |
off | Don't auto-open browser |
HTML Template Pattern
Recommended pattern — full example at references/example.html:
<style>
.slide {
width: 1920px; height: 1080px;
padding: 80px;
page-break-after: always;
}
</style>
<section class="slide cover">…</section>
<section class="slide body">…</section>
The renderer forces each slide's width/height to match --size before
screenshot, so out-of-flow children (absolutely positioned, transforms,
etc.) are still cropped correctly.
Dependencies
pip install playwright python-pptx --break-system-packages
python3 -m playwright install chromium
Troubleshooting
- "selector matched 0 elements" — your HTML doesn't use
.slide. Pass--split singleor supply a custom--selector ".your-class". - Webfont didn't load — make sure your
@import/<link>is reachable. The renderer waits fornetworkidleanddocument.fonts.ready, but external fonts still need network access. - Chinese characters render as boxes — install a CJK system font or
embed one via
@font-face. PingFang SC / Noto Sans CJK work well. - Output pptx looks blurry on a 4K monitor — bump
--scale 3.
Runtime context (shared)
运行前读取本 Skill 包的 skill.yaml,由宿主提供 skill-runtime/v1 上下文。字段解析顺序为:当前请求、项目上下文、个人 Preferences、品牌 Profile、通用默认值。
- 只使用 Manifest 声明的字段;Profile 保存公开品牌事实,Preferences 保存个人工作偏好。
required: true字段缺失时,按 Manifest 的问题配置向用户提出一个聚焦问题;用户明确同意后再保存回答。- 报错提供可复制的
context_id、字段路径与来源,诊断内容避开秘密、完整私人路径和原始配置。
Files in this skill
8lov-html2pptx skill questions
How do I install the lov-html2pptx skill in Claude Code?
Run npx degit lovstudio/skills/skills/html2pptx ~/.claude/skills/lov-html2pptx. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the lov-html2pptx skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
How does the tool ensure CSS layouts like flexbox or grid are preserved?
It uses a real browser engine (Playwright/Chromium) to render each slide as a high-resolution retina image, ensuring all CSS properties survive intact.
Can I edit the HTML before exporting to PPTX?
Yes, the tool includes a local live editor (edit_html.py) that allows you to tweak HTML in a browser with a live preview and a one-click export button.
What should I do if my HTML slides are not being detected?
If the selector matches zero elements, ensure your HTML uses the .slide class or provide a custom selector using the --selector argument.
How can I fix blurry output on high-resolution monitors?
You can increase the device pixel ratio by using the --scale argument with a higher value, such as 3.