Skip to main content

dive_custom_slideshow

Github Actions Status

JupyterLab extension for animated slideshow.

Demo: https://ltshum.github.io/jupyterlite/lab/index.html
(Please run all cells before initializing slideshow to correctly display animations.)

Requirements

  • JupyterLab >= 4.0.0

Install

To install the extension, execute:

pip install dive_custom_slideshow

Uninstall

To remove the extension, execute:

pip uninstall dive_custom_slideshow

Usage

Slideshow

The slideshow follows the Reveal.js framework. The slide type of a cell can be changed in COMMON TOOLS > Slide Type. Available slide types include Slide, Sub-Slide, Fragment, Skip.

Image

The transition type and duration of a cell can be changed in SLIDESHOW TOOLS. Available transition types include Slide, Fade, Zoom. The default transition type can be changed in Settings. Transition-out type inherits the transition type by default.

For transition type of Slide, the slide direction can be either Horizontal or Vertical. By default, Slides have horizontal transitions, and Sub-Slides have vertical transitions.

Image

For code cells, the input of the cell can be hidden by checking Hide Code Cell, leaving only the output visible.

Image

To start a slideshow, select Slideshow in the main menu and select either Start from first cell or Start from current cell. Start from first cell starts the slideshow from the beginning. Start from current cell starts the slideshow at the selected cell.

To exit a slideshow, exit fullscreen. The Exit slideshow option is an alternative for when exiting fullscreen does not exit the slideshow successfully.

Image

SVG Animation

The SVG animation feature uses the Reveal.js Animate and LoadContent plugins by Asvin Goel. Animations are loaded after starting a slideshow.

To add an SVG image for animating, add %%markdown at the start of a code cell, and create a <div> block with attribute data-animate. Either add the SVG data inside the block, or use the data-load attribute from the LoadContent plugin.

Image

To animate the SVG image, add a comment block with a JSON string. The setup object controls the images after loading. The animation object controls the images on each fragment. To successfully set up the animation, the corresponding number of fragments must be added in the cell. More details can be viewed in the README of the Animate plugin.

Image

MathJax SVG

MathJax 4 is installed to convert math expressions into SVG images, which can be used for animations. Components in the SVG image can be selected with selector g[data-latex='x'], which is simplified into mj['x'].

Image

Contributing

Development install

Note: You will need NodeJS to build the extension package.

The jlpm command is JupyterLab's pinned version of yarn that is installed with JupyterLab. You may use yarn or npm in lieu of jlpm below.

# Clone the repo to your local environment
# Change directory to the dive_custom_slideshow directory
# Install package in development mode
pip install -e "."
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm build

You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm watch
# Run JupyterLab in another terminal
jupyter lab

With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).

By default, the jlpm build command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:

jupyter lab build --minimize=False

Development uninstall

pip uninstall dive_custom_slideshow

In development mode, you will also need to remove the symlink created by jupyter labextension develop command. To find its location, you can run jupyter labextension list to figure out where the labextensions folder is located. Then you can remove the symlink named custom-slideshow within that folder.

Testing the extension

Frontend tests

This extension is using Jest for JavaScript code testing.

To execute them, execute:

jlpm
jlpm test

Integration tests

This extension uses Playwright for the integration tests (aka user level tests). More precisely, the JupyterLab helper Galata is used to handle testing the extension in JupyterLab.

More information are provided within the ui-tests README.

Packaging the extension

See RELEASE

Metadata

Release files for dive-custom-slideshow 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dive-custom-slideshow 0.1.3
File Size Uploaded
dive_custom_slideshow-0.1.3.tar.gz 2.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for dive-custom-slideshow 0.1.3
File Interpreter ABI Platform
dive_custom_slideshow-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 3.3 MB

Release files / dive_custom_slideshow-0.1.3.tar.gz

Download URL dive_custom_slideshow-0.1.3.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
9b0abec79873ea253cf2c8e9d6466819b16ad5a131cb82f7f112bccb72d685f5
BLAKE2b-256 checksum
How to use checksums
b571aea666f0b22f85a7c65ea114735d4bb83eacdb434767fa0a493f85e58111
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / dive_custom_slideshow-0.1.3-py3-none-any.whl

Download URL dive_custom_slideshow-0.1.3-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
42b9e569c31efc2c40f254fa77a37a8f5a2f6cd14cd281b3551a226686c2feb2
BLAKE2b-256 checksum
How to use checksums
0bc4249df2396196df52fb235a2c713a161276f2fd628cf50fd7f338ee4595b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page