Commits

Roland Meister  committed 34defff

Added new config parameter epub_tocdup.

  • Participants
  • Parent commits 93f59e1

Comments (0)

Files changed (4)

File doc/config.rst

    be an integer greater than zero.  The default value is 3.  Note: A deeply
    nested table of contents may be difficult to navigate.
 
+.. confval:: epub_tocdup
+
+   This flag determines if a toc entry is inserted again at the beginning of
+   it's nested toc listing.  This allows easier navitation to the top of
+   a chapter, but can be confusing because it mixes entries of differnet
+   depth in one list.  The default value is ``True``.
 
 .. _latex-options:
 

File sphinx/builders/epub.py

                 navstack.append(navlist)
                 navlist = []
                 level += 1
-                if lastnode:
+                if lastnode and self.config.epub_tocdup:
                     # Insert starting point in subtoc with same playOrder
                     navlist.append(self.new_navpoint(lastnode, level, False))
                 navlist.append(self.new_navpoint(node, level))

File sphinx/config.py

         epub_post_files = ([], 'env'),
         epub_exclude_files = ([], 'env'),
         epub_tocdepth = (3, 'env'),
+        epub_tocdup = (True, 'env'),
 
         # LaTeX options
         latex_documents = ([], None),

File sphinx/quickstart.py

 
 # The depth of the table of contents in toc.ncx.
 #epub_tocdepth = 3
+
+# Allow duplicate toc entries.
+#epub_tocdup = True
 '''
 
 INTERSPHINX_CONFIG = '''