title: Link to python file in Jupyter notebook markup cell
body: <p>Suppose the following: I locally execute the <code>jupyter-notebook</code> server in my home directory.</p>
  
  <p>I have the following files in <code>~/temp/jupyter_link</code>:</p>
  
  <pre><code>index.ipynb  python_file.py
  </code></pre>
  
  <p>In a markup cell in <code>index.ipynb</code> I want to create a link to <code>python_file.py</code>. This link should open <code>python_file.py</code> with the jupyter-notebook editor. I can do that with:</p>
  
  <pre><code>[python_file](https://localhost:8888/edit/temp/jupyter_link/python_file.py)
  </code></pre>
  
  <p>However, this link contains the absolute path of <code>python_file.py</code>. I want to use the relative path (with the base directory being the one from <code>index.ipynb</code>). I can create a link using the relative path with:</p>
  
  <pre><code>[python_file](python_file.py)
  </code></pre>
  
  <p>However, if I click this link I'm asked to download the file and it's not opened with the jupyter-notebook editor. </p>
  
  <p>Is it possible to create a link that opens the python file with the jupyter-notebook editor but that uses a relative path? The pseudo-code I imagine would be something like:</p>
  
  <pre><code>[python_file](edit:python_file.py)
  </code></pre>
  
  <p>Inspired by @Ivan's answer I might add that </p>
  
  <pre><code>[python_file](/edit/temp/jupyter_link/python_file.py)
  </code></pre>
  
  <p>also opens the editor. That removes the host name from the link, but still does not give me a relative link.</p>