[IPython-dev] loading a static JS file when loading an IPython extension in the notebook

MinRK benjaminrk at gmail.com
Fri Jul 11 18:42:40 EDT 2014


%load_ext myext should do:

# stage javascript to nbextensions:
from IPython.html.nbextensions import install_nbextension
install_nbextension(myjsfiles)

# load javascript in the frontend:
from IPython.display import display, Javascript
display(Javascript("IPython.load_extensions('mextension')"))

-MinRK

On Thu, Jul 10, 2014 at 7:48 AM, Cyrille Rossant <cyrille.rossant at gmail.com>
wrote:

> Hi,
>
> What is the best way to write an IPython extension such that
> `%load_ext myext` loads `myscript.js` in the current notebook? If
> possible, I'd prefer to avoid asking users to make manual changes to
> custom.js or similar.
>
> Thanks,
> Cyrille
> _______________________________________________
> 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/20140711/2991d826/attachment.html>


More information about the IPython-dev mailing list