How nbconvert handles relative URI (e.g. image link in markdown?)

12 views
Skip to first unread message

Gabriel Nützi

unread,
Aug 11, 2017, 4:59:26 PM8/11/17
to Project Jupyter
Hi Jupyter Team,

I have written some small extension which uses the html_embed.py converter

see https://github.com/ipython-contrib/jupyter_contrib_nbextensions/pull/1039

and the following question came up about how an exporter should handle relative URIs (e.g image links in markdown) when it comes to exporting
the  exporter in jupyter_contrib_nbextensions/src/jupyter_contrib_nbextensions/nbconvert_support/embedhtml.py
is triggered in a notebook by a menu entry "Download -> Embedded HTML" extension.
The exporter then opens the files (from relative URIs in the markdown)  on the filesystem. 
This behavior is quite unstable, since it only works when jupyters working directory is the same as the notebook which is open.

I was wondering what the correct way would be to deal with these kind of URIs, and how an exporter can resolve these relative links without knowing the working directory of jupyter. 

Thanks for the help!

BR


Reply all
Reply to author
Forward
0 new messages