Adding Extensions to Jupyter Notebooks

Pavel Dimens Updated by Pavel Dimens

Adding Jupyter extensions

The stock Jupyter notebooks experience is alright but leaves room for improvement. From a student experience, it may be useful to have some extra features like a navigable table of contents or line numbers. Rather than installing extensions separately, we can install jupyter_contrib_nbextensions and enable whichever ones we want using jupyter_nbextensions_configurator.

Installing

Open a Codio unit with Jupyter Notebooks installed in it and open a terminal tab.

Install Nbextensions

This needs to be installed as a user -U and doesn't require sudo privileges.

pip install -U jupyter_contrib_nbextensions

Install the extensions

The second step installs the 3rd party extensions for the user.

jupyter contrib nbextension install --user

Install Nbextensions Configurator

This needs to be installed as a user -U and doesn't require sudo privileges.

pip install -U jupyter_nbextensions_configurator

Enable Configurator

jupyter nbextensions_configurator enable --user

After installation, restart the Codio box (or the Jupyter server) for the changes to take effect.

Enabling Extensions

Open a ipynb inside the Codio instance and click the Jupyter logo (top-left header of the notebook), which takes you to the file tree. Once there, head to the Nbextensions tab. Enabling/disabling extensions is as simple as clicking a box. Some extensions have configuration options, but in most cases the defaults suffice. See below that the colors are changed for the Table of Contents to match eCornell colors. You will want to enable these extensions:

  • Table of Contents (2)
    • Hover color: 227,227,227
    • Color of highlight mark on scrolling: 179,27,27
    • Color of navigate text: 64,64,64
    • Color of navigate number: 64,64,64
  • Variable Explorer
  • Toggle All Line Numbers
  • spellchecker
    • uncheck "enable spellchecker for all Markdown/Raw cells on notebook load"

Video Demonstration

How did we do?

Jupyter Notebooks Style Guide

Setting up R with Jupyter Notebooks

Contact