Skip to main content

JupyterLab extension for animated slideshow.

Project description

sliveshow

Github Actions Status

A JupyterLab extension that turns Jupyter notebooks into live, animated Reveal.js slideshows — with scrollable slides, SVG animations, and MyST directive support for Jupyter Book 2.

Install:

pip install sliveshow

PyPI: https://pypi.org/project/sliveshow/
Demo: https://ltshum.github.io/jupyterlite/lab/index.html
(Run all cells before starting the slideshow to display animations correctly.)


Requirements

  • JupyterLab >= 4.0.0

Install

pip install sliveshow

Uninstall

pip uninstall sliveshow

Usage

Slideshow

The slideshow uses the Reveal.js framework. Set the slide type of each cell via COMMON TOOLS > Slide Type. Available types: Slide, Sub-Slide, Fragment, Skip.

Slide type panel

Transition type and duration are set per-cell in SLIDESHOW TOOLS. Available types: Slide, Fade, Zoom. The default can be changed in Settings.

For Slide transitions, direction is Horizontal (Slides) or Vertical (Sub-Slides) by default.

Transition settings

Code cell input can be hidden via Hide Code Cell, showing only the output.

Hide code cell

To start a slideshow, use the Slideshow menu → Start from first cell or Start from current cell. To exit, press Escape or use Exit slideshow.

Start slideshow


SVG Animation

SVG animations use the Reveal.js Animate plugin by Asvin Goel. Animations load after the slideshow starts.

Method A — Raw HTML in a markdown cell

Add a <div data-animate> block containing your SVG and a JSON config comment directly in a markdown cell:

<div data-animate>
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300">
  <circle id="c1" cx="150" cy="150" r="60" style="fill:steelblue"/>
</svg>
<!--
{
  "setup": [{
    "element": "#c1",
    "modifier": "attr",
    "parameters": [{ "r": 100 }],
    "duration": 1500,
    "begin": 0
  }]
}
-->
</div>

Method B — {svg-animate} MyST directive (recommended)

Use the {svg-animate} directive in a markdown cell. The same cell works in both the live Reveal.js slideshow and a static Jupyter Book 2 / mystmd export:

:::{svg-animate} Circle animation
:height: 320px
:background: white
<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'>
  <circle id='c1' cx='150' cy='150' r='60' style='fill:steelblue'/>
</svg>
<!--
{
  "setup": [{ "element": "#c1", "modifier": "attr", "parameters": [{ "r": 100 }], "duration": 1500, "begin": 0 }]
}
-->
:::

To enable {svg-animate} in a mystmd/Jupyter Book 2 build, add the plugin to your myst.yml:

project:
  plugins:
    - svg-animate.mjs

The svg-animate.mjs plugin file is included in the Demo/ folder.

SVG animation

The JSON config controls the animation. setup runs on load; animation runs per fragment. See the Animate plugin README for full options.

SVG animation config


MathJax SVG

MathJax 4 converts math expressions into SVG, which can be animated. Select components with g[data-latex='x'], shortened to mj['x'].

MathJax


Contributing

Development install

You will need Node.js and JupyterLab installed.

# Clone the repo
git clone https://github.com/AlyanAamirAhmedani/sliveshow
cd sliveshow

# Install in development mode
pip install -e "."

# Link with JupyterLab
jupyter labextension develop . --overwrite

# Build TypeScript
jlpm build

Watch mode (auto-rebuild on save):

# Terminal 1
jlpm watch

# Terminal 2
jupyter lab

Development uninstall

pip uninstall sliveshow

Remove the symlink created by jupyter labextension develop:

jupyter labextension list  # find labextensions folder
# remove the sliveshow symlink from that folder

Packaging

See RELEASE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sliveshow-0.1.4.tar.gz (858.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sliveshow-0.1.4-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file sliveshow-0.1.4.tar.gz.

File metadata

  • Download URL: sliveshow-0.1.4.tar.gz
  • Upload date:
  • Size: 858.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for sliveshow-0.1.4.tar.gz
Algorithm Hash digest
SHA256 69b0c9cad1db24662716a3efc7c994328b11010cf99935235416d396d2e8178a
MD5 eb09c457dfc7583fd2673bbe372fba02
BLAKE2b-256 8c820e2781528796ce1be8f9a0dd7066ad2ac1d86887dba09190f4323a8f3ced

See more details on using hashes here.

File details

Details for the file sliveshow-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: sliveshow-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for sliveshow-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c34e8a3c4d905672030000ef62b5e0755dbc40d3ac81c268f94aa291205ce353
MD5 8066978cf4cc9ebf81767faced8dafcf
BLAKE2b-256 54eaa112dd93798ce7b9bdb7d67cd13bf95cd1ae3b956364daf2617f0720727e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page