Quick question: it would seem that the metadata in publish_display_data would get added to an output but not a cell. Is that right?<br><br><div class="gmail_quote">On Tue, Jun 19, 2012 at 12:21 PM, MinRK <span dir="ltr"><<a href="mailto:benjaminrk@gmail.com" target="_blank">benjaminrk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br><div class="gmail_quote"><div class="im">On Tue, Jun 19, 2012 at 12:05 PM, Jonathan Taylor <span dir="ltr"><<a href="mailto:jonathan.taylor@stanford.edu" target="_blank">jonathan.taylor@stanford.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

That's the sort of use case I imagine as well, where a cell magic wants<div>to about something to the frontend a little more information about what kind of cell it is (in your %%bash example, it would be a code cell for which the code_mirror might use bash highlighting instead of python). This seems like it could be accomplished with something parallel to "publish_display_data" for cell metadata which different frontends can handle differently. </div>


</blockquote><div><br></div></div><div>publish_display_data already takes a metadata arg.  This has always been the case, but so far it's totally unused.</div><div><br></div><div>I just noticed, this metadata is *not* included in the added fields preserved in the notebook, but I will get on that.</div>
<span class="HOEnZb"><font color="#888888">

<div><br></div><div>-MinRK</div></font></span><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div><div>
<br><div class="gmail_quote">On Tue, Jun 19, 2012 at 8:49 AM, Thomas Kluyver <span dir="ltr"><<a href="mailto:takowl@gmail.com" target="_blank">takowl@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div>On 19 June 2012 16:08, Jonathan Taylor <<a href="mailto:jonathan.taylor@stanford.edu" target="_blank">jonathan.taylor@stanford.edu</a>> wrote:<br>
> Yes, it would not be good to have the API of cell magics be notebook<br>
> specific. What about providing a reference to the current cell metadata in<br>
> the Magics class that can be used to update the NotebookNode after executing<br>
> cell.input? So, cell_magics would not have access to the metadata on<br>
> execution but could pass any metadata it wanted to back to the notebook.<br>
<br>
</div>Before we get too far into the mechanism, let's try to think about<br>
actual use cases, so we can figure out how things need to work.<br>
<br>
We can also see cell magics themselves as a sort of within-cell<br>
metadata. For example, the frontend might one day be aware that if a<br>
cell starts with %%bash, different syntax highlighting and tab<br>
completion rules apply to it. I think this would need to be within the<br>
frontend, rather than going through the kernel, because we want to use<br>
the new highlighting & completion before the cell is executed.<br>
<div><div><br>
Thomas<br>
_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org" target="_blank">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div></div></div><div>-- <br>Jonathan Taylor                          <br>Dept. of Statistics                      <br>Sequoia Hall, 137                          <br>


390 Serra Mall<br>
Stanford, CA 94305<br>Tel:   <a href="tel:650.723.9230" value="+16507239230" target="_blank">650.723.9230</a><br>Fax:   <a href="tel:650.725.8977" value="+16507258977" target="_blank">650.725.8977</a><br>Web: <a href="http://www-stat.stanford.edu/%7Ejtaylo" target="_blank">http://www-stat.stanford.edu/~jtaylo</a><br>



</div></div></div>
<br>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org" target="_blank">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote></div></div></div><br>
<br>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Jonathan Taylor                          <br>Dept. of Statistics                      <br>Sequoia Hall, 137                          <br>390 Serra Mall<br>Stanford, CA 94305<br>
Tel:   650.723.9230<br>Fax:   650.725.8977<br>Web: <a href="http://www-stat.stanford.edu/~jtaylo">http://www-stat.stanford.edu/~jtaylo</a><br>