[Python-checkins] r61334 - doctools/trunk/sphinx/builder.py doctools/trunk/sphinx/latexwriter.py

georg.brandl python-checkins at python.org
Sun Mar 9 20:55:45 CET 2008


Author: georg.brandl
Date: Sun Mar  9 20:55:44 2008
New Revision: 61334

Modified:
   doctools/trunk/sphinx/builder.py
   doctools/trunk/sphinx/latexwriter.py
Log:
Actually honor the "title" value in latex_documents, if present.


Modified: doctools/trunk/sphinx/builder.py
==============================================================================
--- doctools/trunk/sphinx/builder.py	(original)
+++ doctools/trunk/sphinx/builder.py	Sun Mar  9 20:55:44 2008
@@ -717,6 +717,7 @@
             self.info("writing... ", nonl=1)
             doctree.settings = docsettings
             doctree.settings.author = author
+            doctree.settings.title = title
             doctree.settings.docname = docname
             doctree.settings.docclass = docclass
             docwriter.write(doctree, destination)

Modified: doctools/trunk/sphinx/latexwriter.py
==============================================================================
--- doctools/trunk/sphinx/latexwriter.py	(original)
+++ doctools/trunk/sphinx/latexwriter.py	Sun Mar  9 20:55:44 2008
@@ -102,7 +102,8 @@
                         'preamble': builder.config.latex_preamble,
                         'author': document.settings.author,
                         'docname': document.settings.docname,
-                        'title': None, # is determined later
+                        # if empty, the title is set to the first section title
+                        'title': document.settings.title,
                         'release': builder.config.release,
                         'date': date,
                         }
@@ -208,7 +209,8 @@
         elif self.this_is_the_title:
             if len(node.children) != 1 and not isinstance(node.children[0], nodes.Text):
                 self.builder.warn('document title is not a single Text node')
-            self.options['title'] = node.astext()
+            if not self.options['title']:
+                self.options['title'] = node.astext()
             self.this_is_the_title = 0
             raise nodes.SkipNode
         elif isinstance(node.parent, nodes.section):


More information about the Python-checkins mailing list