Embed interactive JupyterLite notebooks in your MkDocs site.
Project description
mkdocs-jupyterlite
A MkDocs plugin that enables embedding interactive jupyterlite notebooks in your docs.
Say you have a notebook example.ipynb in your awesome project, and you want
users to be able to play around with it.
In the past, you could use a tool like Binder to achieve this.
But, that requires a full docker environment and a remote server.
By using JupyterLite,
you can run Jupyter notebooks directly in the browser without any server-side dependencies.
However, to use jupyterlite, you have to manually install jupyterlite and then run a build step to package your notebooks, other files, and python dependencies into a single static site.
This plugin automates that process for you.
Installation
Step 1: Install the plugin from PyPI:
python -m pip install mkdocs-jupyterlite
Step 2: Configure your mkdocs.yml file
See the mkdocs.yml that configures this project's site.
site_name: mkdocs-jupyterlite
site_url: https://nickcrews.github.io/mkdocs-jupyterlite/
repo_url: https://github.com/nickcrews/mkdocs-jupyterlite/
nav:
- Home: index.md
- Notebook 1: notebook.ipynb
plugins:
- jupyterlite:
enabled: true
notebook_patterns:
# include all
- "**/*.ipynb",
# exclude drafts
- "!**/draft_*.ipynb",
# re-include a specific draft
- "project/drafts/draft_keep.ipynb",
# exclude an anchored notebook
- "!/top_secret.ipynb",
Here are the details on the configuration options:
enabled
bool, whether or not the plugin is enabled. Defaults to true.
notebook_patterns
A list of patterns that uses gitignore semantics to include and exclude files. The last matching pattern will be used to determine if a file is a notebook.
For all files that match, the content of the page will be an iframe that embeds the JupyterLite Notebook html.
Contributing
I want this to be usable for other people, so file an issue if you want to use this in your site, but run into any problems.
Possible improvements:
- Include custom python wheels into the JupyterLite environment.
- Passing an entire jupyter-lite.json config file.
- Instead of using an iframe, actually inline the contents of the generated HTML?
- Fix the TOC so clicking headers actually scrolls in the iframe.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkdocs_jupyterlite-0.2.0.tar.gz.
File metadata
- Download URL: mkdocs_jupyterlite-0.2.0.tar.gz
- Upload date:
- Size: 98.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b59b243cebc06f3f9fe75998a1ee0916b870582721209edf6aa71046001441c
|
|
| MD5 |
9aef284947ef4ae0d4feb9aa69f2ad77
|
|
| BLAKE2b-256 |
219bb16899936af1dfb1f046cce0a544b3bb05bc0ee79003ef23eeee2207aa8c
|
Provenance
The following attestation bundles were made for mkdocs_jupyterlite-0.2.0.tar.gz:
Publisher:
publish.yml on NickCrews/mkdocs-jupyterlite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocs_jupyterlite-0.2.0.tar.gz -
Subject digest:
0b59b243cebc06f3f9fe75998a1ee0916b870582721209edf6aa71046001441c - Sigstore transparency entry: 380693989
- Sigstore integration time:
-
Permalink:
NickCrews/mkdocs-jupyterlite@43df57aad72e4371c755665443ed498703a76402 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/NickCrews
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@43df57aad72e4371c755665443ed498703a76402 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file mkdocs_jupyterlite-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mkdocs_jupyterlite-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68b6808e81aca7a42a625a57cab4537fd4ddedb6332d83d0a320836bed017815
|
|
| MD5 |
6191b1074e3a695136eee34ee04699cb
|
|
| BLAKE2b-256 |
9ac66abbb99d03000264719ae71447c62ad913e9d26e041c2c81f755cf326c10
|
Provenance
The following attestation bundles were made for mkdocs_jupyterlite-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on NickCrews/mkdocs-jupyterlite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocs_jupyterlite-0.2.0-py3-none-any.whl -
Subject digest:
68b6808e81aca7a42a625a57cab4537fd4ddedb6332d83d0a320836bed017815 - Sigstore transparency entry: 380694022
- Sigstore integration time:
-
Permalink:
NickCrews/mkdocs-jupyterlite@43df57aad72e4371c755665443ed498703a76402 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/NickCrews
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@43df57aad72e4371c755665443ed498703a76402 -
Trigger Event:
workflow_dispatch
-
Statement type: