summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/tools/py/doc/example/genhtmlcss.py
blob: 3e6d0af5454c558346f68bfd3f4c7138e5c81681 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import py
html = py.xml.html

class my(html):
    "a custom style"
    class body(html.body):
        style = html.Style(font_size = "120%")

    class h2(html.h2):
        style = html.Style(background = "grey")

    class p(html.p):
        style = html.Style(font_weight="bold")

doc = my.html(
    my.head(),
    my.body(
        my.h2("hello world"),
        my.p("bold as bold can")
    )
)

print doc.unicode(indent=2)