Dear ipython notebook users,
I want to insert a link to a local file located in the notebook directory, and no, it is not an image (the only example I've found). I want to insert this link within a markdown cell.
When clicked on the link, the file is to be opened with a local application (in this case, a molecule viewer)
I've tried to come up with the correct syntax, but no luck. Please, any help is greatly appreciated.
First open a markdown cell in Jupyter - can be a new markdown cell or an existing markdown cell. Then copy and paste the actual web address into a markdown cell. This will provide an active link to that website from the Notebook. Step 2, from that website, copy the image that you want to view in the Notebook.
If the file is in the same directory as the one where the . md is, then just putting [Click here](MY-FILE.md) should work. Otherwise, can create a path from the root directory of the project.
Just follow the same steps each time. Press Esc key, type m for markdown cell, press Enter key. The cursor is now in the markdown cell waiting for instructions. Type your code or paste a code block.
I want to insert a link to a local file located in the notebook directory
I want to insert this link within a markdown cell.
The path need to be relative to where the server has been started, and prefixed with files/
. e.g: [my molecule](files/molecules/ethanol.mol)
the file is to be opened with a local application (in this case, a molecule viewer)
Not possible unless your application support custom links protocol like the itunes://
or apt-get://
one. the best that can append is that on link click you will be prompted to download the file. (keep in mind that the server can be on a different machine thant your browser)
completenting the answer of Matt, it will work only in you import FileLink
from IPython.display import FileLink, FileLinks FileLink('path_to_file/filename.extension')
Then in a markdown cell insert your links waterBox30.pdb
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With