Commits

Richard Shea committed b70b50f

Snapshot commit - squash later

Comments (0)

Files changed (4)

dominate/examples/005-demo-build-document-nested-div.py

         #'header'
         with div(id='header', cls='span-24'):
             h1('Hello, Wellington NZPUG!')
+            p("Output of : " + os.path.basename(__file__), cls="smalltext")
 
         #'content'
         with div(id='content', cls='span-24'):

dominate/examples/006-demo-build-document-decorators-simple.py

 '''
 Demonstration of using decorators to create DOM elements
 '''
+import os
 from dominate.document import document
 from dominate.tags import h2, h1, p, link, div
 
 @div(cls='header')
 def header():
     h1('Hello, Wellington NZPUG!')
+    p("Output of : " + os.path.basename(__file__), 
+      cls="smalltext", 
+      style="text-decoration: underline")
 
 @div(cls='content')
 def content():
 
     d = document(title="NZPUG Demo - March 2014")
     d = build_links(d)
-    with d:
+    with d.add(div(cls='container')):
         header()
         content()
         footer()

dominate/output/006.html

       <link href="css/dmnt_demo_base0.css" media="screen, projection" rel="stylesheet" type="text/css">
     </head>
     <body>
-      <div class="header">
-        <h1>Hello, Wellington NZPUG!</h1>
-      </div>
-      <div class="content">
-        <p>uoq tvbgx ibg nbhqsn nj mhyfmz bj fx ir vbjt</p>
-        <p>oma mdv kverti tqdnd xv ignxxj wyxf rhkq lly qrd</p>
-        <p>plghe kbjkvs vcrg xqbdd wmk thlv sqx igmbeb zoyfz nx</p>
-        <p>mskaoo xj cifp yrl ugqcj wpl bww whzs uxdf wie</p>
-      </div>
-      <div class="footer">
-        <p>i am the footer</p>
+      <div class="container">
+        <div class="header">
+          <h1>Hello, Wellington NZPUG!</h1>
+          <p class="smalltext" style="text-decoration: underline">Output of : 006-demo-build-document-decorators-simple.py</p>
+        </div>
+        <div class="content">
+          <p>vzfiv ijq beoui vwycw avnnth yxhmsy na ph pac tliwuh</p>
+          <p>jx gjku wpgi ivq obo moay ddy zjh gdaynn yrhldh</p>
+          <p>oefkts fdm knim exgcvy ov zfsqer jeaijj plxfh svqbm um</p>
+          <p>qa khjd eoz fmqbfb rd mnbrd amzv ow jtn lntz</p>
+        </div>
+        <div class="footer">
+          <p>i am the footer</p>
+        </div>
       </div>
     </body>
   </html>

dominate/output/css/dmnt_demo_base0.css

       background: #6F6F94;
   }
 
-#header  { color:#FF9100; background-color:#6F6F94; padding:30px 0; text-align:center; }
-#footer  { color:#FF9100; background-color:#6F6F94; padding:30px 0; text-align:center; }
-#content { color:#FF9100; background-color:#6F6F94; padding-bottom:60px; }
+.header  { color:#FF9100; background-color:#6F6F94; padding:30px; text-align:center; }
+.footer  { color:#FF9100; background-color:#6F6F94; padding:30px 0; text-align:center; }
+.content { color:#FF9100; background-color:#6F6F94; padding-bottom:60px; }
 #sidebar { color:#FF9100; background-color:#6cc; padding-bottom:60px; }
 
 p {font-size:150%}
+.smalltext {font-size:1.2em}
 H1, H2, H3, P { color:#FF9100 }