Skip to main content

Renderable

This class defines a protocol for objects that can be converted into an HTML representation. It specifies a single method, to_html, which takes a Python value and returns its HTML equivalent as a string. This protocol is designed for rendering various data types, such as Markdown or pandas DataFrames, into a web-friendly format.

Methods


to_html()

@classmethod
def to_html(
python_value: Any
) - > str

Convert an object(markdown, pandas.dataframe) to HTML and return HTML as a unicode string.

Parameters

NameTypeDescription
python_valueAnyThe Python object to be converted to HTML.

Returns

TypeDescription
strAn HTML document as a string.