Printing HTML within IPython Notebook / IPython-specific prettyprint?
I know that I can use IPython.core.display.HTML to format something such that it outputs as HTML into the notebook. However, it appears to only work if it's the output of a cell, e.g.
from IPython.core.display import HTML
html_text = HTML("<p style='font-weight: bold;'> Some text! </p>")
But I'd like to be able to output pretty printed HTML in the midst of a function. Is it possible to get IPython to consider something as HTML (instead of as plain text)? I tried using `lib.pretty`, but that didn't hook into it, and a plain print statemtn didn't work either.).
It would be great to be able to do something like
from __future__ import print_function
from IPython.somemodule import print_func
print_func = print
Does this exist now and/or is it planned for the future? If not, any suggestions on how I might go about making this work?