Live rich content slides in jupyter notebook
Project description
IPySlides
Create Interactive Slides in Jupyter/Voila with all kind of rich content.
Changelog
Content below assumes you have ls = LiveSlides()
.
0.9.1
- In Jupyterlab (only inline cell output way), you can use
Ctrl + Shift + C
to create consoles/terminals, set themes etc. - Use
Ctrl + Shift + [
,Ctrl + Shift + ]
to switch back and forth between notebooks/console/terminals and enjoy coding without leaving slides!
0.8.11
- All utilities commnads are now under
LiveSlides
class too, so you can use eitheripyslides.utils.command
orls.command
forcommand
inwrite
,iwrite
,file2code
etc.
0.8.10
- You can add two slides together like
ls1 + ls2
, title ofls2
is converted to a slide inplace. - You can now change style of each slide usig
**css_props
in commands like@ls.slides
,with ls.slide
andwith ls.title
. - A new command
textbox
is added which is useful to write inline references. Same can be acheived withslides.cite(...here=True)
. - You can use
ls.alert('text')
,ls.colored('text',fg,bg)
to highlight text.
0.8.7
- Support added for objects
matplotlib.pyplot.Figure
,altair.Chart
,pygal.Graph
,pydeck.Deck
,pandas.DataFrame
,bokeh.plotting.Figure
to be directly inwrite
command. write
command now can acceptlist/tuple
of content, items are place in rows.
0.8.5
@ls.slides(...,calculate_now=True)
could be used to calculate slides in advance or just in time. Default isTrue
.- You can now use
ipyslides.utils.iwrite
to build complex layout of widgets like ipywidgets, bqplot etc. (and text usingipyslides.utils.ihtml
).
0.8.3
- You can now use
ls.cite
method to create citations which you can write at end byls.write_citations
command. ls.insert_after
no longer works, use
@ls.slides(after_slide_number,*objs)
def func(obj):
write(obj) #etc. for each obj in objs
decorator which is more pythonic way.
0.8.0 +
Note: All these points may not or only partially apply to earlier versions. So use stable API above version 8.
- Before this version, slides were collected using global namespace, which only allowed one presentation per notebook. Now slides are stored in local namespace, so no restriction on number of slides per notebook.
- To acheive local namespace, functions are moved under class LiveSlide and it registers magics too. So now you will
be able to use
%%slide, %%title
magics. Now you will use context managers as follows
ls = LiveSlides()
ls.convert2slides(True)
with ls.title():
...
with ls.slide(<slide number>):
...
ls.insert_after(<slide number>,*objs, func)
ipyslides.initialize()
can write all above code in same cell.
Note: For LiveSlides('A'), use %%slideA, %%titleA, LiveSlides('B'), use %%slideB, %%titleB so that they do not overwite each other's slides.
-
You can elevate simple cell output to fullscreen in Jupyterlab >= 3.
-
with ls.slide
content manager is equivalent to%%slide
so make sure none of them overwrite each other. -
Auto refresh is enabled. Whenever you execute a cell containing
%%title
,with ls.title
,%%slide
,with ls.slide
orls.insert_after
, slides get updated automatically. -
LiveSlides should be only in top cell. As it collects slides in local namespace, it can not take into account the slides created above itself.
Install
> pip install ipyslides>=0.8
For development install, clone this repository and then
> cd ipyslides
> pip install -e .
Editable Demo
See a Demo Notebook at Kaggle. You can edit it yourself.
For jupyterlab >= 3, do pip install sidecar for better presenting mode.
Content Types to Embed
You can embed anything that you can include in Jupyter notebook like ipywidgets,HTML,PDF,Videos etc.,including jupyter notebook itself!
Note: Websites may refuse to load in iframe. Note: You can embed one intsnace of slides
ls1' inside other instance
ls2' usingls2.insert_after(<N>,ls1.box)
. This is very cool.
IPython Display Objects
Any object with following methods could be in write
command:
_repr_pretty_
, _repr_html_
, _repr_markdown_
, _repr_svg_
, _repr_png_
, _repr_jpeg_
, _repr_latex_
, _repr_json_
, _repr_javascript_
, _repr_pdf_
Such as IPython.display.<HTML,SVG,Markdown,Code>
etc. or third party such as plotly.graph_objects.Figure
.
Plots and Other Data Types (0.8.7+)
These objects are implemented to be writable in write
command:
matplotlib.pyplot.Figure
, altair.Chart
, pygal.Graph
, pydeck.Deck
, pandas.DataFrame
, bokeh.plotting.Figure
.
Many will be extentended in future. If an object is not implemented, use display(obj)
to show inline or use library's specific command to show in Notebook outside write
.
Interactive Widgets
Any object in ipywidgets
or libraries based on ipywidgtes
such as bqplot
,ipyvolume
,plotly's FigureWidget
can be included in iwrite
command. Text/Markdown/HTML inside iwrite
is made available through ihtml
command.
Full Screen Presentation
-
Jupyterlab 3.0+ has full screen eneabled from any view:
- Direct output of cell can be turned into fullscreen.
- Linked output view using
Create New Output View
command is very useful, so you can edit and see output right there. - If you have installed Jupyterlab-Sidecar, slides automatically open in it.
-
Use Voila for full screen prsentations. Your notebook remains same, it is just get run by Voila, may not work as expected.
-
Slides in Jupyter Lab are theme aware in
Inherit
theme mode, so theme of slides changes based on editor theme.
Very thankful to Python-Markdown which enabled to create
write
command as well as syntax highliting.
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
Hashes for ipyslides-0.9.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f3847f21e26a0c2713e7be81a927da28fbf85c83919a805b353502d21784281 |
|
MD5 | 36235534600ab576dad1908873eaa8d7 |
|
BLAKE2b-256 | 16ddfb7d6ed2a274c581e1cfe8974158e8b7da54589330fded5721d7d7156c16 |