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
| Name | Type | Description |
|---|---|---|
| python_value | Any | The Python object to be converted to HTML. |
Returns
| Type | Description |
|---|---|
str | An HTML document as a string. |