From 19d51e427059200361f8af8606ece592a473821a Mon Sep 17 00:00:00 2001 From: Erik Bray Date: Thu, 27 Dec 2012 13:55:11 -0500 Subject: [PATCH] Ensure that the entire doctree is traversed and all TOCs are processed regardless of tocdepth; now tocdepth only controls the depth of the node tree for the document's TOC. --- sphinx/environment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sphinx/environment.py b/sphinx/environment.py index 0b9e5bccc..181cc4605 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -1209,8 +1209,9 @@ class BuildEnvironment: anchorname=anchorname, *nodetext) para = addnodes.compact_paragraph('', '', reference) item = nodes.list_item('', para) + sub_item = build_toc(sectionnode, depth + 1) if maxdepth == 0 or depth < maxdepth: - item += build_toc(sectionnode, depth+1) + item += sub_item entries.append(item) if entries: return nodes.bullet_list('', *entries)