PyReveal

Presentations, written in Python

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.

Get startedAPI reference

Hello There

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.

Vertical Slides

Slides can be nested inside of each other.

Use the Space key to navigate through all slides.


Arrow

Basement Level 1

Nested slides are useful for adding additional detail underneath a high level horizontal slide.

Basement Level 2

That's it, time to go back up.


Arrow

Hidden Slides

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`.

Pretty Code


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.

With Animations

Point of View

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.)

Auto-Animate

Automatically animate matching elements across slides with Auto-Animate.

Auto-Animate

Auto-Animate

Touch Optimized

Presentations look great on touch devices, like mobile phones and tablets. Simply swipe through your slides.

Lightbox

Turn any element into a lightbox using data‑preview‑image & data‑preview‑video.
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"))

FIT TEXT

Fragments

Hit the next arrow...

... a fragmented slide.

... to step through ...

Fragment Styles

There's different types of fragments, like:

fade-right, up, down, left

Highlight red blue green

growshrinkfade-outfade-in-then-outfade-in-then-semi-out

Transition Styles

You can select from different transitions, like:
None - Fade - Slide - Convex - Concave - Zoom

Themes

PyReveal comes with a few themes built in:
Black (default) - White - League - Sky - Beige - Simple
Serif - Blood - Night - Moon - Solarized

Slide Backgrounds

Call slide.bg() to change the background color. All CSS color formats are supported.

slide.bg("#dddddd")

Arrow

Gradient Backgrounds

slide.bg(
	gradient="linear-gradient(to bottom, #ddd, #191919)"
)

Image Backgrounds

slide.bg("image.png")

Tiled Backgrounds

slide.bg("image.png", repeat="repeat", size="100px")

Video Backgrounds

slide.bg(type=BackgroundType.VIDEO,
         video="assets/clip.mp4", color="#000")

... and GIFs!

Background Transitions

Different background transitions are available via the backgroundTransition option. This one's called "zoom".

deck.configure(backgroundTransition="zoom")

Background Transitions

You can override background transitions per-slide.

slide.bg("#b5533c", transition="zoom")

Iframe Backgrounds

Since PyReveal exports to the web, you can easily embed other web content. Try interacting with the page in the background.

Marvelous List

  • No order here
  • Or here
  • Or here
  • Or here

Fantastic Ordered List

  1. One is smaller than...
  2. Two is smaller than...
  3. Three!

Tabular Tables

ItemValueQuantity
Apples$17
Lemonade$218
Bread$32

Clever Quotes

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.”

Intergalactic Interconnections

You can link between slides internally, like this.

Speaker View

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.

Export to PDF

Presentations can be exported to PDF, here's an example:

Global State

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.

State Events

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")

Take a Moment

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.

THE END

Get startedAPI reference

Source code on GitHub