[IPython-dev] Sharing Custom Widgets
jon.freder at gmail.com
Mon Apr 21 19:26:10 EDT 2014
My responses are inline below,
On Mon, Apr 21, 2014 at 3:32 PM, Pierre Villeneuve <
pierre.villeneuve at gmail.com> wrote:
> I am working on a Notebook project where I want to build an HTML view of
> Initially I had decided my display would not need to communicate with
> anything in Python land and would simply be an isolated interactive
> rich display functions.
> I really like the new Widget system and I am considering switching over as
> I have new ideas for possible interaction with my display. I have looked
> through a number of examples for custom widget's, but it's not clear how
> one might share a custom widget for use by other users. I see that I can
> define everything in a couple of Notebook cells, and then require the user
> to step through and execute them. Or I could require the user to place
> files inside their .profile's static/custom folder, but that seems awkward.
AFAIK the later is the "official" way to redistribute custom JS/CSS.
Personally, I prefer to include the JS in the same directory is my
notebooks, I think it's easier for the user that way. It's kind of a hack,
but you can see how I do it in https://github.com/jdfreder/ipython-d3 .
The idea is to include a .py and .js file next to the notebook. The .py
file has a function that pushes the .js to the page using the display
framework. For the user, this means all they have to do is create a
notebook in the same directory and do something like `import custompython;
> Does there exist a prescription for how I might package a custom widget
> for simple installation by a remote users? From my simple investigation so
> the default ipython/html folder, or under the user's profile static folder.
> It would be nice if there was a mechanism to specify an additional folder,
> e.g. a static folder I define as part of my package that gets installed by
> the user.
We don't have a nice way to package IPython notebook extensions yet...
> Thanks for any advice.
> *Pierre Villeneuve*
> pierre.villeneuve at gmail.com
> IPython-dev mailing list
> IPython-dev at scipy.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev