Module Expr Str ImportFrom alias ImportFrom alias Import alias Import alias If CompareEq AttributeLoad AttributeLoad NameLoad attr attr Num body Assign NameStore NameLoad Assign NameStore NameLoad ImportFrom alias ImportFrom alias alias Assign NameStore ListLoad Str Str Str Str Str Str Str Str Str Str FunctionDef arguments args NameParam defaults body Expr Str FunctionDef arguments args defaults body Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Dict decorator_list AttributeLoad NameLoad attr decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body If CompareIn NameLoad NameLoad body Return Call SubscriptLoad NameLoad Index NameLoad Return Call NameLoad NameLoad decorator_list decorator_list Assign NameStore Call NameLoad Expr Str FunctionDef arguments args NameParam NameParam defaults Num body Expr Str If Call NameLoad NameLoad Str body Return Call AttributeLoad NameLoad attr NameLoad orelse If Call NameLoad NameLoad NameLoad body Return Call NameLoad NameLoad NameLoad orelse If Call NameLoad NameLoad Str body Return Call NameLoad NameLoad NameLoad orelse If CompareIs NameLoad NameLoad body Return Str Raise Call NameLoad BinOpMod Str NameLoad decorator_list ClassDef bases NameLoad body Assign NameStore ListLoad FunctionDef arguments args NameParam defaults body Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Raise Call NameLoad Str decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore ListLoad Str Str Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body If NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr keyword Lambda arguments args NameParam defaults Call AttributeLoad SubscriptLoad NameLoad Index Num attr Str orelse If NameLoad body Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr ListLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore BinOpAdd BinOpAdd BinOpAdd Str AttributeLoad Call NameLoad NameLoad attr Str AttributeLoad NameLoad attr If CompareIsNot AttributeLoad NameLoad attr NameLoad body AugAssignAdd NameStore Call NameLoad AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body AugAssignAdd NameStore Str AugAssignAdd NameStore Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore BinOpAdd BinOpAdd Call NameLoad NameLoad Str AttributeLoad NameLoad attr If CompareIsNot AttributeLoad NameLoad attr NameLoad body AugAssignAdd NameStore Call NameLoad AttributeLoad NameLoad attr If CompareIs AttributeLoad NameLoad attr NameLoad body AugAssignAdd NameStore Str orelse AugAssignAdd NameStore Str If AttributeLoad NameLoad attr body If BoolOpOr BoolOpAnd CompareEq Call NameLoad AttributeLoad NameLoad attr Num Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad CompareIs SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad body AugAssignAdd NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num orelse AugAssignAdd NameStore Call NameLoad NameLoad If CompareIsNot NameLoad NameLoad body AugAssignAdd NameStore Num AugAssignAdd NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body AugAssignSub NameStore Num AugAssignAdd NameStore Call NameLoad NameLoad AugAssignAdd NameStore BinOpAdd BinOpAdd Str AttributeLoad NameLoad attr Str AugAssignAdd NameStore Call NameLoad NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore BinOpAdd Call NameLoad NameLoad Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body AugAssignAdd NameStore AttributeLoad NameLoad attr AugAssignAdd NameStore BinOpAdd Str Call NameLoad NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return BinOpAdd BinOpAdd BinOpAdd BinOpAdd Call NameLoad NameLoad Str AttributeLoad NameLoad attr Str Call NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return BinOpAdd BinOpAdd Call NameLoad NameLoad AttributeLoad NameLoad attr Call NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return BinOpAdd BinOpAdd Call NameLoad NameLoad Call NameLoad AttributeLoad NameLoad attr NameLoad Call NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad FunctionDef arguments args NameParam defaults body Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return BinOpAdd Call NameLoad NameLoad Call NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore ListLoad Str Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body If CompareIs AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num orelse Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body If CompareIn AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr body Return Call NameLoad AttributeLoad NameLoad attr NameLoad orelse Return Str decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body If CompareIs AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num orelse If CompareNotIn AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr body Assign SubscriptStore AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body If CompareIn AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr body Return Call NameLoad AttributeLoad NameLoad attr NameLoad orelse Return Str decorator_list decorator_list Assign NameStore Dict Str Str Str Str Str Str Str Str NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return IfExp CompareIsNot NameLoad NameLoad BinOpMult BinOpMult Str NameLoad Num Str decorator_list FunctionDef arguments args NameParam defaults body Return IfExp CompareIsNot NameLoad NameLoad Str Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return BinOpAdd BinOpAdd Call NameLoad NameLoad Call NameLoad NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad NameLoad body Return Call NameLoad NameLoad Return Call AttributeLoad Str attr ListComp Call NameLoad NameLoad NameLoad comprehension NameStore NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If UnaryOpNot NameLoad body Continue AugAssignAdd NameStore BinOpAdd Str Call NameLoad NameLoad AugAssignAdd NameStore BinOpAdd BinOpAdd Str Call NameLoad NameLoad NameLoad Str Return NameLoad decorator_list Assign NameStore Call NameLoad GeneratorExp TupleLoad BinOpAdd NameLoad Str NameLoad comprehension NameStore NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Str Str attr Str Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If CompareIs NameLoad NameLoad body Return Str orelse If Call NameLoad NameLoad Str body Return Call NameLoad NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr Str Str attr Str Str attr Str Str If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Str Return NameLoad decorator_list Assign NameStore Str FunctionDef arguments args NameParam defaults NameLoad body Expr Str Return Call NameLoad Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr decorator_list FunctionDef arguments args NameParam defaults NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad NameLoad NameLoad Return NameLoad decorator_list Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad Str Str Str Assign NameStore Dict FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad If Call NameLoad NameLoad Str body Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad decorator_list FunctionDef arguments args NameParam defaults vararg body AugAssignAdd AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore BinOpAdd BinOpAdd BinOpAdd Str AttributeLoad AttributeLoad NameLoad attr attr Str AttributeLoad AttributeLoad NameLoad attr attr If CompareIsNot AttributeLoad NameLoad attr NameLoad body AugAssignAdd NameStore BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr AugAssignAdd NameStore Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body If CompareIsNot AttributeLoad NameLoad attr NameLoad body For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body For NameStore AttributeLoad NameLoad attr body If CompareEq AttributeLoad NameLoad attr NameLoad body Return NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Dict FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad Str Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpAdd BinOpAdd BinOpAdd BinOpAdd Str AttributeLoad AttributeLoad NameLoad attr attr Str Call NameLoad AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults vararg body AugAssignAdd AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body Return NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body For NameStore AttributeLoad NameLoad attr body If CompareEq AttributeLoad NameLoad attr NameLoad body Return NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return BinOpAdd Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return BinOpAdd NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return CompareIs SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr NameLoad decorator_list decorator_list
N/A N/A 
    flaskext.htmlbuilder
    ~~~~~~~~~~~~~~~~~~~~

    Flask-HTMLBuilder is a `Flask`_ extension that allows **flexible** and
    **easy** Python-only generation of HTML snippets and full HTML documents
    using a robust syntax.  For more advanced usage it provides a lean template
    inheritance system that is intertwined with the Flask/Werkzeug endpoint
    mechanisms.

    :copyright: (c) 2010 by Zahari Petkov.
    :license: MIT, see LICENSE for more details.
 __future__ absolute_import __future__ unicode_literals N/A collections N/A sys N/A N/A N/A N/A sys version_info major 3 N/A N/A basestring str N/A unicode str keyword kwlist flask request g N/A __all__ N/A init_htmlbuilder html render render_template root_block block RootBlock Block Context Attrs init_htmlbuilder N/A N/A app N/A N/A N/A Initializes the extension so that the `g.blocks` and `g.attrs`
    dictionaries are created for each request.
     before_request N/A N/A N/A N/A N/A N/A g blocks N/A N/A N/A g attrs N/A N/A N/A app before_request N/A HTMLDispatcher N/A object N/A __getattr__ N/A N/A self attr N/A N/A N/A N/A attr special_elements N/A N/A N/A N/A special_elements N/A attr N/A N/A Element attr N/A N/A N/A html N/A HTMLDispatcher N/A The :data:`html` instance is used as a factory for building HTML tree
