I’m starting out using widgets in my Jupyter notebooks. I have the need to output some text results in a widget. I will be bolding and highlighting particular parts of the output. HTML would be ideal.
I’ve seen some websites mention that the Output widget can display HTML, but I can’t find an example or explanation of how to do this.
import ipywidgets as widgets
output = widgets.Output()
HTML_text_widget = widgets.HTML(
value='<b>Hell</b>o<br/>Bye<p>You need to pay attention to <mark>this text</mark> today.</p>'
)
with output:
display(HTML_text_widget)
display(output)