31
loading...
This website collects cookies to deliver better user experience
pip install ipyslides
import ipyslides as isd
isd.initilize()
from ipyslides import load_magics, convert2slides, write_title
from ipyslides.utils import write, plt2html, print_context, slide
# Command below registers all the ipyslides magics that are used in this file
load_magics()
# Set this to True for Slides output
convert2slides(False) #Set this to True for Slides output
write_title("# Title Markdown")
%%slide 1
write('# Slide Title')
write('## Column 1',"## Column 2")
%%slide
and with side
save results to IPython's capture mechanism. There is another way where you can add dymanic slides with helper function:isd.insert_after(1, 1,2,3,func=lambda x: write(f'## Dynamic Slide ${x}^2 = {x**2}$'))
import matplotlib.pyplot as plt, numpy as np
for i in range(5):
with slide(i+5):
x = np.linspace(0,i+1,50+10*i)
_ = plt.plot(x,np.sin(x))
write(plt2html(),f'#### Slide {i+5} but I am {i+1} of 5 other slides created from single cell\n{isd.get_cell_code()}')
isd.build()
which will inform you to turn on convert2slides(True)
in first cell and when you do that, executing cell will populate the code or you can write code yourself without using isd.build
command.# Only this cell should show output. For JupyterLab >=3, pip install sidecar for fullscreen access
# You can also double click on output and select `Create New View for Output` that will let you enable fullscreen.
# ------ Slides End Here --------
from ipyslides.core import LiveSlides
ls = LiveSlides()
ls.set_footer('<span style="color:green">Author: Abdul Saboor')
ls.show()