structure. Example::

    headline = html.div(id='headline')(
        html.h1(class_='left')('Headline text')
    )

The tree structure can be directly rendered to HTML using `str` or `unicode`.
Example::

    >>> unicode(headline)
    u'<div id="headline"><h1 class="left">Headline text</h1></div>'

This is useful when combined with a template engine like Jinja 2.  An
alternative approach is to use the :func:`render` function when indentation is
needed.  Or another approach is to use the :func:`render_template` function in
this module that is a powerful standalone solution for full HTML document
rendering.

This extension provides a special HTML builder syntax accessed through
the :data:`html` instance.

Void HTML element::

    >>> str(html.br)
    '<br />'

Void element with attributes::

    >>> str(html.img(src='/img/logo.png', class_='centered'))
    '<img class="centered" src="/img/logo.png" />'

.. note::
    Since attribute names like `class` are reserved Python keywords those need
    to be escaped with an underscore "_" symbol at the end of the name.  The
    same holds true for HTML elements like `del`, which needs to be declared as
    `html.del_`.

Non-void element::

    >>> str(html.div())
    '<div></div>'

Element with children::

    >>> str(html.div(html.p('First'), html.p('Second')))
    '<div><p>First</p><p>Second</p></div>'

Element with attributes and children::

    >>> str(html.div(class_='centered')(html.p('First')))
    '<div class="centered"><p>First</p></div>'

