~ubuntu-branches/ubuntu/karmic/pypy/karmic

« back to all changes in this revision

Viewing changes to py/doc/example/genhtmlcss.py

  • Committer: Bazaar Package Importer
  • Author(s): Alexandre Fayolle
  • Date: 2007-04-13 09:33:09 UTC
  • Revision ID: james.westby@ubuntu.com-20070413093309-yoojh4jcoocu2krz
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import py
 
2
html = py.xml.html 
 
3
 
 
4
class my(html):
 
5
    "a custom style"  
 
6
    class body(html.body): 
 
7
        style = html.Style(font_size = "120%") 
 
8
 
 
9
    class h2(html.h2): 
 
10
        style = html.Style(background = "grey")
 
11
 
 
12
    class p(html.p): 
 
13
        style = html.Style(font_weight="bold")
 
14
 
 
15
doc = my.html(
 
16
    my.head(), 
 
17
    my.body(
 
18
        my.h2("hello world"),
 
19
        my.p("bold as bold can") 
 
20
    )
 
21
)
 
22
    
 
23
print doc.unicode(indent=2)