[IPython-dev] magics and metadata

Thomas Kluyver takowl at gmail.com
Tue Jun 19 11:49:03 EDT 2012

On 19 June 2012 16:08, Jonathan Taylor <jonathan.taylor at stanford.edu> wrote:
> Yes, it would not be good to have the API of cell magics be notebook
> specific. What about providing a reference to the current cell metadata in
> the Magics class that can be used to update the NotebookNode after executing
> cell.input? So, cell_magics would not have access to the metadata on
> execution but could pass any metadata it wanted to back to the notebook.

Before we get too far into the mechanism, let's try to think about
actual use cases, so we can figure out how things need to work.

We can also see cell magics themselves as a sort of within-cell
metadata. For example, the frontend might one day be aware that if a
cell starts with %%bash, different syntax highlighting and tab
completion rules apply to it. I think this would need to be within the
frontend, rather than going through the kernel, because we want to use
the new highlighting & completion before the cell is executed.


More information about the IPython-dev mailing list