[IPython-dev] embedded image urls (markdown, others) and nbviewer/print

Matthias BUSSONNIER bussonniermatthias at gmail.com
Sun Sep 16 08:11:18 EDT 2012


Le 15 sept. 2012 à 21:50, MinRK a écrit :

> 
> 
> On Sat, Sep 15, 2012 at 12:39 PM, Aron Ahmadia <aron at ahmadia.net> wrote:
> Apparently, normal markdown/html is insensitive to a "/files" URL vs
> "files", however the preview markup requires:
> 
> "/files"
> 
> I'm not sure what the intended behavior is.
> 
> This should be considered a bug.  "files" (relative) is correct because "/files" (absolute) will break if/when url schemes change such that the notebook is served from non-root url (as is likely when multi-user is introduced). 

The problem with nbviewer is that you can ask it to render almost any url, 
it has no way to know wether "files" in the requested url is legitimate or not. 

assuming I am rendering the file 

http://my/super/project/with/a/notebook.ipynb
through the url 
http://nbviewer.ipython.orl/url/my/super/project/with/a/notebook.ipynb

I have a link to the image <img src='./my/image.png'>

nbviewer is asked to get

http://nbviewer.ipython.orl/url/my/super/priject/with/a/files/my/image.png
(dev version is smart enough to know that this is png and don't crash and return raw data, which current version does not) 

But `files` can be anywhere in the url. Blindly stripping it would prevent any url containing legitimates 'files' part from working. 

Though it is still a bug which should be easier to fix once nbconvert has been refactored.
-- 
Matthias

> 
> A
> 
> On Sat, Sep 15, 2012 at 10:35 PM, Aron Ahmadia <aron at ahmadia.net> wrote:
> > We're "printing" our slides out for SC12 (they're due today), and I
> > noticed that images don't show up properly through nbviewer if they
> > are coming from Markdown.  They also appear to be broken from a normal
> > dialogue.  What's the correct way to export an IPython notebook that
> > uses Markdown images?
> >
> > Cheers,
> > A
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
> 
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20120916/a77136a6/attachment.html>


More information about the IPython-dev mailing list