Am Mittwoch, den 15.02.2012, 21:27 -0800 schrieb Erik Hetzner: > Hi Roland, > > Thank you for your response! > > My primary reason for worrying about this is that I would like to be > able to build epubs that do not have a table of contents in the main > text, but that instead use a ereaders built-in navigation system, > features which exist on all ereaders that I know of. I think that > hidden toctrees are the right feature to use for this, but I could be > wrong. I should note that I am using a custom theme that does not > contain any navigation links at all. > > Here are the results of my test, using your patch. I created a test > document with a root toctree entry and 2 child toctrees, each with a > single document beneath them. (I can supply these files if you like.) > > If I use hidden in the root toctree, I indeed get an empty <navMap>, > and an empty <spine> in the content.opf. In calibre I cannot see > anything in the generated epub file. Nor can I view any content in the > bookworm.oreilly.com, nor on my nook. > > If I remove hidden from the root toctree, and add it to a single child > toctree, I am unable to access the child toctree. I am unable to > navigate in any way to the child of the hidden toctree, in calibre > viewer, on bookworm.oreilly.com, and on my nook. > > I don’t think this is correct behavior, because according to the > sphinx docs: > > This will still notify Sphinx of the document hierarchy, but not > insert links into the document at the location of the directive – > this makes sense if you intend to insert these links yourself, in a > different style, or in the HTML sidebar. [1] > > I think that the <spine> element of the content.opf or the toc.ncx > file should be considered like an HTML sidebar. > > 1. http://sphinx.pocoo.org/concepts.html#the-toc-tree > > best, Erik > Sent from my free software system <http://fsf.org/>.
Hi Erik, did you really use the version of sphinx from my branch? Please check which version of sphinx you are using. The results you describe seem to indicate that you are using a version without my changes. They have not yet been pulled into the main branch of sphinx. You can get my version from http://bitbucket.org/rolmei/sphinx-epub. Please also apply the attached patch, it has not been added yet to the bitbucket repository (see the attachment for a slightly different patch). In either case, send me the epub (and the rst sources). I'll take a look at it. By the way, that version also contain epub theme configuration options to remove the relabar1 and footer sections. You don't need the custom theme any more if you set the options. 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.
diff -r f453d48beacc sphinx/builders/epub.py --- a/sphinx/builders/epub.py Mon Feb 13 21:04:28 2012 +0100 +++ b/sphinx/builders/epub.py Thu Feb 16 17:59:29 2012 +0100 @@ -592,6 +592,8 @@ 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)