summaryrefslogtreecommitdiff
path: root/sphinx
diff options
context:
space:
mode:
authorRoland Meister <devnull@localhost>2010-01-09 11:19:41 +0100
committerRoland Meister <devnull@localhost>2010-01-09 11:19:41 +0100
commit633fc33f08cd6fdf4b11a53ccd2549d18d20878f (patch)
treedd236c23993867cd29154766e21dc2c36aacd184 /sphinx
parentc69928c56ea33852d8409c318920a22079af2584 (diff)
downloadsphinx-633fc33f08cd6fdf4b11a53ccd2549d18d20878f.tar.gz
Added the epub_tocdepth configuration option.
Diffstat (limited to 'sphinx')
-rw-r--r--sphinx/builders/epub.py2
-rw-r--r--sphinx/config.py1
-rw-r--r--sphinx/quickstart.py3
3 files changed, 6 insertions, 0 deletions
diff --git a/sphinx/builders/epub.py b/sphinx/builders/epub.py
index e78f807e..0e4529e5 100644
--- a/sphinx/builders/epub.py
+++ b/sphinx/builders/epub.py
@@ -355,6 +355,8 @@ class EpubBuilder(StandaloneHTMLBuilder):
file = node['refuri'].split('#')[0]
if file in self.ignored_files:
continue
+ if node['level'] > self.config.epub_tocdepth:
+ continue
if node['level'] == level:
navlist.append(self.new_navpoint(node, level))
elif node['level'] == level + 1:
diff --git a/sphinx/config.py b/sphinx/config.py
index 5fe3f63f..e7e05169 100644
--- a/sphinx/config.py
+++ b/sphinx/config.py
@@ -112,6 +112,7 @@ class Config(object):
epub_pre_files = ([], 'env'),
epub_post_files = ([], 'env'),
epub_exclude_files = ([], 'env'),
+ epub_tocdepth = (3, 'env'),
# LaTeX options
latex_documents = ([], None),
diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py
index faea2c2e..a7b80dd5 100644
--- a/sphinx/quickstart.py
+++ b/sphinx/quickstart.py
@@ -254,6 +254,9 @@ latex_documents = [
# A list of files that should not be packed into the epub file.
#epub_exclude_files = []
+
+# The depth of the table of contents in toc.ncx.
+#epub_tocdepth = 3
'''
INTERSPHINX_CONFIG = '''