diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-01-16 15:51:46 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-01-16 15:51:46 +0300 |
commit | 30f8640bab786b28e2fbc3a12a4cf212e6f953d1 (patch) | |
tree | f5cf23900a7bc509fe970262195995ddc526fda1 /sphinx/environment | |
parent | 5460ea103bd91ce910e50e11e05c1e5340c2a9e0 (diff) | |
parent | 7c340e1c1c43f173f11efc14feb29cd08cedb995 (diff) |
Merge branch '3.x'
Diffstat (limited to 'sphinx/environment')
-rw-r--r-- | sphinx/environment/adapters/toctree.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sphinx/environment/adapters/toctree.py b/sphinx/environment/adapters/toctree.py index 5b91293a4..2e33cf702 100644 --- a/sphinx/environment/adapters/toctree.py +++ b/sphinx/environment/adapters/toctree.py @@ -319,8 +319,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) |