Registry / web-framework / mkdocs-jupyter

mkdocs-jupyter

JSON →
library0.26.2pypypiunverified

mkdocs-jupyter is an MkDocs plugin that enables the seamless integration of Jupyter notebooks (.ipynb files) and Jupytext-generated Python scripts (.nb.py files) directly into your MkDocs documentation. It allows for rendering notebooks, optionally executing them during the build process, supports theme integration, and offers granular control over the visibility of notebook cells and outputs using tags. The current stable version is 0.26.2, with active development and regular updates.

pip install mkdocs-jupyter
INSTALL
IMPORT
SIG · MKDOCS-JUPYTER
M
mkdocs-jupyter
web-frameworkpythonv0.26.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

To use mkdocs-jupyter, you primarily configure it in your `mkdocs.yml` file under the `plugins` section. After installation, create a `docs` directory with your markdown (`.md`), Jupyter notebooks (`.ipynb`), or Jupytext Python scripts (`.py`). Reference these files in your `nav` configuration. Ensure you have a basic `index.md` for your homepage.

site_name: My Docs nav: - Home: index.md - My Notebook: notebooks/example.ipynb - My Python Script: notebooks/script.py plugins: - search - mkdocs-jupyter: execute: true # Optional: Execute notebooks during build include_source: true # Optional: Add download link for source notebooks kernel_name: python3 # Optional: Specify kernel to use for execution
Debug
Known issues
gotchaMkDocs Material specific Markdown features (like admonitions, info blocks) do not render correctly within Jupyter notebook markdown cells. This is due to `nbconvert` not supporting these extensions, leading to plain text rendering.
fix
For complex Markdown features, consider using standard MkDocs `.md` files or simplifying notebook markdown. CSS tweaks might partially help for styling, but not for functionality.
affects: All versions
gotchaEnabling notebook execution (`execute: true`) can lead to build failures if required Jupyter dependencies (like `jupyter`, `nbconvert`, `ipykernel`) are not installed, if the specified `kernel_name` is unavailable, or if notebooks are excessively large, causing timeouts.
fix
Install `jupyter nbconvert ipykernel`. Check `jupyter kernelspec list` for available kernels. For large notebooks, consider splitting them or disabling execution (`execute: false`).
affects: All versions with `execute: true`
gotchaVersion incompatibilities between `mkdocs-jupyter`, `MkDocs`, `nbconvert`, and themes like `mkdocs-material` can cause plugin conflicts or rendering issues.
fix
Pin specific versions of `mkdocs`, `mkdocs-jupyter`, and `mkdocs-material` in your `requirements.txt` to ensure consistent builds and avoid unexpected breaks after updates. For example: `mkdocs==1.5.3`, `mkdocs-material==9.5.3`, `mkdocs-jupyter==0.26.2`.
affects: All versions
gotchaBy default, notebooks are not executed during the `mkdocs build` process. Their outputs will only reflect the state of the `.ipynb` file when it was last saved.
fix
To ensure outputs are always current, explicitly set `execute: true` in your `mkdocs.yml` plugin configuration. Example: `plugins: - mkdocs-jupyter: execute: true`.
affects: All versions
gotchaHaving both a `.ipynb` file (e.g., `example.ipynb`) and a `.md` file (e.g., `example.md`) with the same base name in your `docs` directory can lead to unexpected rendering behavior or errors.
fix
Ensure unique filenames for your notebooks and markdown files to avoid conflicts.
affects: All versions
deprecatedOlder versions (prior to 0.23.0) might have issues with `nbconvert` version 7.
fix
Upgrade `mkdocs-jupyter` to version 0.23.0 or newer to ensure compatibility with `nbconvert` 7+.
affects: < 0.23.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'mkdocs.tests'
The mkdocs-jupyter plugin attempts to import a testing module (`mkdocs.tests`) which was removed or is no longer exposed in MkDocs versions 1.6.0 and higher, causing a compatibility issue.
fix
Downgrade your MkDocs installation to a version compatible with mkdocs-jupyter (e.g., `mkdocs==1.5.3`) or wait for an update to mkdocs-jupyter that resolves this compatibility. `pip install "mkdocs<1.6"`
Notebook files not rendering in MkDocs site or kernel execution errors
This typically occurs because required Jupyter dependencies (like `jupyter`, `nbconvert`, or `ipykernel`) are missing, a suitable Jupyter kernel is not available in the environment where MkDocs is built, or notebook execution is explicitly disabled in the `mkdocs.yml` configuration.
fix
Install the necessary Jupyter dependencies: `pip install jupyter nbconvert ipykernel`. Verify that a kernel is available and registered (`jupyter kernelspec list`). If notebooks are not executing, ensure `execute: true` is set under the `mkdocs-jupyter` plugin configuration in your `mkdocs.yml`.
FileNotFoundError: [Errno 2] No such file or directory (related to notebooks or images in notebooks)
This error happens when MkDocs or mkdocs-jupyter cannot locate a specified notebook file, or an image/asset referenced within a notebook during the build process. This can be due to incorrect file paths, files not being in the `docs` directory, or issues with how `use_directory_urls` is configured, affecting relative paths to assets.
fix
Double-check that the notebook file paths in your `mkdocs.yml` navigation are correct relative to your `docs_dir`. For images, ensure they are in the correct location relative to the notebook or consider setting `use_directory_urls: false` in `mkdocs.yml` if relative image paths are causing issues.
Upgrade
Version history
0.26.2latest on PyPI · released Apr 13, 2026
Audit
Dependencies
mkdocsrequiredCore dependency for the plugin to function.
nbconvertrequiredRequired for converting Jupyter notebooks to HTML during the build process.
jupytextrequiredRequired for processing .nb.py files and for some notebook functionalities.
ipykerneloptionalRequired for executing notebooks during the build process if 'execute: true' is enabled.
jupyteroptionalGeneral Jupyter ecosystem tools, often needed alongside nbconvert and ipykernel for robust notebook handling.
Agent activity
6 hits · last 30 days
node
6
Resources
mkdocs-jupyter — pip install mkdocs-jupyter · libregistry