On 15 Feb., 08:41, Erik Hetzner <e...@e6h.org> wrote: > At Mon, 13 Feb 2012 12:55:21 -0800 (PST), > > Hi Roland, > > What ebook viewer are you using? It seems that the calibre ebook > viewer uses the toc.ncx file for navigation, because when I generate > an epub with toctree :hidden: and view it in the calibre ebook-viewer, > I am unable to navigate or even turn pages. > > I’m not sure what the correct behavior is here. I suppose that it > depends on the semantics of “hidden” for a toctree. I think that > perhaps content listed in the content.opf file should also be in the > toc.ncx. > > best, Erik > > Sent from my free software system <http://fsf.org/>.
Hi Erik, you are setting the hidden attribute on the root toc entry? Then, indeed, the navMap element in toc.ncx is empty and useless. My use case was to hide only the toc in non-root toc entries. Maybe a compromise is to include the hidden entries in toc.ncx if the navMap would otherwise be empty? Please try the following patch: --- a/sphinx/builders/epub.py Mon Feb 13 21:04:28 2012 +0100 +++ b/sphinx/builders/epub.py Wed Feb 15 18:28:56 2012 +0100 @@ -592,6 +592,10 @@ 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: + doctree = self.env.get_and_resolve_doctree(self.config.master_doc, + self, prune_toctrees=False, includehidden=True) + 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) As an alternative, you can hide the toc listings with css. For calibre, there are the purple left and right arrows to turn pages. Or, use the scrollbar on the right side. The next links inside the epub should also work unless the navigation area (relbar1) is hidden. This works for me even if the navMap in toc.ncx is empty. Regards, Roland -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-dev@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.