[IPython-User] Sphinx live link to nbviewer view of notebook

Martijn Vermaat martijn@vermaat.n...
Wed Apr 3 16:49:29 CDT 2013


2013/4/3 Matthew Brett <matthew.brett@gmail.com>:
>> Or maybe I misunderstood your question?
>
> No, but I think that still needs the extra piece, because at sphinx
> build time, sphinx does not know the eventual fulll URL of the raw
> notebook.  Of course I could specify that in a conf flag or some such,
> but it would be nicer to be able to have the page itself work out its
> full URL,

Ah, I did misunderstand (part of) your question. The notebook you're
linking to is located next to the Sphinx files and at Sphinx built
time, it is not known what URL will be used to view them.

I think something like Matthias' suggestion is the only thing you can
do, apart from adding a configuration value. His Javascript code will
work for relative links (`link.href` will give you the absolute URL).
I think the neatest solution would be to combine our answers and
create a small Sphinx extension that generates the Javascript.

cheers,
Martijn


More information about the IPython-User mailing list