Ejemplo n.º 1
0
def home():
    """Index page - without renderer"""
    return render(
        doctype("html"),
        e.html()(
            e.head()(e.title()("htmldoom rendering framework demo")),
            e.body()(
                e.h1()("Home page"),
                e.a(href="/jinja2")("Jinja2"),
                e.br(),
                e.a(href="/htmldoom")("htmldoom"),
            ),
        ),
    )
Ejemplo n.º 2
0
def home(request):
    """Index page - without renderer"""
    return Response(
        render(
            doctype("html"),
            e.html()(
                e.head()(e.title()("Pyramid template engine demo")),
                e.body()(
                    e.h1()("Home page"),
                    e.a(href="/jinja2")("Jinja2"),
                    e.br(),
                    e.a(href="/htmldoom")("htmldoom"),
                ),
            ),
        ))
Ejemplo n.º 3
0
@renders(
    e.html(op="news")(
        e.head()(
            e.meta(name="referrer", content="origin"),
            e.meta(name="viewport",
                   content="width=device-width, initial-scale=1.0"),
            e.link(rel="stylesheet",
                   type_="text/css",
                   href="news.css?9UnLxU8WHV0ou3hRwndX"),
            e.link(rel="shortcut icon", href="favicon.ico"),
            e.link(rel="alternate",
                   type_="application/rss+xml",
                   title="RSS",
                   href="rss"),
            e.title()("Hacker News"),
        ),
        e.body()(e.center()(e.table(
            id_="hnmain",
            border="0",
            cellpadding="0",
            cellspacing="0",
            width="85%",
            bgcolor="#f6f6ef",
        )(
            e.tr()(e.td(bgcolor="#ff6600")(e.table(
                border="0",
                cellpadding="0",
                cellspacing="0",
                width="100%",
                style="padding:2px",
Ejemplo n.º 4
0
from htmldoom import base as b
from htmldoom import elements as e
from htmldoom import render as _render
from htmldoom import renders

doctype = _render(b.doctype("html"))


@renders(e.title()("{doctitle}"))
def render_title(data: dict) -> dict:
    return {"doctitle": data["doctitle"]}


@renders(e.head()(
    "{title}",
    e.meta(
        name="description",
        content=(
            "Niteo is a decade old SaaS studio full of bright ideas, "
            "building smart   solutions that empower small businesses online."
        ),
    ),
    e.meta(charset="utf-8"),
    e.meta(name="viewport", content="width=device-width, initial-scale=1.0"),
    e.meta(name="twitter:card", content="summary_large_image"),
    e.meta(
        name="twitter:title",
        content="Niteo - Empowering small businesses online since '07",
    ),
    e.meta(
        name="twitter:description",