Jupyter Nbextensions Configurator
A server extension for jupyter notebook which provides configuration interfaces for notebook extensions (nbextensions).
jupyter_nbextensions_configurator jupyter server extension provides
graphical user interfaces for configuring which nbextensions are enabled
(load automatically for every notebook).
In addition, for nbextensions which include an appropriate yaml descriptor file
(see below), the interface also renders their markdown readme files, and
provides controls to configure the nbextensions' options.
This project was spun out of work from
For those using conda, you can now get
the excellent conda-forge
channel in a single command:
conda install -c conda-forge jupyter_nbextensions_configurator
For those not using conda, the installation has two steps:
Installing the pip package. This should be as simple as
pip install jupyter_nbextensions_configurator
Configuring the notebook server to load the server extension. A
jupytersubcommand is provided for this. You can enable the serverextension and the configurator nbextensions listed below for the current user with
jupyter nbextensions_configurator enable --user # can be skipped for notebook >=5.3
The command accepts the same flags as the
jupyter serverextensioncommand provided by notebook versions >= 4.2, including
--systemto enable in system-wide config (the default), or
--sys-prefixto enable in config files inside python's
sys.prefix, such as for a virtual environment. The provided
jupyter nbextensions_configuratorcommand can also be used to
Once installed, you'll need to restart the notebook server. Once restarted, you should be able to find the configurator user interfaces as described below.
jupyter_nbextensions_configurator is installed and enabled, and your
notebook server has been restarted, you should be able to find the nbextensions
configuration interface at the url
<base_url> is described below (for simple installs, it's usually just
the UI is at
For most single-user notebook servers, the dashboard (the file-browser or 'tree' view) is at
base_url is the part between the host (
tree, so in this case it's the default value of just
If you have a non-default base url (such as with JupyterHub), you'll need to
prepend it to the url. So, if your dashboard is at
then you'll find the configurator UI page at
In addition to the main standalone page, the nbextensions configurator interface is also available as a tab on the dashboard:
The dashboard tab is provided via an nbextension called
"Nbextensions dashboard tab", with requirejs uri
Since version 0.2.0, this nbextension is enabled by default on enabling
jupyter_nbextensions_configurator serverextension, but it can be disabled
as with any other nbextension if you don't want to use it.
edit menu item
jupyter_nbextensions_configurator provides a second small nbextension, which
simply adds an item to the notebook-view edit menu, which links to the
configurator UI page:
Similarly to the tree tab nbextension detailed above, since version
0.2.0, the edit menu item nbextension is enabled by default when
enabling the main
jupyter_nbextensions_configurator serverextension, but can
be disabled at any time in the same way as other nbextensions.
YAML file format
You don't need to know about the yaml files in order simply to use
An nbextension is 'found' by the
extension when a special yaml file describing the nbextension and its options
is found in the notebook server's
The yaml file can have any name with the file extension
describes the nbextension and its options to
The case-sensitive keys in the yaml file are as follows:
Type, (required) a case-sensitive identifier, must be
IPython Notebook Extensionor
Jupyter Notebook Extension
Name, the name of the nbextension
Section, which view the nbextension should be loaded in (defaults to
notebook, but can alternatively be
edit, or to load in all views,
Description, a short explanation of the nbextension
Link, a URL for more documentation. If this is a relative url with a
.mdfile extension (recommended!), the markdown readme is rendered in the configurator UI.
Icon, a URL for a small icon for the configurator UI (rendered 120px high, should preferably end up 400px wide. Recall HDPI displays may benefit from a 2x resolution icon).
Compatibility, Jupyter major version compatibility, e.g.
3.x, 4.x, 5.x
Parameters, an optional list of configuration parameters. Each item is a dictionary with (some of) the following keys
name, (required) the name used to store the configuration variable in the config json. It follows a json-like structure, so you can use
.to separate sub-objects e.g.
description, a description of the configuration parameter
input_type, controls the type of html tag used to render the parameter in the configurator UI. Valid values include
checkbox, [html5 input tags such as
color, ...], plus a final type of
list_element, a dictionary with the same
input_typekeys as a
Parametersentry, used to render each element of the list for parameters with input_type
- finally, extras such as
maxmay be used by
numbertags for validation
tags, a list of string tags describing the nbextension, to allow for filtering
Type: Jupyter Notebook Extension Name: Limit Output Section: notebook Description: This nbextension limits the number of characters that can be printed below a codecell tags: - usability - limit - output Link: readme.md Icon: icon.png Main: main.js Compatibility: 4.x Parameters: - name: limit_output description: Number of characters to limit output to input_type: number default: 10000 step: 1 min: 0 - name: limit_output_message description: Message to append when output is limited input_type: text default: '**OUTPUT MUTED**'
If you encounter problems with this server extension, you can:
- check the issues page for the github repository. If you can't find one that fits your problem, please create a new one!
- ask in the project's gitter chatroom
For debugging, useful information can (sometimes) be found by:
- Checking for messages in the notebook server's logs. This is particularly
useful when the server is run with the
--debugflag, to get as many logs as possible.
- Import notebook version
- Fix marked.js
- Remove scripts from setup.py
- Support nbclassic.
- Show error messages when failing to load a config file, allowing remaining files to load ok.
- use pip for conda recipe installation, instead of
- don't use
notebook.base.handlers.json_errorsfor notebook >= 5.2.0, as it's deprecated.
- auto-pad 3-char colour codes (e.g.
#BEC) to 6-char, as otherwise the HTML5 controls don't initialize correctly.
- Split specification checking into a separate function
- Fixes for bugs in notebook 5.1.0
- Require newer version of
jupyter_contrib_corefor notebook 5 compatibility.
- Require newer version of
jupyter_contrib_corein order to ensure setting the correct config key when enabling.
- Deduplicate entries in
nbextensions_pathbefore checking them, to prevent displaying duplictae entries for nbextesions in the same place. Also add tests for deduplication.
- Open yaml files using utf-8 encoding, allowing non-ascii characters, courtesy of @haobibo.
- List configurator's own nbextensions as compatible with notebook 5.x
- CI updates for 5.x testing, and working around a conda bug.
- Allow filtering based on name and description text as well as section & tags
- Add a clear-filter control
- Allow unconfigurable nbextensions to be 'forgotten' (enabled/disabled status erased completely)
- Allow refreshing the nbextensions list, see for details #29
- Add tooltip for parameter reset, as requested in #29
- Add IPython CodeMirror mode to markdown renderer
- Don't embed nbextensions data into the standalone
/nbextensionspage. This allows us to serve the page quicker, then get nbextensions data (slow request) from the json api.
- Improved log messages, with prefixes, both on client & server side
- Fix bug preventing matching first tag
- Fix bug preventing render of markdown containing unknown CodeMirror mode(s)
- Fix minor css margin issue with visible/not visible compatibility
- Make tests more robust against misleading timing-based failures
- Update jupyterhub test spawner to match hub version 0.7 api
- Update CI to use selenium 3, allowing us to test on recent firefox versions
- Add yet another new coverage argument for CI
- On the dashboard, select the configurator tree tab automatically if the appropriate URL hash is present
- Add filtering of visible nbextensions by names, tags and sections
- Add jupyterhub-based tests, to hopefully catch some issues relating to the
SingleUserServer, like #11 and #14 in future
- README updates
- Bugfix for Enable/Disable application help strings, which both started with
- Bugfix courtesy of @bielern. Fix for a bug
which was preventing the serverextension from loading from a
jupyterhub-spawned singleuser notebook server
- Alterations to the in-repo conda recipe, to use git versioning & build number
- Fix bug introduced in bc2f8b821b2164823cbba4e85d5e921dfd484b11, which prevented disabling nbextensions when using notebook versions < 4.2. Add test to ensure that a disabled nbextension's js doesn't load, rather than just checking json config file.
jupyter_contrib_corepackage for notebook compatibility shims and some testing utilities.
- Automatically enable configurator's own nbextensions when running the app.
- Replace references to CI and other services attached to
jcb91in favour of
Jupyter-contribrepository versions, where possible.
Remove tests dependency on
First public release!
python setup.py bdist_wheel twine upload dist/*