I like IPython\'s Markdown cells for incorporating HTML and other rich content inside notebooks. I would like to know if a command output can be formatted similarly, in outp
Just adding some extra feature to your code example
htmlContent = ''
def header(text):
raw_html = '' + str(text) + '
'
return raw_html
def box(text):
raw_html = ''+str(text)+''
return raw_html
def addContent(raw_html):
global htmlContent
htmlContent += raw_html
# Example
addContent( header("This is a header") )
addContent( box("This is some text in a box") )
from IPython.core.display import HTML
HTML(htmlContent)
gives you this: