Commits

Anonymous committed 2a57ffb Draft

Bug #868: Avoid empty toc.ncx for hidden toctrees

Comments (0)

Files changed (1)

sphinx/builders/epub.py

         doctree = self.env.get_and_resolve_doctree(self.config.master_doc,
             self, prune_toctrees=False, includehidden=False)
         refnodes = self.get_refnodes(doctree, [])
+        if not refnodes:
+            refnodes = self.refnodes
         navpoints = self.build_navpoints(refnodes)
         level = max(item['level'] for item in self.refnodes)
         level = min(level, self.config.epub_tocdepth)