[Lxml-checkins] r44185 - in lxml/branch/lxml-1.3/doc: . html

scoder at codespeak.net scoder at codespeak.net
Tue Jun 12 19:09:01 CEST 2007


Author: scoder
Date: Tue Jun 12 19:09:00 2007
New Revision: 44185

Modified:
   lxml/branch/lxml-1.3/doc/html/style.css
   lxml/branch/lxml-1.3/doc/mkhtml.py
   lxml/branch/lxml-1.3/doc/parsing.txt
Log:
merged in doc updates from trunk

Modified: lxml/branch/lxml-1.3/doc/html/style.css
==============================================================================
--- lxml/branch/lxml-1.3/doc/html/style.css	(original)
+++ lxml/branch/lxml-1.3/doc/html/style.css	Tue Jun 12 19:09:00 2007
@@ -8,14 +8,14 @@
         padding: 1em 1em 1em 21em;
     }
 
-    div.document {
+    div.document, div.footer {
         width: 45em;
         background-color: white;
     }
 }
 
 @media print {
-    div.document {
+    div.document, div.footer {
         width: auto;
         padding-left: 0px;
     }
@@ -25,12 +25,20 @@
     }
 }
 
-div.document {
+div.document, div.footer {
     margin: 1em auto 1em auto;
     color: #222;
+}
+
+div.document {
     text-align: left;
 }
 
+div.footer {
+    text-align: center;
+    font-size: 70%;
+}
+
 /*** TOC ***/
 
 div.contents.topic > ul {
@@ -169,6 +177,12 @@
     margin: 0.5em 0em 0em 0em;
 }
 
+th.docinfo-name {
+    padding-left: 3ex;
+    text-align: right;
+    font-weight: bold;
+}
+
 hr {
     clear: both;
     height: 1px;

Modified: lxml/branch/lxml-1.3/doc/mkhtml.py
==============================================================================
--- lxml/branch/lxml-1.3/doc/mkhtml.py	(original)
+++ lxml/branch/lxml-1.3/doc/mkhtml.py	Tue Jun 12 19:09:00 2007
@@ -1,5 +1,5 @@
 from lxml.etree import parse, Element, SubElement, XPath
-import os, shutil, re, sys, copy
+import os, shutil, re, sys, copy, time
 
 SITE_STRUCTURE = [
     ('lxml', ('main.txt', 'intro.txt', 'FAQ.txt', 'compatibility.txt',
@@ -13,6 +13,8 @@
 RST2HTML_OPTIONS = " ".join([
     "--no-toc-backlinks",
     "--strip-comments",
+    "--language en",
+    "--date",
     ])
 
 find_title = XPath("/h:html/h:head/h:title/text()",
@@ -21,6 +23,8 @@
                             {"h" : "http://www.w3.org/1999/xhtml"})
 find_menu = XPath("//h:ul[@id=$name]",
                   {"h" : "http://www.w3.org/1999/xhtml"})
+find_page_end = XPath("/h:html/h:body/h:div[last()]",
+                      {"h" : "http://www.w3.org/1999/xhtml"})
 
 replace_invalid = re.compile(r'[-_/.\s\\]').sub
 

Modified: lxml/branch/lxml-1.3/doc/parsing.txt
==============================================================================
--- lxml/branch/lxml-1.3/doc/parsing.txt	(original)
+++ lxml/branch/lxml-1.3/doc/parsing.txt	Tue Jun 12 19:09:00 2007
@@ -240,16 +240,17 @@
 
   >>> for event, element in etree.iterparse(StringIO(xml)):
   ...     # ... do something with the element
-  ...     element.clear()                # clean up children
-  ...     if element.getprevious():      # clean up preceding siblings
-  ...         del element.getparent()[0]
-
-You can use ``while`` instead of the ``if`` to delete multiple siblings in a
-row if you skipped over them using the ``tag`` keyword argument.  The more
-selective your tag is, however, the more thought you will have to put into
-finding the right way to clean up the elements that were skipped.  Therefore,
-it is sometimes easier to traverse all elements and do the tag selection by
-hand in the event handler code.
+  ...     element.clear()                 # clean up children
+  ...     while element.getprevious() is not None: 
+  ...         del element.getparent()[0]  # clean up preceding siblings
+
+The ``while`` loop deletes multiple siblings in a row.  This is only necessary
+if you skipped over some of them using the ``tag`` keyword argument.
+Otherwise, a simple ``if`` should do.  The more selective your tag is,
+however, the more thought you will have to put into finding the right way to
+clean up the elements that were skipped.  Therefore, it is sometimes easier to
+traverse all elements and do the tag selection by hand in the event handler
+code.
 
 The 'start-ns' and 'end-ns' events notify about namespace declarations and
 generate tuples ``(prefix, URI)``::


More information about the lxml-checkins mailing list