Yaroslav Bulatov
Yaroslav Bulatov

Reputation: 57963

How to find jupyter <nbextension require path> for Table of Contents (2) extension?

I'd like to install and enable Table of Contents (2) plugin using command-line.

The docs suggest that I can do the following

jupyter nbextension enable <nbextension require path>

How do I find this path for this extension?

Upvotes: 4

Views: 5072

Answers (3)

Att Righ
Att Righ

Reputation: 1799

Yeah this does seem like a bit of an oversight. I tried to install the configurator... but had issues.

The approach that worked for me was to look in ~/.local/share/jupyter/nbextensions or similar (you might need to use a docker run image /bin/bash if you are drinking too much koolaid - or your employer is forcing you to. ).

There is then a .js file in various directories which I think correspond to the extension names. E.g. hinterland/hinterland.js means the extension is called hinterland/hinterland.

Upvotes: 0

pebox11
pebox11

Reputation: 3748

Easy solution:

1/ Visit this unofficial list of nbextensions:

https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/nbextensions.html

and pick the extension you want to enable. Say e.g. that I want to enable "Collapsible Headings", then

2/ type:

jupyter nbextension enable collapsible_headings/main

If the extension is enabled you will see an OK message.

So in general type:

jupyter nbextension enable <name_of_extension>/main

Most of the times it will work for you.

Upvotes: 2

Ghasem Naddaf
Ghasem Naddaf

Reputation: 862

Based on @jfbercher's comemnt in jupyter_contrib_nbextensions#947:

jupyter nbextension install <url>/toc2.zip --user
jupyter nbextension enable toc2/main

If a non-default directory is used in nbextensions_configurator, it can be obtained like the code here:

nbextension_dirs = nbapp_webapp.settings['nbextensions_path']

Upvotes: 0

Related Questions