Live rich content slides in jupyter notebook
Project description
IPySlides
IPySlides is a Python library for creating interactive presentations in Jupyter notebooks. It combines the power of Markdown, LaTeX, interactive widgets, and live variable updates in a single presentation framework.
Why IPySlides?
The Problem: Static PowerPoint vs. Superficial Notebook Relayouts
Scientists, engineers, and programmers are trapped between two frustrating extremes. PowerPoint forces you into a dead, non-interactive workflow of pasting static screenshots and endlessly duplicating slides just to reveal a single bullet, equation, or figure element. Conversely, traditional notebook-based presentation tools are nothing more than superficial cell wrappers; they simply relayout your raw notebook cells without providing any native content support, structural design, or layout control. This forces you to awkwardly chop your analysis into dozens of artificial cells just to trigger basic fragments. Moreover, their static exports often break, leaving you without a reliable backup if your live Python kernel is not available.
The Solution: An Interactive, Content-Aware Ecosystem
IPySlides embeds a frame-aware presentation engine directly into your computational workflow, letting you run your full analysis and build high-fidelity slides side-by-side in the same notebook.
By replacing copy-paste duplication and artificial cell chopping with programmatic framing, a single cell acts as a canonical source that natively understands structure, progressing in precise, incremental steps. It keeps execution code, rich outputs, and custom layouts perfectly synchronized while supporting active Jupyter widgets for real-time data manipulation. When it's time to export, it generates a production-grade HTML or crisp PDF backup that accurately mirrors your presentation.
Features
- 📊 Support for plots, widgets, and rich media
- 🎨 Customizable themes and layouts
- 📱 Responsive design for various screen sizes
- 📤 Export to HTML/PDF (widgets no more interactive or discarded)
- 🎯 Frame-by-frame animations
- 📝 Speaker notes support
- 🔄 Markdown, citations and settings files synchronization
- ✏️ Drawing support during presentations
Quick Start
- Install:
pip install ipyslides # Basic installation
pip install ipyslides[extra] # Full features
- Create Slides:
import ipyslides as isd
slides = isd.Slides()
# Add content programmatically
slides.build(-1, """
# My First Slide
- Point 1
- Point 2
$E = mc^2$
""")
# Or use cell magic
%%slide 0
# Title Slide
Welcome to IPySlides!
- Run Examples:
slides.docs() # View documentation
slides.demo() # See demo presentation
✨ Try it in your browser ✨
| Jupyterlite | Binder |
|---|---|
Content Types
Support for various content types including:
- 📜 Extended Markdown, see
slides.xmd_syntax - 📊 Plots (Matplotlib, Plotly, Altair)
- 🔧 Interactive Widgets
- 📷 Images and Media
- ➗ LaTeX Equations
- ©️ Citations and References
- 💻 Auto update variables in markdown
- 🎥 Videos (YouTube, local)
- 🎮 Enhanced interactive widgets (with fullscreen support, thanks to
anywidget)
import numpy as np
from ipywidgets import HTML
@slides.dl.interact(html = HTML(), amplitude= (0, 2),frequency=(0, 5))
def plot(html, amplitude, frequency):
x = np.linspace(0, 2*np.pi, 100)
y = amplitude * np.sin(frequency * x)
plt.plot(x, y)
html.value = slides.plt2html(). value
- For comprehensive dashbords, subclass
DashboardBaseor useDashboardfromipyslides.dashlab:
import numpy as np
import matplotlib.pyplot as plt
from ipywidgets import HTML
from ipyslides.dashlab import Dashboard
dash = Dashboard(
html = HTML(),
amplitude = (0, 2),
frequency = (0, 5),
)
@dash.callback
def plot(self, html, amplitude, frequency):
x = np.linspace(0, 2*np.pi, 100)
y = amplitude * np.sin(frequency * x)
plt.plot(x, y)
html.value = slides.plt2html().value # can be directly shown on out-main
@dash.callback('out-text')
def text(self, amplitude, frequency):
print(f"Amplitude: {amplitude}\n Frequency: {frequency}")
dash.set_layout(
left_sidebar = ['*ctrl'], # all controls in left sidebar
center = ['html','out-.*'], # out-main, out-text collected in center
pane_widths = [3,5,0]
)
dash.set_css(
main = { # can also be set via post_init callback
'grid-gap': '4px', 'margin': '8px',
'.left-sidebar': {'background': '#eee','border-radius': '8px'},
},
center = { # can be set in main through '> .center' selector
'> *': {'background-color': 'whitesmoke', 'border-radius': '8px','padding':'8px'},
'grid-template-columns': '5fr 3fr', # side-by-side layout for outputs
'grid-gap': '4px', # central grid gap
'> *': {'background-color': 'whitesmoke', 'border-radius': '8px','padding':'8px'}
})
display(dash)
See more examples in DashLab repository and try it out in
- And much more!
Export Options
-
HTML Export
Useslides.export_htmlto build static slides that you can print to PDF. Read export details in settings panel, where you can also export with a single click. -
PDF Export Support for direct PDF printing from slides using
Ctrl + P(use options in side panel to prepare for print) is available, although some IDEs like VSCode may not allow it. UseSave as PDFoption and enable background graphics if necessary. If issues arise in direct printing, consider exporting to HTML first and printing from there.
Navigate to Documentation to see HTML slides which you can print to PDF. See demo.pdf for an example exported PDF.
Advanced Features
-
Custom Objects Serialization:
- You can serialize custom objects to HTML using
Slides.serializerAPI. - You can extend markdown syntax using
Slides.extenderAPI. See some good extensions to add from PyMdown.
- You can serialize custom objects to HTML using
-
Speaker Notes: Enable via Settings Panel → Show Notes and add notes via
slides.notes. -
Custom Styling:
slides.css({
'p': {'font-size':'1.2em', 'line-height':'1.5em'}, # relaxed paragraph
}, applyto=1, bg1 = '#f0f0f0') # set theme color on slide 1, or 'all' or list of slides
-
File Sync: Live edit a linked markdown file that updates slides in real-time using
slides.sync_with_file. -
Content Animations:
- Slides builders now support skeleton animation automatically for a premium editing experience.
- Beside slides switch transitions, you can animate content anywhere in slides using
anim-prefixed classes and related varaiables. Seeslides.css_animationsfor details.
Caveats
-
Markdown Cells:
- Jupyter markdown cells are not processed by IPySlides
- Instead, you can use
%%slide number -mcell magic and link an external markdown file usingslides.sync_with_file
-
Slide Numbering:
- Use
-1for automatic slide numbering - Manual numbering requires careful tracking to avoid overwriting slides
- Use
-
Speaker Notes:
- Experimental feature - use with caution
- Notes appear at top of slide in PDF to grab speaker's attention and are meant for speaker reference only, e.g. printed handout.
- Place extended projector on top/bottom of laptop screen while presenting in Jupyter Notebook to allow right/left edges click navigation work smoothly.
Development
git clone https://github.com/asaboor-gh/ipyslides.git
cd ipyslides
pip install -e .
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Documentation
- Github Pages Documentation
- Full documentation:
slides.docs()same as on github pages. - Examples:
slides.demo() - GitHub Repository
Acknowledgements
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 ipyslides-7.0.0.tar.gz.
File metadata
- Download URL: ipyslides-7.0.0.tar.gz
- Upload date:
- Size: 184.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8fe33cb4e503d7d7955aff4ed75c98a56f8ed600951a0047ec79c5b4b7345d4
|
|
| MD5 |
69ba06587e280a4a4119d9b973ac9b80
|
|
| BLAKE2b-256 |
8e3981436faf6a9a24dd66a9038cf13dc327dbe2650c5b735eb554ccf8b39c99
|
File details
Details for the file ipyslides-7.0.0-py2.py3-none-any.whl.
File metadata
- Download URL: ipyslides-7.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f92234ad5e5652377bb412b80d0176f29cf87532bbdcaff03ab8b37b9339d8a4
|
|
| MD5 |
4dee7e4f1916e15c9e2b5f8cbef4fd99
|
|
| BLAKE2b-256 |
ee75a44ceec9a274a0f22bb1675c6c53ea03bad0c10f0855db5541663832e14e
|