# ``twisted`.`web`.`template``

module documentation
(source)

HTML rendering for twisted.web.

Class | `CharRef` | A numeric character reference. Given a separate representation in the DOM so that non-ASCII characters may be output as pure ASCII.
Class | `TagLoader` | An `ITemplateLoader` that loads an existing flattenable object.
Class | `XMLFile` | An `ITemplateLoader` that loads and parses XML from a file.
Class | `XMLString` | An `ITemplateLoader` that loads and parses XML from a string.
Function | `renderElement` | Render an element or other `IRenderable`.
Constant | `TEMPLATE_NAMESPACE` | Undocumented
Constant | `VALID_HTML_TAG_NAMES` | Undocumented
Variable | `tags` | Undocumented

def renderElement(request, element, doctype=b'<!DOCTYPE html>', _failElement=None): (source)
Render an element or other `IRenderable`.

Parameters
request:`IRequest` | The `IRequest` being rendered to.
element:`IRenderable` | An `IRenderable` which will be rendered.
doctype:`Optional[bytes]` | A `bytes` which will be written as the first line of the request, or `None` to disable writing of a doctype. The argument should not include a trailing newline and will default to the HTML5 doctype `'<!DOCTYPE html>'`.
_failElement:`Optional[Callable[[Failure], Element]]` | Undocumented
Returns
`object` | NOT_DONE_YET
Present Since
12.1

TEMPLATE_NAMESPACE: `str` = (source)

Undocumented

Value

    'http://twistedmatrix.com/ns/twisted.web.template/0.1'

VALID_HTML_TAG_NAMES: `set[str]` = (source)

Undocumented

Value

    set(['a',
         'abbr',
         'acronym',
         'address',
         'applet',
         'area',
         'article',
    ...

tags = (source)

Undocumented