Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More
Generating HTML¶
This describes some Lino-specific usage of the
etgen.html
module.
>>> from etgen.html import E
>>> txt = "foo"
>>> txt = E.b(txt)
>>> # ar = rt.login('robin', renderer=settings.SITE.kernel.default_renderer, permalink_uris=True)
>>> ar = rt.login('robin', renderer=settings.SITE.kernel.html_renderer)
>>> obj = ar.user
>>> e = ar.obj2html(obj, txt)
You now have an ElementTree object.
>>> e
<Element a at ...>
>>> print(tostring(e))
<a href="/#/api/users/AllUsers/1" style="text-decoration:none"><b>foo</b></a>