mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Added new config parameter epub_tocdup.
This commit is contained in:
parent
1d4f0c3f69
commit
7cbe0588a9
@ -782,6 +782,12 @@ the `Dublin Core metadata <http://dublincore.org/>`_.
|
||||
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:
|
||||
|
||||
|
@ -406,7 +406,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
||||
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))
|
||||
|
@ -124,6 +124,7 @@ class Config(object):
|
||||
epub_post_files = ([], 'env'),
|
||||
epub_exclude_files = ([], 'env'),
|
||||
epub_tocdepth = (3, 'env'),
|
||||
epub_tocdup = (True, 'env'),
|
||||
|
||||
# LaTeX options
|
||||
latex_documents = ([], None),
|
||||
|
@ -279,6 +279,9 @@ epub_copyright = u'%(copyright_str)s'
|
||||
|
||||
# The depth of the table of contents in toc.ncx.
|
||||
#epub_tocdepth = 3
|
||||
|
||||
# Allow duplicate toc entries.
|
||||
#epub_tocdup = True
|
||||
'''
|
||||
|
||||
INTERSPHINX_CONFIG = '''
|
||||
|
Loading…
Reference in New Issue
Block a user