MCPcopy Create free account
hub / github.com/ipython/ipython / HTMLFormatter

Class HTMLFormatter

IPython/core/formatters.py:707–721  ·  view source on GitHub ↗

An HTML formatter. To define the callables that compute the HTML representation of your objects, define a :meth:`_repr_html_` method or use the :meth:`for_type` or :meth:`for_type_by_name` methods to register functions that handle this. The return value of this formatter should

Source from the content-addressed store, hash-verified

705
706
707class HTMLFormatter(BaseFormatter):
708 """An HTML formatter.
709
710 To define the callables that compute the HTML representation of your
711 objects, define a :meth:`_repr_html_` method or use the :meth:`for_type`
712 or :meth:`for_type_by_name` methods to register functions that handle
713 this.
714
715 The return value of this formatter should be a valid HTML snippet that
716 could be injected into an existing DOM. It should *not* include the
717 ```<html>`` or ```<body>`` tags.
718 """
719 format_type = Unicode('text/html')
720
721 print_method = ObjectName('_repr_html_')
722
723
724class MarkdownFormatter(BaseFormatter):

Callers 6

test_error_methodFunction · 0.90
test_warn_error_for_typeFunction · 0.90
test_print_method_boundFunction · 0.90
test_print_method_weirdFunction · 0.90
test_format_configFunction · 0.90

Calls

no outgoing calls

Tested by 6

test_error_methodFunction · 0.72
test_warn_error_for_typeFunction · 0.72
test_print_method_boundFunction · 0.72
test_print_method_weirdFunction · 0.72
test_format_configFunction · 0.72