This repository showcases JupyterLite deployed as a static site on GitHub Pages as a part of a Sphinx site using the jupyterlite-sphinx
extension for demo purposes. It is meant to be used as a reference for documentation website authors who want to add interactive documentation elements to their Sphinx sites.
For similar demos that deploy JupyterLite as a standalone site instead, please check out the following:
jupyterlite-pyodide-kernel
).jupyterlite-xeus
and xeus-python
).This repository is divided into two sections:
pyodide-kernel-example/
: this folder contains a JupyterLite deployment with a Sphinx site using the Pyodide kernel, which is a Python kernel that runs in the browser using WebAssembly and uses the Pyodide distribution.xeus-kernel-example/
: this folder contains a JupyterLite deployment with a Sphinx site using the Xeus kernel, which uses the emscripten-forge channel.Both examples use the PyData Sphinx Theme.
Please check out the README files under each folder to understand the file structure and the use of configuration files in the JupyterLite deployment.
Here is an end-to-end guide to set up your own deployment to use JupyterLite and jupyterlite-sphinx
:
jupyterlite-sphinx
and a kernel of your choice in your Python environment that is used to build the Sphinx documentation website. For example, you may install the Pyodide kernel with pip install jupyterlite-sphinx jupyterlite-pyodide-kernel
. We recommend pinning the version of jupyterlite-pyodide-kernel
as it controls the version of Pyodide that is used in the deployment.jupyterlite-sphinx
in your Sphinx documentation website in its conf.py
file.make html
or sphinx-build -b html . _build/html
(or the equivalent command for your Sphinx setup).jupyterlite-sphinx
, you may use a CSS file to style it. A sample has been provided in the /_static/
folder for each example.jupyter_lite_config.json
, jupyter-lite.json
, and overrides.json
files, and sample files have been provided in the example folders.lite/
subfolder of the Sphinx build output.Here is a diagram of the workflow:
flowchart TD A[Start] --> B["Install jupyterlite-sphinx"] B -->|"`pip install jupyterlite-sphinx`"| C{Choose a distribution to use and install a kernel} C -->|The Pyodide distribution| D["`pip install jupyterlite-pyodide-kernel`"] C -->|The emscripten-forge distribution| E["`pip install jupyterlite-xeus`"] D --> F["Configure Sphinx site in conf.py"] E --> G["Configure WASM environment using Xeus environment file"] G --> F["Configure Sphinx site in conf.py"] F --> I["(Optional) configure additional JupyterLite settings in jupyter_lite_config.json, jupyter-lite.json, and overrides.json"] I --> J["Deploy site"]Loading
For information on how to use and configure JupyterLite and jupyterlite-sphinx
further, please refer to the JupyterLite documentation and the jupyterlite-sphinx
documentation respectively.
For information on how to select and configure a kernel, please refer to the "Adding kernels" section in the JupyterLite documentation.
Websites that usejupyterlite-sphinx
scipy.stats
module are interactive, and use the Pyodide kernel.scikit-learn
: uses the Sphinx-Gallery extension to generate a gallery of examples, and uses the extension's JupyterLite integration to make them interactive, which relies on jupyterlite-sphinx
internally. While this is also an option that users may explore, it is not showcased within this demo.This project is licensed under the BSD 3-Clause License. See the LICENSE file for details.
Please refer to the respective licenses for individual kernels, themes, and other dependencies.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4