diff options
Diffstat (limited to 'testing/web-platform/tests/tools/py/doc/example/genhtmlcss.py')
-rw-r--r-- | testing/web-platform/tests/tools/py/doc/example/genhtmlcss.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/testing/web-platform/tests/tools/py/doc/example/genhtmlcss.py b/testing/web-platform/tests/tools/py/doc/example/genhtmlcss.py new file mode 100644 index 000000000..3e6d0af54 --- /dev/null +++ b/testing/web-platform/tests/tools/py/doc/example/genhtmlcss.py @@ -0,0 +1,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) |