mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #8665 from JeanKossaifi/3.x
Cast maxdepth to int in toctree
This commit is contained in:
@@ -320,8 +320,10 @@ class TocTree:
|
||||
toctrees = [] # type: List[Element]
|
||||
if 'includehidden' not in kwargs:
|
||||
kwargs['includehidden'] = True
|
||||
if 'maxdepth' not in kwargs:
|
||||
if 'maxdepth' not in kwargs or not kwargs['maxdepth']:
|
||||
kwargs['maxdepth'] = 0
|
||||
else:
|
||||
kwargs['maxdepth'] = int(kwargs['maxdepth'])
|
||||
kwargs['collapse'] = collapse
|
||||
for toctreenode in doctree.traverse(addnodes.toctree):
|
||||
toctree = self.resolve(docname, builder, toctreenode, prune=True, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user