Anonymous committed f453d48

Bug #868: Add hidden toctree entries to content.opf/spine

  • Participants
  • Parent commits 83b2cf4

Comments (0)

Files changed (2)

File sphinx/builders/

         return result
     def get_toc(self):
-        """Get the total table of contents, containg the master_doc
+        """Get the total table of contents, containing the master_doc
         and pre and post files not managed by sphinx.
         doctree = self.env.get_and_resolve_doctree(self.config.master_doc,
-            self, prune_toctrees=False)
+            self, prune_toctrees=False, includehidden=True)
         self.refnodes = self.get_refnodes(doctree, [])
         master_dir = os.path.dirname(self.config.master_doc)
         if master_dir:
         """Write the metainfo file toc.ncx."""'writing %s file...' % outname)
-        navpoints = self.build_navpoints(self.refnodes)
+        doctree = self.env.get_and_resolve_doctree(self.config.master_doc,
+            self, prune_toctrees=False, includehidden=False)
+        refnodes = self.get_refnodes(doctree, [])
+        navpoints = self.build_navpoints(refnodes)
         level = max(item['level'] for item in self.refnodes)
         level = min(level, self.config.epub_tocdepth)
         f =, outname), 'w', 'utf-8')

File sphinx/

     def get_and_resolve_doctree(self, docname, builder, doctree=None,
-                                prune_toctrees=True):
+                                prune_toctrees=True, includehidden=False):
         """Read the doctree from the pickle, resolve cross-references and
         toctrees and return it.
         # now, resolve all toctree nodes
         for toctreenode in doctree.traverse(addnodes.toctree):
             result = self.resolve_toctree(docname, builder, toctreenode,
-                                          prune=prune_toctrees)
+                          prune=prune_toctrees, includehidden=includehidden)
             if result is None: