PyReveal
Build polished slides in code with titles, bullets, code, math, and speaker notes. Export one self-contained HTML file you can open offline or share anywhere.
No HTML required. Just Python.
PyReveal enables you to create beautiful interactive slide decks using Python, powered by reveal.js under the hood. Go beyond the usual reveal.js toolkit with PyReveal-only extras like Three.js — this presentation shows you what it can do.
Slides can be nested inside of each other.
Use the Space key to navigate through all slides.
Nested slides are useful for adding additional detail underneath a high level horizontal slide.
That's it, time to go back up.
This slide is visible in the source, but hidden when the presentation is viewed. You can show all hidden slides by setting the `showHiddenSlides` config option to `true`.
from pyreveal import Presentation, Slide
deck = Presentation("My Talk")
slide = Slide()
slide.title = "Hello"
slide.code("print('Hello')", language="python")
deck.add(slide).save("deck.html")
Code syntax highlighting courtesy of highlight.js.
Press ESC to enter the slide overview.
Hold down the alt key (ctrl in Linux) and click on any element to zoom towards it using zoom.js. Click again to zoom back out.
(NOTE: Use ctrl + click in Linux.)
Automatically animate matching elements across slides with Auto-Animate.
Presentations look great on touch devices, like mobile phones and tablets. Simply swipe through your slides.
slide.image("assets/image.jpg", preview=True)
slide.image("assets/poster.jpg", preview=True,
preview_src="assets/video.mp4")
Use FitText to auto-size text: slide.element(FitText("FIT TEXT"))
Hit the next arrow...
... a fragmented slide.
... to step through ...There's different types of fragments, like:
fade-right, up, down, left
Highlight red blue green
growshrinkfade-outfade-in-then-outfade-in-then-semi-outYou can select from different transitions, like:
None - Fade - Slide - Convex - Concave - Zoom
PyReveal comes with a few themes built in:
Black (default) - White - League - Sky - Beige - Simple
Serif - Blood - Night - Moon - Solarized
Call slide.bg() to change the background color. All CSS color formats are supported.
slide.bg("#dddddd")slide.bg(
gradient="linear-gradient(to bottom, #ddd, #191919)"
)slide.bg("image.png")slide.bg("image.png", repeat="repeat", size="100px")slide.bg(type=BackgroundType.VIDEO,
video="assets/clip.mp4", color="#000")Different background transitions are available via the backgroundTransition option. This one's called "zoom".
deck.configure(backgroundTransition="zoom")You can override background transitions per-slide.
slide.bg("#b5533c", transition="zoom")Since PyReveal exports to the web, you can easily embed other web content. Try interacting with the page in the background.
| Item | Value | Quantity |
|---|---|---|
| Apples | $1 | 7 |
| Lemonade | $2 | 18 |
| Bread | $3 | 2 |
These guys come in two forms, inline: The nice thing about standards is that there are so many to choose from
and block:
“For years there has been a theory that millions of monkeys typing at random on millions of typewriters would reproduce the entire works of Shakespeare. The Internet has proven this theory to be untrue.”
You can link between slides internally, like this.
There's a speaker view. It includes a timer, preview of the upcoming slide as well as your speaker notes.
Press the S key to try it out.
Presentations can be exported to PDF, here's an example:
Set state="something" on a Slide and "something" will be added as a class to the document element when the slide is open. This lets you apply broader style changes, like switching the page background.
In Python, attach a state name when building the slide. PyReveal exports slides that fire a matching event in the browser when opened.
slide = Slide(state="customevent")
slide.heading("State Events")
Press B or . on your keyboard to pause the presentation. This is helpful when you're on stage and want to take distracting slides off the screen.