[IPython-dev] Best way to package extension JS/CSS

Nicholas Bollweg nick.bollweg at gmail.com
Tue May 19 16:46:23 EDT 2015


Jupyter-pip <https://github.com/jdfreder/jupyter-pip> is your best bet
right now. It helps you work effectively with the whole nbextensions thing.

Basically, you build a setup.py (and MANIFEST.in, etc), add the jupyter-pip
magic, and then you go.

Here's an example from bitjet:
https://github.com/rgbkrk/bitjet/blob/master/setup.py

Since you have more than one file, I recommend building out your repo like:

   - setup.py
   - yourmodule/
      - __init__.py (and whatever else)
      - static/
         - yourmodule/
            - yourmodule.js (or whatever)
            - yourmodule.css

then, in the setup.py, you can can say
cmdclass(path="yourmodule/static/yourmodule") and it will copy the whole
directory. Don't forget the MANIFEST.in!

On Tue, May 19, 2015 at 4:30 PM Thorin Tabor <tabor at broadinstitute.org>
wrote:

> Hello,
>
> I have a Jupyter extension that I've written that includes several
> magics and a handful of custom widgets. These widgets have a sizable
> amount of JavaScript and some CSS that they depend on.
>
> Currently I have the code working with all the necessary JS and CSS in
> custom.js and custom.css, respectively. However, I want to be able to
> distribute my extension for other people to install in such a way that
> it plays nicely with other extensions, and without them having to
> manually merge my code into their custom.* files.
>
> What is the recommended way to do this?
>
> Thorin
> _______________________________________________
> 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/20150519/f5e83615/attachment.html>


More information about the IPython-dev mailing list