html-to-pptx-converter: Convert Structured HTML/CSS Slides to Editable PPTX

Introduction

Many presentation decks are initially authored in HTML/CSS: offering flexible layouts and easy previewing in browsers. However, when sharing externally or seeking secondary editing, recipients often require PowerPoint. Manually copying each page into PPT tends to distort layouts, and charts or lists often lose their editability.

Below is an introduction to the SkillHub community skill html-to-pptx-converter (Coordinate: @user_12336170/html-to-pptx-converter, Version 0.0.1). It uses Python to parse HTML and extract slide semantics, then leverages Node.js PptxGenJS to generate native, editable .pptx files, rather than simply embedding screenshots of entire pages.

What is this

The positioning of html-to-pptx-converter is to transform structured HTML/CSS slide content into native PowerPoint presentations.

  • Maintainer: SkillHub community publisher user_12336170, source tagged as community.
  • Category: office-efficiency.
  • API Key: Tagged requires_api_key=false; installation and usage do not rely on additional key configuration.
  • Official Entry: SkillHub Skill Page; the resource coordinate can also be noted as https://api.skillhub.cn/user_12336170/html-to-pptx-converter.

Core Features

Based on the skill description and SKILL.md, the verified capabilities include:

  1. Hybrid Pipeline: Python (BeautifulSoup) is responsible for extracting titles, bullet points, metrics, tables, and layout information from HTML; Node.js (PptxGenJS) rebuilds slides based on coordinate systems and writes out the .pptx.
  2. Native Editable Elements: Emphasizes using APIs like addShape and addText to construct graphics, avoiding screenshot-style full-page embedding, facilitating further text and color edits within PowerPoint.
  3. Layout Mapping Convention: Supports mapping HTML layouts like grid / flex to PptxGenJS X/Y coordinates (e.g., two-column split layouts); metric-based pages can utilize color blocks + large text to highlight numbers.
  4. Branding & Styling: Background colors can align with HTML background-color or gradient effects; the documentation provides unified color palette examples (e.g., hex values for PRIMARY, ACCENT, TEXT).

Installation & Activation

1. Install SkillHub CLI (if not already installed)

First, check if the CLI exists:

command -v skillhub && skillhub --version

If not installed, follow the SkillHub Installation Documentation to perform a full installation:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

If only the CLI is needed:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash -s -- --cli-only

2. Install this Skill

During installation, you must use --dir to point to the current Agent’s skills directory; otherwise, it will default to ./skills/, which the Agent may fail to recognize. The installation guide provided on the official page is: refer to the aforementioned installation documentation to install @user_12336170/html-to-pptx-converter.

The installation command shown in CLI search results is:

skillhub install html-to-pptx-converter --namespace user_12336170 --dir <your skills directory>

Common client skills paths (excerpted from SkillHub Installation Documentation):

Environment skills Directory
Cursor ~/.cursor/skills/
Claude Code ~/.claude/skills/
Codex ~/.codex/skills/ or .agents/skills/ under the project

After installation, restart or refresh the Agent according to your client’s requirements to ensure the skill is loaded.

3. Runtime Dependencies (Skill Pipeline)

The local dependencies required by the skill documentation are as follows.

Python side:

pip install beautifulsoup4 lxml

Node.js side:

npm install -g pptxgenjs

Typical Usage

The two-stage process described in the skill can be summarized as: First parse HTML to obtain structured JSON, then use PptxGenJS to write the file.

Step 1: Parse Slide HTML with Python

Use nodes with structures such as the slide class in the HTML according to conventions (documentation examples include cover-slide, content-box, two-column, etc.). Parsing logic illustration:

from bs4 import BeautifulSoup
import json

def parse_slides(html_path):
    soup = BeautifulSoup(open(html_path), 'lxml')
    slides = []
    for div in soup.find_all('div', class_='slide'):
        # Extract title, lists, metrics, tables, etc. based on layout classes, assemble into JSON list
        pass
    return slides

In actual projects, replace pass with field extraction corresponding to your HTML structure, outputting a list or JSON file ready for the next step.

Step 2: Generate PPTX with PptxGenJS

Adopt a 10” × 5.625” coordinate system, iterate through the data from the previous step to add slides:

const pptxgen = require("pptxgenjs");
let pres = new pptxgen();

const COLORS = { PRIMARY: "0F3460", ACCENT: "00D4FF", TEXT: "FFFFFF" };

data.forEach(item => {
    let slide = pres.addSlide();
    // Call slide.addText, slide.addShape, slide.addTable, etc. based on item.type
});

pres.writeFile({ fileName: "output.pptx" });

In Agents like Cursor or Claude Code with this skill enabled, you can directly describe your requirements (e.g., “Convert this HTML deck to editable PPTX, preserving the two-column and metric card styles”). The Agent will generate or complete the script based on the principles in SKILL.md. This skill does not provide a separate REST service address; interaction methods are subject to the skill documentation within the Agent.

Use Cases & Notes

Who is it for

  • Teams that already maintain or plan to maintain slide templates with HTML/CSS and need batch or semi-automatic PPTX export.
  • Scenarios where deliverables must remain editable (text, shapes, tables) in PowerPoint rather than being pasted as images page by page.

Limitations & Pitfalls (From skill documentation)

  1. Color Format: Hex colors for PptxGenJS should not include the # prefix; write them as 00D4FF.
  2. Fonts: It is recommended to use Microsoft YaHei or Arial by default to reduce font substitution issues when opening cross-platform.
  3. Table Height: Tables do not automatically reserve vertical space for subsequent elements; you need to manually increment layout variables like currentY based on the number of rows.
  4. HTML Structure: Parsing relies on agreed-upon classes and DOM structures; arbitrary web HTML cannot be converted directly without adaptation and needs to align with the parse_slides logic.

Community data displayed on the SkillHub page (based on page and scraped information): Rating 100000, approximately 1033 downloads, approximately 51 installs. Specific numbers will update over time; refer to SkillHub for the latest data.

Conclusion

html-to-pptx-converter bridges the gap between “HTML Slides” and “Editable PPTX” using Python extraction + PptxGenJS reconstruction, making it suitable for solidifying web layouts into deliverable Office files. To install or view instructions, please visit SkillHub: html-to-pptx-converter.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye