- ๐ Support for plots, widgets, and rich media
- ๐จ Customizable themes and layouts
- ๐ฑ Responsive design for various screen sizes
- ๐ค Export to HTML/PDF (limited content type)
- ๐ฏ Frame-by-frame animations
- ๐ Speaker notes support
- ๐ Markdown, citations and settings files synchronization
- โ๏ธ Drawing support during presentations
- 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 |
|---|---|
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!
-
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 Experimental support for direct PDF printing from slides using
Ctrl + PorCtrl + Alt + P(merged frames) is available. 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.
-
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.set_css({ # on all slides or slide[index,].set_css() per slide
'p': {'font-size':'1.2em', 'line-height':'1.5em'}, # relaxed paragraph
}, bg1 = '#f0f0f0') # set theme color on this slide- File Sync:
Live edit a linked markdown file that updates slides in real-time using
slides.sync_with_file.
-
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
git clone https://github.com/asaboor-gh/ipyslides.git
cd ipyslides
pip install -e .Contributions are welcome! Please feel free to submit a Pull Request.
- Github Pages Documentation
- Full documentation:
slides.docs()same as on github pages. - Examples:
slides.demo() - GitHub Repository
Made with โค๏ธ by Abdul Saboor