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.

This commit is contained in:
Erik Bray 2012-12-27 13:55:11 -05:00
parent c69b7b4253
commit 19d51e4270

View File

@ -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)