[Lxml-checkins] r54073 - in lxml/trunk: . doc

scoder at codespeak.net scoder at codespeak.net
Thu Apr 24 00:46:49 CEST 2008


Author: scoder
Date: Thu Apr 24 00:46:48 2008
New Revision: 54073

Modified:
   lxml/trunk/   (props changed)
   lxml/trunk/doc/FAQ.txt
   lxml/trunk/doc/mklatex.py
Log:
 r4042 at delle:  sbehnel | 2008-04-23 21:23:38 +0200
 doc fixes


Modified: lxml/trunk/doc/FAQ.txt
==============================================================================
--- lxml/trunk/doc/FAQ.txt	(original)
+++ lxml/trunk/doc/FAQ.txt	Thu Apr 24 00:46:48 2008
@@ -831,7 +831,7 @@
 How can I find out which namespace prefixes are used in a document?
 -------------------------------------------------------------------
 
-You can traverse the document (``getiterator()``) and collect the prefix
+You can traverse the document (``root.iter()``) and collect the prefix
 attributes from all Elements into a set.  However, it is unlikely that you
 really want to do that.  You do not need these prefixes, honestly.  You only
 need the namespace URIs.  All namespace comparisons use these, so feel free to

Modified: lxml/trunk/doc/mklatex.py
==============================================================================
--- lxml/trunk/doc/mklatex.py	(original)
+++ lxml/trunk/doc/mklatex.py	Thu Apr 24 00:46:48 2008
@@ -3,7 +3,7 @@
 #    python mklatex.py latex .. 1.0
 
 from docstructure import SITE_STRUCTURE, HREF_MAP, BASENAME_MAP
-import os, shutil, re, sys
+import os, shutil, re, sys, datetime
 
 try:
     set
@@ -17,7 +17,7 @@
 #    "--no-toc-backlinks",
     "--strip-comments",
     "--language en",
-    "--date",
+#    "--date",
     "--use-latex-footnotes",
     "--use-latex-citations",
     "--use-latex-toc",
@@ -29,6 +29,7 @@
 htmlnsmap = {"h" : "http://www.w3.org/1999/xhtml"}
 
 replace_invalid = re.compile(r'[-_/.\s\\]').sub
+replace_content = re.compile("\{[^\}]*\}").sub
 
 replace_epydoc_macros = re.compile(r'(,\s*amssymb|dvips\s*,\s*)').sub
 replace_rst_macros = re.compile(r'(\\usepackage\{color}|\\usepackage\[[^]]*]\{hyperref})').sub
@@ -278,10 +279,14 @@
             # pygments and epydoc support
             master.write(PYGMENTS_IMPORT)
         elif hln.startswith(r"\title{"):
-            hln = re.sub("\{[^\}]*\}",
-                         r'{%s\\\\\\vspace{1em}\\includegraphics{../html/tagpython.png}}' % book_title, hln)
+            hln = replace_content(
+                r'{%s\\\\\\vspace{1em}\\includegraphics{../html/tagpython.png}}' % book_title, hln)
+        elif hln.startswith(r"\date{"):
+            hln = replace_content(
+                r'{%s}' % datetime.date.today().isoformat(), hln)
         elif hln.startswith("pdftitle"):
-            hln = re.sub("\{[^\}]*\}", r'{%s}' % book_title, hln)
+            hln = replace_content(
+                r'{%s}' % book_title, hln)
         master.write(hln)
 
     master.write("\\tableofcontents\n")


More information about the lxml-checkins mailing list