Commits

Georg Brandl  committed 009c988

Add file attribute to appendix nodes.

  • Participants
  • Parent commits 0fb98f9

Comments (0)

Files changed (1)

File sphinx/builder.py

             self.titles.append((docname, entry[2]))
 
     def write(self, *ignored):
-        # first, assemble the "appendix" docs that are in every PDF
-        appendices = []
-        for fname in self.config.latex_appendices:
-            appendices.append(self.env.get_doctree(fname))
-
         docwriter = LaTeXWriter(self)
         docsettings = OptionParser(
             defaults=self.env.settings,
                 encoding='utf-8')
             self.info("processing " + targetname + "... ", nonl=1)
             doctree = self.assemble_doctree(docname, toctree_only,
-                appendices=(docclass == 'manual') and appendices or [])
+                appendices=((docclass == 'manual') and
+                            self.config.latex_appendices or []))
             self.post_process_images(doctree)
             self.info("writing... ", nonl=1)
             doctree.settings = docsettings
                 new_sect += node
             tree = new_tree
         largetree = process_tree(indexfile, tree)
-        largetree.extend(appendices)
         largetree['file'] = indexfile
+        for docname in appendices:
+            appendix = self.env.get_doctree(docname)
+            appendix['file'] = docname
+            largetree.append(appendix)
         self.info()
         self.info("resolving references...")
         self.env.resolve_references(largetree, indexfile, self)