Skip to main content

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 file
  • styles.css - Styling and layout
  • script.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pptx_to_html5-0.1.0.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pptx_to_html5-0.1.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

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

Hashes for pptx_to_html5-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a125d6021cfb9d754d3d3cf4f324e6c1ee17a31eb19bdbde7749d219140674f9
MD5 17775a5fea8c0429714df0c378ff3f25
BLAKE2b-256 9a2cc084b4496a16df63bc5ca5f77f30c875452bbf790c26a78a10dfb15b2670

See more details on using hashes here.

Provenance

The following attestation bundles were made for pptx_to_html5-0.1.0.tar.gz:

Publisher: pypi.yml on shafe123/pptx-to-html5

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pptx_to_html5-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2aa71cb3cedd18f525ec6394d22d5b4a2a8d3834da888f7116a26634115e7de
MD5 0343afea033c83f6094e8f030cda1d07
BLAKE2b-256 8c0a114dbaa92e110015d82beb671c8c6686b30ce8490f59d142f420eedc0de8

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page