.. note::
    Attribute definition is done in a different call from child elements
    definition as you can see in the above example.  This approach is taken
    because Python does not allow keyword arguments (the attributes in this
    case) to be placed before the list arguments (child elements).  `__call__`
    chaining allows the definition syntax to be closer to HTML.
 render N/A N/A element level N/A 0 N/A N/A Renders the HTML builder `element` and it's children to a string.
    Example::

        >>> print(
        ...     render(
        ...         html.form(action='/search', name='f')(
        ...             html.input(name='q'),
        ...             html.input(name='search_button', type='submit')
        ...         )
        ...     )
        ... )
        <form action="/search" name="f">
          <input name="q" />
          <input type="submit" name="search_button" />
        </form>

    The :func:`render` function accepts the following arguments:

    :param element: element created through the `html` builder instance, a list
                    of such elements, or just a string.
    :param level: indentation level of the rendered element with a step of two
                  spaces.  If `level` is `None`, the `element` will be rendered
                  without indentation and new line transferring, passing the
                  same rule to the child elements.
     N/A N/A hasattr element render N/A N/A N/A N/A element render level N/A N/A N/A isinstance element basestring N/A N/A N/A _render_string element level N/A N/A N/A hasattr element __iter__ N/A N/A N/A _render_iteratable element level N/A N/A N/A element None N/A N/A N/A N/A TypeError N/A Cannot render %r element N/A BaseElement N/A object N/A N/A __slots__ N/A __str__ N/A N/A self N/A N/A N/A N/A str N/A N/A self render None N/A __unicode__ N/A N/A self N/A N/A N/A N/A unicode N/A N/A self render None N/A __html__ N/A N/A self N/A N/A N/A N/A N/A self __unicode__ N/A render N/A N/A self level N/A N/A N/A N/A NotImplementedError render() method has not been implemented N/A N/A Element N/A BaseElement N/A N/A __slots__ N/A _name _children _attributes __init__ N/A N/A self name N/A N/A N/A N/A self _name N/A _unmangle_element_name name N/A N/A self _children None N/A N/A self _attributes None N/A __call__ N/A N/A self N/A children attributes N/A N/A attributes N/A N/A N/A self _attributes N/A N/A collections OrderedDict N/A sorted N/A N/A attributes items key N/A N/A N/A a N/A N/A N/A N/A a N/A 0 endswith _ N/A N/A children N/A N/A N/A self _children children N/A N/A N/A self _children N/A N/A self N/A __repr__ N/A N/A self N/A N/A N/A result N/A N/A N/A < N/A N/A type self __name__ N/A self _name N/A N/A N/A self _attributes None N/A N/A result N/A _serialize_attributes N/A self _attributes N/A N/A self _children N/A N/A result  ... N/A result > N/A result N/A render N/A N/A self level N/A N/A N/A result N/A N/A N/A _indent level < N/A self _name N/A N/A N/A self _attributes None N/A N/A result N/A _serialize_attributes N/A self _attributes N/A N/A N/A self _children None N/A N/A result  /> N/A N/A result > N/A N/A self _children N/A N/A N/A N/A N/A N/A len N/A self _children 1 N/A isinstance N/A N/A self _children N/A 0 basestring N/A N/A N/A self _children N/A 0 None N/A N/A result N/A escape N/A N/A self _children N/A 0 N/A N/A result N/A _new_line level N/A N/A level None N/A N/A level 1 N/A result N/A _render_iteratable N/A self _children level N/A N/A level None N/A N/A level 1 N/A result N/A _indent level N/A result N/A N/A </ N/A self _name > N/A result N/A _new_line level N/A result N/A N/A Comment N/A BaseElement N/A N/A `html.comment` is used for rendering HTML comments.
    Example::

        >>> print(render([
        ...     html.comment('Target less enabled mobile browsers'),
        ...     html.link(rel='stylesheet', media='handheld',
        ...               href='css/handheld.css')
        ... ]))
        <!--Target less enabled mobile browsers-->
        <link media="handheld" href="css/handheld.css" rel="stylesheet" />

     N/A __slots__ N/A _comment __init__ N/A N/A self N/A N/A N/A N/A self _comment None N/A __call__ N/A N/A self comment N/A N/A N/A N/A self _comment comment N/A self N/A render N/A N/A self level N/A N/A N/A result N/A N/A _indent level <!-- N/A N/A N/A self _comment None N/A N/A result N/A self _comment N/A result N/A --> N/A _new_line level N/A result N/A N/A Doctype N/A BaseElement N/A N/A `html.doctype` is used for rendering HTML doctype definition at the
    beginning of the HTML document.  Example::

        >>> print(render([
        ...     html.doctype('html'),
        ...     html.html(
        ...         html.head('...'),
        ...         html.body('...')
        ...     )
        ... ]))
        <!doctype html>
        <html>
          <head>...</head>
          <body>...</body>
        </html>

     N/A __slots__ N/A _doctype __init__ N/A N/A self N/A N/A N/A N/A self _doctype None N/A __call__ N/A N/A self doctype N/A N/A N/A N/A self _doctype doctype N/A self N/A render N/A N/A self level N/A N/A N/A N/A N/A N/A N/A N/A _indent level <!doctype  N/A self _doctype > N/A _new_line level N/A N/A Safe N/A BaseElement N/A N/A `html.safe` renders HTML text content without escaping it. This is
    useful for insertion of prerendered HTML content.  Example::

        >>> print(render([
        ...     html.div(
        ...         html.safe('<strong>Hello, World!</strong>')
        ...     )
        ... ]))
        <div>
          <strong>Hello, World!</strong>
        </div>

     N/A __slots__ N/A _content __init__ N/A N/A self N/A N/A N/A N/A self _content None N/A __call__ N/A N/A self content N/A N/A N/A N/A self _content content N/A self N/A render N/A N/A self level N/A N/A N/A N/A N/A N/A _indent level N/A self _content N/A _new_line level N/A N/A Join N/A BaseElement N/A N/A `html.join` is used for rendering a list of HTML builder elements
    without indenting them and transferring each of them to a new line.  This
    is necessary when rendering a paragraph content for example and all text
    and other elements need to stick together.  Example::

        >>> print(render([
        ...     html.p(
        ...         html.join(
        ...             'Read the ', html.a(href='/docs')('documentation'), '.'
        ...         )
        ...     )
        ... ]))
        <p>
          Read the <a href="/docs">documentation</a>.
        </p>
     N/A __slots__ N/A _children __init__ N/A N/A self N/A N/A N/A N/A self _children None N/A __call__ N/A N/A self N/A children N/A N/A N/A self _children children N/A self N/A render N/A N/A self level N/A N/A N/A N/A N/A N/A _indent level N/A _render_iteratable N/A self _children None N/A _new_line level N/A N/A NewLine N/A BaseElement N/A N/A `html.newline` adds an empty new line in the content.  This is only
    needed for better readibility of the HTML source code.  Example::

        >>> print(render([
        ...     html.p('First'),
        ...     html.newline(),
        ...     html.p('Second')
        ... ]))
        <p>First</p>

        <p>Second</p>
     N/A __slots__ N/A __call__ N/A N/A self N/A N/A N/A self N/A render N/A N/A self level N/A N/A N/A N/A N/A _indent level N/A _new_line level N/A N/A BaseHasElement N/A BaseElement N/A N/A __slots__ N/A _children _name __init__ N/A N/A self N/A N/A N/A N/A self _children None N/A N/A self _name None N/A __call__ N/A N/A self N/A arguments N/A N/A N/A N/A self _name None N/A N/A N/A self _name N/A arguments N/A 0 N/A N/A N/A self _children arguments N/A self N/A N/A HasBlock N/A BaseHasElement N/A N/A `html.has_block` checks whether a specified HTML block exists in the
    `g.blocks` dictionary and if so then it returns specified child elements.

    The following function::

        def container_main():
            if 'main_content' in g.blocks.keys():
                return html.div(id='container_main')(
                    html.block('main_content')
                )
            else:
                return None

    Is equivalent to the following::

        def container_main():
            return html.has_block('main_content')(
                html.div(id='container_main')(
                    html.block('main_content')
                )
            )

     render N/A N/A self level N/A N/A N/A N/A N/A self _name N/A N/A N/A g blocks keys N/A N/A N/A _render_iteratable N/A self _children level N/A N/A N/A N/A BlockElement N/A BaseElement N/A N/A `html.block` is used for retreiving already populated blocks from the
    `g.blocks` dictionary.  It is a shortcut method for `g.blocks.get` with
    the small difference that it returns a block element on it's own like the
    other `html` instance methods.

    The following call::

        >>> html.p(
        ...     g.blocks.get('content')
        ... )

    Is equivalent to the following::

        >>> html.p(
        ...     html.block('content')
        ... )

    Additionally it has the ability to set block content if the block with the
    same name is not already defined.  This is useful for definition of default
    blocks.

    Setting block content is used that way::

        >>> html.block('content')(
        ...     html.join(
        ...         'Hello, ', html.a(href='/world')('World'), '!'
        ...     )
        ... )

    Which is equivalent to the following::

        >>> g.blocks['content'] = html.join(
        ...     'Hello, ', html.a(href='/world')('World'), '!'
        ... )

    An example of specifying a default block:

        html.head(
            html.title(
                html.block('title')(
                    'Default Title'
                )
            )
        )

     N/A __slots__ N/A _name __init__ N/A N/A self N/A N/A N/A N/A self _name None N/A __call__ N/A N/A self N/A arguments N/A N/A N/A N/A self _name None N/A N/A N/A self _name N/A arguments N/A 0 N/A N/A N/A N/A self _name N/A N/A N/A g blocks keys N/A N/A N/A N/A g blocks N/A N/A self _name arguments N/A self N/A render N/A N/A self level N/A N/A N/A N/A render N/A N/A N/A g blocks get N/A self _name None level N/A N/A HasAttr N/A BaseHasElement N/A N/A `html.has_attr` checks whether a given key exists in the
    `g.attrs` dictionary and if so then it returns specified child elements.

    The following function::

        def meta_description():
            if 'description' in g.attrs.keys():
                return html.meta(name='description', content=g.attrs['description'])
            else:
                return None

    Is equivalent to the following::

        def meta_description():
            return 'description' in html.keys()(
                html.meta(name='description', content=Attr('description'))
            )

    It is used usually in conjunction with :class:`Attr`.
     render N/A N/A self level N/A N/A N/A N/A N/A self _name N/A N/A N/A g attrs keys N/A N/A N/A _render_iteratable N/A self _children level N/A N/A N/A N/A N/A special_elements N/A comment doctype safe join newline has_block block has_attr Comment Doctype Safe Join NewLine HasBlock BlockElement HasAttr _indent N/A N/A level N/A N/A N/A Indent a line that will contain HTML data. N/A N/A N/A level None N/A N/A level 2 N/A _new_line N/A N/A level N/A N/A N/A N/A N/A level None N/A _render_string N/A N/A string level N/A N/A N/A Renders HTML escaped text. N/A N/A N/A N/A _indent level N/A escape string N/A _new_line level N/A _render_iteratable N/A N/A iteratable level N/A N/A N/A Renders iteratable sequence of HTML elements. N/A N/A isinstance iteratable basestring N/A N/A N/A unicode iteratable N/A N/A N/A join N/A N/A render element level N/A element iteratable N/A _serialize_attributes N/A N/A attributes N/A N/A N/A Serializes HTML element attributes in a name="value" pair form. N/A result N/A N/A name value N/A N/A attributes items N/A N/A N/A value N/A N/A N/A result N/A N/A _unmangle_attribute_name name N/A result N/A N/A =" N/A escape value True " N/A result N/A N/A _PYTHON_KEYWORD_MAP N/A dict N/A N/A N/A reserved _ reserved N/A reserved kwlist _unmangle_element_name N/A N/A name N/A N/A N/A Unmangles element names so that correct Python method names are
    used for mapping element names. N/A N/A N/A _PYTHON_KEYWORD_MAP get name name N/A _unmangle_attribute_name N/A N/A name N/A N/A N/A Unmangles attribute names so that correct Python variable names are
    used for mapping attribute names. N/A name N/A N/A _PYTHON_KEYWORD_MAP get name name N/A name N/A N/A N/A N/A name replace __ : replace _ - N/A name N/A escape N/A N/A string quote N/A False N/A N/A Standard HTML text escaping, but protecting against the agressive
    behavior of Jinja 2 `Markup` and the like.
     N/A N/A string None N/A N/A N/A N/A N/A hasattr string __html__ N/A N/A N/A unicode string N/A string N/A N/A N/A N/A N/A N/A string replace & &amp; replace < &lt; replace > &gt; N/A quote N/A N/A string N/A N/A string replace " &quot; N/A string N/A N/A DEFAULT_TEMPLATE_NAME default render_template N/A N/A template_name N/A DEFAULT_TEMPLATE_NAME N/A N/A Renders the HTML document based on the template hierarchy taking into
    account internally which view function is processing the request.

    The :func:`render_template` function accepts the following arguments:

    :param template_name: The name of the block template hierarchy that is used
                          to render the HTML document.
     N/A N/A render N/A N/A N/A N/A RootBlock block_templates N/A template_name html_block N/A root_block N/A N/A template_name N/A DEFAULT_TEMPLATE_NAME N/A N/A A decorator that is used to define that the decorated block function
    will be at the root of the block template hierarchy.  In the usual case
    this will be the HTML skeleton of the document, unless the template is used
    to serve partial HTML rendering for Ajax.

    The :func:`root_block` decorator accepts the following arguments:

    :param template_name: The name of the block template hierarchy which is
                          passed to the :func:`render_template` document
                          rendering function.  Different templates are useful
                          for rendering documents with differing layouts
                          (e.g. admin back-end vs. site front-end), or for
                          partial HTML rendering for Ajax.
     decorator N/A N/A block_func N/A N/A N/A block N/A RootBlock block_func template_name N/A block_func N/A N/A decorator N/A block N/A N/A context_name parent_block_func view_func N/A None N/A N/A A decorator that is used for inserting the decorated block function in
    the block template hierarchy.

    The :func:`block` decorator accepts the following arguments:

    :param context_name: key in the `g.blocks` dictionary in which the result
                         of the decorated block function will be stored for
                         further processing by the parent block function
                         `parent_block_func`.
    :param parent_block_func: parent block function in the template hierarchy
                              which will use the stored result.
    :param view_func: the decorated block will take an effect only in the
                      execution context of the specified view function.  If the
                      default value of `None` is used, then the block will be
                      used as default for the specified `context_name`.
                      Internally this parameter is converted to a Werkzeug
                      endpoint in the same way Flask is doing that with the
                      `Flask.route` decorator.
     decorator N/A N/A block_func N/A N/A N/A block N/A Block block_func view_func N/A parent_block N/A N/A Block block_mapping N/A parent_block_func N/A N/A N/A parent_block append_context_block context_name block N/A block_func N/A N/A decorator N/A Block N/A object N/A N/A In conjunction with :class:`Context` works exactly like the
    :func:`block` decorator, but as an alternative approach that is described
    in the documentation of :class:`RootBlock`.
     N/A __slots__ N/A endpoint block_func contexts N/A block_mapping N/A __init__ N/A N/A self block_func view_func N/A None N/A N/A N/A N/A Block block_mapping N/A block_func self N/A N/A hasattr view_func __name__ N/A N/A endpoint N/A view_func __name__ N/A N/A endpoint view_func N/A N/A self endpoint endpoint N/A N/A self block_func block_func N/A N/A self contexts N/A N/A __call__ N/A N/A self N/A contexts N/A N/A N/A self contexts contexts N/A self N/A __repr__ N/A N/A self N/A N/A N/A result N/A N/A N/A < N/A N/A self __class__ __name__ N/A N/A self block_func __name__ N/A N/A N/A self endpoint None N/A N/A result N/A  =>  N/A repr N/A self endpoint N/A result > N/A result N/A html_block N/A N/A self N/A N/A N/A N/A N/A self contexts None N/A N/A html_context N/A self contexts N/A N/A N/A N/A html_context attach N/A N/A N/A self block_func N/A append_context_block N/A N/A self name block N/A N/A N/A context N/A N/A self _find_context name N/A N/A context None N/A N/A context N/A Context name N/A N/A N/A N/A self contexts append context N/A N/A N/A N/A context blocks append block N/A _find_context N/A N/A self name N/A N/A N/A context N/A self contexts N/A N/A N/A N/A context name name N/A N/A context N/A None N/A N/A RootBlock N/A Block N/A N/A Works exactly like the :func:`root_block` decorator, but is used for the
    alternative approach to defining template block inheritance.

    Basically for the following view functions::

        @app.route('/sidebar/first')
        def sidebar_first_view():
            return render_template('sidebar')

        @app.route('/sidebar/second')
        def sidebar_second_view():
            return render_template('sidebar')


    This example of template block inheritance definition::

        @root_block('sidebar')
        def sidebar_base():
            return html.div(id='sidebar')(
                html.block('sidebar_content')
            )

        @block('sidebar_content', sidebar_base, sidebar_first_view)
        def sidebar_first_content():
            return html.p('First')

        @block('sidebar_content', sidebar_base, sidebar_second_view)
        def sidebar_second_content():
            return html.p('Second')


    Is equivalent to the following::

        def sidebar_base():
            return html.div(id='sidebar')(
                html.block('sidebar_content')
            )

        def sidebar_first_content():
            return html.p('First')

        def sidebar_second_content():
            return html.p('Second')

        RootBlock(sidebar_base, 'sidebar')(
            Context('sidebar_content')(
                Block(sidebar_first_content, sidebar_first_view),
                Block(sidebar_second_content, sidebar_second_view)
            )
        )

    The mapping between both approaches is straightforward.  The most notable
    difference is that the first argument of the :func:`block` decorator is
    pulled out in a separate class :class:`Context`.

    The :class:`RootBlock`, :class:`Block` and :class:`Context` classes use the
    same `__call__` pattern used for building the HTML tree.
     N/A block_templates N/A __init__ N/A N/A self block_func template_name N/A DEFAULT_TEMPLATE_NAME N/A N/A N/A N/A N/A super RootBlock self __init__ block_func N/A N/A N/A RootBlock block_templates N/A template_name self N/A N/A Context N/A object N/A N/A When used with :class:`Block` it plays the same role as the
    `context_name` parameter of the :func:`block` decorator. Check the
    documentation of :class:`RootBlock` for more information.
     N/A __slots__ N/A name blocks __init__ N/A N/A self name N/A N/A N/A N/A self name name N/A N/A self blocks N/A N/A __repr__ N/A N/A self N/A N/A N/A N/A N/A N/A N/A < N/A N/A self __class__ __name__ N/A repr N/A self name > N/A __call__ N/A N/A self N/A blocks N/A N/A N/A self blocks blocks N/A self N/A attach N/A N/A self N/A N/A N/A endpoint N/A N/A request url_rule endpoint N/A block N/A N/A self _get_block endpoint N/A N/A block None N/A N/A N/A N/A g blocks N/A N/A self name N/A N/A block html_block N/A _get_block N/A N/A self endpoint N/A N/A N/A exact_block N/A N/A self _find_block endpoint N/A N/A exact_block None N/A N/A exact_block N/A N/A N/A self _find_block None N/A _find_block N/A N/A self endpoint N/A N/A N/A block N/A self blocks N/A N/A N/A N/A block endpoint endpoint N/A N/A block N/A None N/A N/A Attr N/A object N/A N/A A shortcut class for accessing the `g.attrs` dictionary for populating
    HTML element attributes with data.

    The following two calls are equivalent::

        html.meta(name='description', content=Attr('description'))

        html.meta(name='description', content=g.attrs['description'])
     N/A __slots__ N/A _name __init__ N/A N/A self name N/A N/A N/A N/A self _name name N/A __str__ N/A N/A self N/A N/A N/A N/A N/A self _to_string str N/A __unicode__ N/A N/A self N/A N/A N/A N/A N/A self _to_string unicode N/A replace N/A N/A self old new N/A N/A N/A N/A N/A N/A N/A g attrs N/A N/A self _name replace old new N/A self N/A __add__ N/A N/A self other N/A N/A N/A N/A N/A unicode self other N/A __radd__ N/A N/A self other N/A N/A N/A N/A other N/A unicode self N/A _to_string N/A N/A self string_class N/A N/A N/A N/A string_class N/A N/A g attrs N/A N/A self _name N/A is_none N/A N/A self N/A N/A N/A N/A N/A N/A g attrs N/A N/A self _name None N/A N/A