Links between IPython notebooks

Solution 1:

Since IPython 2 you may use exactly the syntax you first tried:

Link to [Notebook 2](notebook2.ipynb)

Solution 2:

It is now possible to do this with Ipython 1.0+ at least.

Just do: localhost:8888/My Notebook.ipynb

Here is the documentation for this feature. https://github.com/ipython/ipython/pull/3058

Solution 3:

From http://python.6.n6.nabble.com/where-is-the-code-to-generate-IPython-Notebook-URL-for-a-new-ipynb-file-td4996991.html:

You can access a json version of all the notebooks from url: $host/notebooks

Here is a snippet that worked for me:

    import urllib2
    import json
    data = urllib2.urlopen("http://127.0.0.1:8888/notebooks")
    json_data=data.read()
    list_o_dicts=json.loads(json_data)
    for d in list_o_dicts:
        if d['name'] == 'test':
            print d['notebook_id']

Modify this according to your need.

** on further reading, I just realized OP was also seeking new notebook creation, keeping my answer anyway as way to work with linking existing notebooks.

One way to try for OP's goal is to run a script which will create a new notebook.ipynb file into the ipython folder where ipython notebook was started from. That .ipynb file can be templated from a new ipython notebook created from dashboard, with the name and id of the notebook replaced with whatever you are trying to link from your existing notebook. I have not tried this, but should work since dropping a .ipynb extension file into ipython folder does show it up in the dashboard.

Solution 4:

In addition to akim's suggestion - you can link to any (py or ipynb) file using a relative link, starting with "edit", and and then from the directory where you started the server.

E.g. in a markdown cell, if I want to reference a file whose relative location (relative to my git repo, which is also where I launched the notebook server) is "./path/to/source.py", I'd add:

[link to source](/edit/path/to/source.py)

Solution 5:

Remember that if your file name has spaces you will need to replace those with %20

eg:

[Numpy](Numpy%20For%20Python.ipynb)