skillfed

nbsphinx-link

A sphinx extension for including notebook files outside sphinx source root

nbsphinx-link v1.4.1 128.9K downloads/30d#11,690 on PyPI39
Permissive license BSD-3-Clause Active released

What it is and what it does

nbsphinx-link solves the problem of including Jupyter notebooks in Sphinx documentation when those notebooks live outside the Sphinx source directory. Normally Sphinx restricts included files to the source tree, but this extension bridges that gap by letting you create lightweight .nblink JSON files that point to notebooks elsewhere on disk—useful for centralizing examples or shared notebook collections that multiple documentation projects reference.

The extension works by reading .nblink files (simple JSON with a "path" key pointing to a notebook and an optional "extra-media" array for associated images) and rendering the referenced notebook into your documentation build. It integrates directly into Sphinx's build pipeline and depends on nbsphinx to handle the actual notebook rendering.

Use it for:

  • Include notebooks from a shared examples directory across multiple Sphinx documentation projects
  • Reference notebooks stored in a separate repository or folder structure without copying them
  • Build documentation that mixes RST files with external Jupyter notebooks using a single Sphinx config
  • Manage notebook-based tutorials centrally while keeping documentation source trees lean

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A Sphinx extension that lets you include Jupyter notebooks from directories outside your Sphinx source root by referencing them via .nblink JSON files.

Yes, if you use Sphinx and need to include Jupyter notebooks from outside your documentation source tree. Low install friction, active maintenance, permissive license, and no known vulnerabilities. The extension solves a specific but real Sphinx limitation with minimal overhead.

Install

nbsphinx-link on PyPI

pip

pip install nbsphinx-link

uv

uv add nbsphinx-link

poetry

poetry add nbsphinx-link

Installing nbsphinx-link

Before you install

Low friction install with active maintenance. Last release 77 days ago, repository not archived, and requires only nbsphinx and sphinx as dependencies.

License in practice

BSD-3-Clause permissive license allows use in most projects with minimal restrictions.

Quickstart

pip install nbsphinx-link

# In conf.py:
extensions = ['nbsphinx_link']

# Create example.nblink:
{"path": "../examples/notebook.ipynb"}

# Reference in RST:
.. include:: example.nblink

Requires Python 3.10 or later; nbsphinx and sphinx must be installed and configured.

Verify before relying

  • Whether .nblink files support nested directory structures or only flat paths
  • How media file paths are resolved when notebooks reference external assets
  • Whether the extension handles notebook cell execution or only renders static output

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — nbsphinx, sphinx
Maintenance actively maintained — 77 days since the last release
Last repo commit
First released
Downloads 128,941/month — #11,690 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: nbsphinx_link-1.4.1-py3-none-any.whl

Keywords: Interactive, Interpreter, Shell, Web

Intended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12

Tags

sphinx notebook inclusionjupyter notebooks in sphinx docsexternal notebook linkingsphinx extension notebooksnblink files sphinxinclude notebooks outside sourcesphinx documentation notebooks
sphinx-extensionjupyter-notebooksdocumentation-build

More Sphinx packages

docstring-parser

Parses Python docstrings in ReST, Google,…

permissive · top 1,000 on PyPI

Sphinx

Sphinx generates professional documentation…

permissive · top 1,000 on PyPI

sphinxcontrib-serializinghtml

A Sphinx extension that outputs documentation…

permissive · top 1,000 on PyPI

alabaster

Alabaster is a clean, responsive Sphinx theme…

permissive · top 1,000 on PyPI

sphinxcontrib-htmlhelp

A Sphinx extension that generates HTML help…

permissive · top 1,000 on PyPI

sphinxcontrib-qthelp

A Sphinx extension that converts documentation…

permissive · top 1,000 on PyPI

nbsphinx

nbsphinx is a Sphinx extension that parses…

permissive · top 5,000 on PyPI

pyprojroot

Finds your project's root directory and…

permissive · top 15,000 on PyPI

myst-nb

Sphinx extension that parses and converts…

unclear · top 5,000 on PyPI

sphinxcontrib-youtube

Adds Sphinx directives to embed YouTube, Vimeo,…

permissive · top 15,000 on PyPI

sphinx_mdinclude

Sphinx extension that lets you include and…

permissive · top 15,000 on PyPI

importnb

importnb lets you import Jupyter notebooks as…

permissive · top 15,000 on PyPI

sphinx-substitution-extensions

Adds substitution support to Sphinx directives,…

permissive · top 15,000 on PyPI

jupyter-sphinx

Jupyter Sphinx Extensions runs code embedded in…

unclear · top 15,000 on PyPI

ipynb

Imports Jupyter Notebook (.ipynb) files as…

permissive · top 15,000 on PyPI

mkdocs-jupyter

Converts Jupyter notebooks and Python scripts…

permissive · top 15,000 on PyPI