from nevow import tags as T
class Page(rend.Page):
"""Example of using stan to render a page.
"""
docFactory = loaders.stan(
T.html[
T.head[
T.title['Hello'],
],
T.body[
T.p['Welcome to the wonderful world of Nevow!'],
],
]
)
- Contained elements as [], overloading __getitem__
- Attributes as (attrname=val) keyword arguments, overloading __call__
- Note that class and type are python keywords, so **{} syntax needed
- Also, no easy way to specify minimized form of attributes
From HTML 4.01 3.3.4:
In HTML, boolean attributes may appear in minimized form -- the
attribute's value appears alone in the element's start tag. Thus,
selected may be set by writing:
<OPTION selected>
instead of:
<OPTION selected="selected">
Authors should be aware that many user agents only recognize the
minimized form of boolean attributes and not the full form.