Skip to content

xicheng412/html2pptx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTML to PPTX Converter

This is a command-line tool to convert structured HTML slides into a PowerPoint (.pptx) presentation.

Installation

It is recommended to use uv to install the dependencies.

uv pip install -r requirements.txt

Usage

python html2ppt.py -i <input.html> -o <output.pptx>

Example

python html2ppt.py -i example.html -o presentation.pptx

This will convert the example.html file into a presentation.pptx file.

Supported HTML Structure

The tool expects a specific HTML structure to correctly identify slides and content. Each slide should be a <section> tag within a div with the class slides.

The following HTML tags are supported:

  • <h1>, <h2>, <h3>, <h4>: Slide titles
  • <p>: Paragraphs
  • <ul>, <ol>, <li>: Lists
  • <img>: Images (both local and remote)
  • data-background-color: Slide background color

For more details, please refer to the example.html file.

About

convert html to pptx with python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published