Tools for converting PowerPoint presentations to HTML5 websites
Project description
pptx-to-html5
A Python tool for converting PowerPoint presentations (.pptx) to interactive HTML5 websites with accurate positioning.
Features
- 🎨 Convert PowerPoint presentations to standalone HTML5 websites
- 📐 Accurate element positioning - Preserves the layout and positioning of text boxes, images, and other elements from your slides
- 📱 Responsive design that works on desktop and mobile devices
- ⌨️ Keyboard navigation (arrow keys, space, Home, End)
- 👆 Touch/swipe support for mobile devices
- 📝 Optional speaker notes inclusion
- 🎯 Clean, modern UI with smooth transitions
- 🔄 Progress bar and slide counter
- 💻 Command-line interface for easy automation
- 📋 Bullet point support - Multi-level bullets with proper indentation
How It Works
The converter extracts individual shapes (text boxes, images, etc.) from your PowerPoint slides along with their exact positions, sizes, and formatting. These are then rendered as positioned HTML elements, maintaining the original slide layout.
- Text elements: Preserved with font size, style (bold/italic), and alignment
- Bullet points: Multi-level bullets (•, ◦, ▪) with proper indentation based on paragraph level
- Images: Embedded as base64-encoded data URIs with automatic format detection
- Positioning: Converted to percentage-based CSS positioning for responsive scaling
Requirements
- Python 3.12 or higher
- Dependencies: python-pptx, Pillow, Jinja2
Installation
From source
git clone https://github.com/shafe123/pptx-to-html5.git
cd pptx-to-html5
pip install -e .
Development installation
pip install -e ".[dev]"
Usage
Command Line
Convert a PowerPoint presentation to HTML5:
pptx-to-html presentation.pptx
Specify an output directory:
pptx-to-html presentation.pptx -o output_folder
Include speaker notes in the output:
pptx-to-html presentation.pptx --include-notes
Python API
from pptx_to_html5.converter import PowerPointToHTML5Converter
# Create converter
converter = PowerPointToHTML5Converter("presentation.pptx")
# Convert to HTML5
output_path = converter.convert("output_folder", include_notes=False)
print(f"Presentation converted to: {output_path}")
Output Structure
The converter creates a self-contained website with:
index.html- Main presentation filestyles.css- Styling and layoutscript.js- Navigation and interactivity
Simply open index.html in any modern web browser to view the presentation.
Navigation Controls
- Arrow Keys (← →): Navigate between slides
- Space Bar: Next slide
- Home: Go to first slide
- End: Go to last slide
- Mouse/Touch: Use on-screen buttons or swipe gestures
Development
Running Tests
pytest
Code Quality
The project follows PEP8 style guidelines and uses type hints throughout.
Run linting:
ruff check src/
Run type checking:
mypy src/
License
This is free and unencumbered software released into the public domain - see LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pptx_to_html5-0.1.0.tar.gz.
File metadata
- Download URL: pptx_to_html5-0.1.0.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a125d6021cfb9d754d3d3cf4f324e6c1ee17a31eb19bdbde7749d219140674f9
|
|
| MD5 |
17775a5fea8c0429714df0c378ff3f25
|
|
| BLAKE2b-256 |
9a2cc084b4496a16df63bc5ca5f77f30c875452bbf790c26a78a10dfb15b2670
|
Provenance
The following attestation bundles were made for pptx_to_html5-0.1.0.tar.gz:
Publisher:
pypi.yml on shafe123/pptx-to-html5
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pptx_to_html5-0.1.0.tar.gz -
Subject digest:
a125d6021cfb9d754d3d3cf4f324e6c1ee17a31eb19bdbde7749d219140674f9 - Sigstore transparency entry: 763749516
- Sigstore integration time:
-
Permalink:
shafe123/pptx-to-html5@f9bb6d4fef8d69bad175fdcc635e0f4c82a64ef4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/shafe123
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@f9bb6d4fef8d69bad175fdcc635e0f4c82a64ef4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pptx_to_html5-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pptx_to_html5-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2aa71cb3cedd18f525ec6394d22d5b4a2a8d3834da888f7116a26634115e7de
|
|
| MD5 |
0343afea033c83f6094e8f030cda1d07
|
|
| BLAKE2b-256 |
8c0a114dbaa92e110015d82beb671c8c6686b30ce8490f59d142f420eedc0de8
|
Provenance
The following attestation bundles were made for pptx_to_html5-0.1.0-py3-none-any.whl:
Publisher:
pypi.yml on shafe123/pptx-to-html5
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pptx_to_html5-0.1.0-py3-none-any.whl -
Subject digest:
a2aa71cb3cedd18f525ec6394d22d5b4a2a8d3834da888f7116a26634115e7de - Sigstore transparency entry: 763749520
- Sigstore integration time:
-
Permalink:
shafe123/pptx-to-html5@f9bb6d4fef8d69bad175fdcc635e0f4c82a64ef4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/shafe123
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@f9bb6d4fef8d69bad175fdcc635e0f4c82a64ef4 -
Trigger Event:
release
-
Statement type: