user3314418
user3314418

Reputation: 3031

Installing IPython Notebook table of contents

I'd like to install the extension to generate automatic table of contents using header cells.

however, when I copy/paste

curl -L https://rawgithub.com/minrk/ipython_extensions/master/nbextensions/toc.js > $(ipython locate)/nbextensions/toc.js

into terminal, it says directory not found. The extension in question can be found here.

Upvotes: 0

Views: 7671

Answers (4)

Paul Rougieux
Paul Rougieux

Reputation: 11399

Install jupyter_contrib_nbextensions by entering the following commands at the shell

pip install --user jupyter_contrib_nbextensions
jupyter contrib nbextension install --user

Activate the table of content extension:

jupyter nbextension enable toc2/main

There are many other extensions available in this package. Optionally you can install the jupyter notebook extension configurator (not needed)

pip install --user jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user

This will make a configurator available at:

http://localhost:8888/nbextensions

Upvotes: 2

appanponn
appanponn

Reputation: 465

Cloning the repo and creating the sum links did not work for me.

While using ipython 1.1, I had to do the following:

  1. Download the jquery-2.0.2.min.map, from this link and copy it to $HOME/.ipython/profile_default/static/components/jquery/
  2. Create sym link to nbextensions in the $HOME/.ipython/profile_default/static/
    ln -s ../../nbextensions nbextensions

The extension expects the section headings to be in separate cells. So, if one has a markdown cell with a few headings & sub-headings, it will not be recognised.

For ipython 2.2, you need to also download the min map files of backbone & underscore also.

Upvotes: 0

Anna Christine
Anna Christine

Reputation: 896

This IPython Notebook semi-automatically generates the files for minrk's table of contents in Windows (I guess one only needs to change

%%cmd- to %%bash magics 

to make it work in Linux). It does not use the 'curl'-commands or links, but writes the *.js and *.css files directly into your IPython Notebook-profile-directory.

There is a section in the notebook called 'What you need to do' - follow it and have a nice floating table of contents : )

Here is an html version which already shows it: http://htmlpreview.github.io/?https://github.com/ahambi/140824-TOC/blob/master/A%20floating%20table%20of%20contents.htm

Upvotes: 0

Padraic Cunningham
Padraic Cunningham

Reputation: 180401

I did the following and it worked for me using Ubuntu:

1. git clone https://github.com/minrk/ipython_extensions.git

2. ln -s $(pwd)/extensions $(ipython locate)/extensions
   ln -s $(pwd)/nbextensions $(ipython locate)/nbextensions

3. curl -L https://rawgithub.com/minrk/ipython_extensions/master/nbextensions/gist.js > $(ipython locate)/nbextensions/gist.js

4. I use ubuntu so I  used the text editor from bash like so   gedit $(ipython locate profile)/static/custom/custom.js. 

5. I appended "IPython.load_extensions('gist');" to the bottom of  custom.js and saved the file.

If you want to install the Retina Figures extension follow the rest of the instructions here

If you do are using Windows there is a tutorial here that shows both how to create sym links in Windows and Linux.

If you do not have git installed then download the zip file with this link

Upvotes: 1

Related Questions