This page was generated from doc/subdir/gallery.ipynb. Interactive online version: Binder badge.

Creating Thumbnail Galleries#

Inspired by Sphinx-Gallery, you can create thumbnail galleries from a list of Jupyter notebooks (or other Sphinx source files).

nbsphinx does not provide any gallery styles, but you can easily use the styles from Sphinx-Gallery by installing it:

python3 -m pip install sphinx-gallery

… and loading the styles in your conf.py with:

extensions = [
    'nbsphinx',
    'sphinx_gallery.load_style',
    # more extensions, if needed ...
]

You’ll need Sphinx-Gallery version 0.6 or higher.

Note

Sphinx-Gallery has changed its CSS classes in version 0.11 in an incompatible way (see issue #655). To restore the intended look, update your dependencies to an older version:

sphinx-gallery<0.11

However, you can also create your own CSS styles if you prefer (then you don’t need to install Sphinx-Gallery). You can load your CSS files with html_css_files.

The following sections present two different ways of creating thumbnail galleries in Jupyter notebooks and show how thumbnail images can be selected. Thumbnail galleries can also be created in reStructuredText files.