@@ -43,7 +43,7 @@ def write(self, *args, **kwargs):
4343
4444 1. You can pass in multiple arguments, all of which will be written.
4545 2. Its behavior depends on the input types as follows.
46- 3. It returns None, so it's "slot" in the App cannot be reused.
46+ 3. It returns None, so its "slot" in the App cannot be reused.
4747
4848 Parameters
4949 ----------
@@ -60,14 +60,15 @@ def write(self, *args, **kwargs):
6060 - write(func) : Displays information about a function.
6161 - write(module) : Displays information about the module.
6262 - write(dict) : Displays dict in an interactive widget.
63- - write(obj) : The default is to print str(obj).
6463 - write(mpl_fig) : Displays a Matplotlib figure.
6564 - write(altair) : Displays an Altair chart.
6665 - write(keras) : Displays a Keras model.
6766 - write(graphviz) : Displays a Graphviz graph.
6867 - write(plotly_fig) : Displays a Plotly figure.
6968 - write(bokeh_fig) : Displays a Bokeh figure.
7069 - write(sympy_expr) : Prints SymPy expression using LaTeX.
70+ - write(htmlable) : Prints _repr_html_() for the object if available.
71+ - write(obj) : Prints str(obj) if otherwise unknown.
7172
7273 unsafe_allow_html : bool
7374 This is a keyword-only argument that defaults to False.
@@ -217,6 +218,11 @@ def flush_buffer():
217218 elif type_util .is_pydeck (arg ):
218219 flush_buffer ()
219220 self .dg .pydeck_chart (arg )
221+ elif hasattr (arg , "_repr_html_" ):
222+ self .dg .markdown (
223+ arg ._repr_html_ (),
224+ unsafe_allow_html = True ,
225+ )
220226 else :
221227 string_buffer .append ("`%s`" % str (arg ).replace ("`" , "\\ `" ))
222228
0 commit comments