[IPython-dev] magics and metadata

Jonathan Taylor jonathan.taylor@stanford....
Fri Jun 22 02:41:09 CDT 2012

> The trick is to find a clean way of expressing this that happens:
> 1. before execution of the cell. Highlighting isn't very useful by the
> time the cell has been run

Fair enough, but the browser can update the highlighting if it is told
(after execution) that it is a %%bash cell. So, after execution, the
highlighting would look OK (much like after rendering markdown looks like
rendered LaTeX).

> 2. keeping the separation between kernels and notebooks we currently
> have.  Keep in mind that the kernel has *no idea* that it's being
> called by a notebook, all it knows is that it was given a chunk of
> code to run.

Each chunk can be thought of as a cell. In the console, a chunk would be
either one line or a multiline input, much as cell magics work in the
console right now.
Some frontends could use the metadata associated
to that chunk, others might not.

I don't know the internals of the console that well, but how different is
it to the logic
in Min's test script for a notebook (https://gist.github.com/2620876)? If
each call
goes through something like line 32 in that file, then it seems like it is
reasonable to have
a msg that is a "metadata" for that last execute request. This script has
no notebook, but I would be happy
if I could send the iochannel some metadata (via the shell channel) for the
last execute request.

What would be needed is for the execute request to generate some "metadata"


Jonathan Taylor
Dept. of Statistics
Sequoia Hall, 137
390 Serra Mall
Stanford, CA 94305
Tel:   650.723.9230
Fax:   650.725.8977
Web: http://www-stat.stanford.edu/~jtaylo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20120622/bb1e60cd/attachment.html 

More information about the IPython-dev mailing list