Skip to main content

Universal Webflow to Reveal.js converter

Project description

webflow2reveal

Turn a structured, sectioned Webflow page into an interactive Reveal.js slide deck — without authoring slides by hand.

A Webflow export is already a stack of full-width <section>s with consistent class names. webflow2reveal treats each qualifying section as one slide, infers the slide layout and background colour from the page's own CSS, discards chrome (nav, footer, menu, banner), and wraps everything in a Reveal scaffold sized for a 1440×900 stage.

It ships as two implementations that share one approach:

Package Runs Input → Output
Python webflow2reveal (PyPI) Build time URL / local HTML → static index.html
JavaScript webflow2revealjs (npm) Run time, in browser Live page / fetched URL / raw HTML → in-place deck

📖 Full documentation: https://code.twardoch.com/webflow2reveal/ · 🖥️ Live demo

Quick start

Python (build a static deck)

# Convert a hosted Webflow page (no install needed)
uvx webflow2reveal https://example.webflow.io/deck --output index.html

# Convert a local export and preview it on a dev server
uvx webflow2reveal ./export/index.html --serve --port 8080
from webflow2reveal import convert
convert("https://example.webflow.io/deck", output="index.html")

JavaScript (convert in the browser)

Add one script to a Webflow Page Custom Code block before </body>:

<script src="https://cdn.jsdelivr.net/npm/webflow2revealjs@latest/dist/index.global.js"></script>
<a href="#" class="w2r-trigger">View as Slides</a>

Clicking a .w2r-trigger element — or loading the page with ?reveal=1 — converts the live page to slides in place. Or call it yourself:

import { convertToReveal } from 'webflow2revealjs';
await convertToReveal();                       // current page, in place
await convertToReveal({ sourceUrl, corsProxy }); // fetch and convert another page

How it works

Webflow page  →  parse CSS bg-colours  →  pick slide <section>s  →
                 normalize DOM (split / image / text / badge layouts)  →
                 score luminance (light/dark)  →  inject Reveal.js 5.1  →
                 static index.html  /  in-place browser deck
  1. Resolve colours — scan inline and linked stylesheets into a class → background-colour map.
  2. Select slides — every <section> becomes a slide unless its classes/id mark it as nav, footer, menu, header, or banner.
  3. Normalize the DOM — rewrite each slide into a small layout vocabulary (slide-split-layout, slide-column, slide-text-container, slide-image-cover, slide-badge).
  4. Classify backgrounds — set data-background-color and tag each slide slide-light-bg/slide-dark-bg by perceptual luminance for correct text contrast.
  5. Inject Reveal.js 5.1 plus a bundled stylesheet that sizes everything to the stage and hides Webflow chrome.

Add ?view=scroll to any generated deck to switch into Reveal's native scroll view. See How it works for the full algorithm.

Repository layout

py/src/webflow2reveal/   Python package (compiler.py = the converter)
js/src/index.ts          TypeScript library (convertToReveal + DOM helpers)
docs/                    Jekyll site (just-the-docs) + live demo under docs/demo/
build.sh                 Build JS bundle + Python wheel; copy bundle into docs/demo
publish.sh               Tag, build, and publish to PyPI + npm
dev_server.py            Local CORS-proxying dev server for testing fetched pages

Build & publish

./build.sh     # builds js/dist/* and dist/*.whl, copies bundle to docs/demo/dist/
./publish.sh   # version-tags, rebuilds, publishes to PyPI and npm

The JS build emits CJS, ESM, and an IIFE global (Webflow2Reveal) via tsup. The Python package versions from git tags via hatch-vcs; a single tag releases both packages.

License

MIT © Adam Twardoch.

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

webflow2reveal-1.0.9.tar.gz (70.3 kB view details)

Uploaded Source

Built Distribution

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

webflow2reveal-1.0.9-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file webflow2reveal-1.0.9.tar.gz.

File metadata

  • Download URL: webflow2reveal-1.0.9.tar.gz
  • Upload date:
  • Size: 70.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for webflow2reveal-1.0.9.tar.gz
Algorithm Hash digest
SHA256 28f940724b9e6486885b85f5cce1acab48fde2367acbc3aa7fff81a78e84ec67
MD5 28bff08c738c013773ecd737641ff6dc
BLAKE2b-256 0f6c4d6e6e887cd2363169435fb5e54b5fa6ea970e809259b0fdaf940dd2a21e

See more details on using hashes here.

File details

Details for the file webflow2reveal-1.0.9-py3-none-any.whl.

File metadata

  • Download URL: webflow2reveal-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for webflow2reveal-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 0b8a9da300fbc8a7acda8e2dfec5e4d4b390a2ef940318defea9f4329a9d56b0
MD5 31dc8f8c1313918d641472e89d3d2e4c
BLAKE2b-256 9edbab6f3b4384ba2e8614efe061e9c8a285cab2682be3867924fc2b1f3cf786

See more details on using hashes here.

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