[IPython-dev] custom web notebook cells

Nicholas Bollweg nick.bollweg at gmail.com
Tue Dec 18 08:16:28 EST 2012

Good brainstorming. I think as I*nb becomes more mainstream, we'll see more
code generators (or is it the other way?), so these are good things to hash
out now.

Offsets are tricky... this would make it such that editing the cell without
%load_ext blockly is almost guaranteed to break it even if you don't edit
the blockly region's content. delimiter-based stuff would at least be
robust in that fashion. Also, in the case of strongly-whitespaced (lolz)
languages, the delimiters would let you know at what col you need to be
spitting out code... I would hate to be unable to refactor some "naked"
blockly-managed code(eek! Sounds like .net) into a function and lose the

actually, would a %blockly magic be appropriate? That might be at the right
level of "different from source", and presumably magics will eventually be
cross-language, right? Still would have the hard deep, though...
On Dec 18, 2012 7:52 AM, "Jason Grout" <jason-sage at creativetrax.com> wrote:

> On 12/18/12 5:41 AM, Nicholas Bollweg wrote:
> > but obviously we need some "metadata" (not cell.metadata) in the code to
> > remain robust to users doing interesting things.
> What if you stored the limits of interesting character ranges in the
> cell metadata when the cell is stored?  When the cell is instantiated,
> you could mark the relevant ranges with the CodeMirror 3 markText
> function so that the range is continually updated.  When the cell is
> saved, you can update the cell metadata with the new ranges.
> Thanks,
> Jason
> _______________________________________________
> 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/20121218/9ddba49e/attachment.html>

More information about the IPython-dev mailing list