[svn r63208] moving example to top-level dir.

--HG--
branch : trunk
This commit is contained in:
hpk
2009-03-22 18:08:31 +01:00
parent 3305a0e3db
commit c81ffeb027
7 changed files with 37 additions and 0 deletions

23
example/genhtmlcss.py Normal file
View File

@@ -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)