[IPython-User] Question about the notebook: python references n markdown?

Thomas Kluyver takowl@gmail....
Sun Oct 16 15:22:10 CDT 2011


On 16 October 2011 20:57, Toby Burnett <tburnett@uw.edu> wrote:

> **
>
> My question is with regard to the markdown cells. Is it possible, or could
> it be, for it to include references to python variables? If so, it would
> satisfy a need to display nicely formatted output, tables for example. (I
> see that markdown passes HTML table tags to the browser.)
>

If I understand what you mean, you can explicitly display HTML fragments
with a Python cell like this:

from IPython.core.display import HTML
HTML("<h1>Foo</h1>")

You can use a templating system like Jinja2 or Mako to assemble the HTML if
you want. You can also give classes a _repr_html_ method to give instances
an HTML representation.

Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20111016/8db4178f/attachment.html 


More information about the IPython-User mailing list