mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Cast maxdepth to int in toctree
When specifying the max-depth for the toctree in theme.conf that isn't automatically cast to int, causing a hard to locate error.
This commit is contained in:
parent
d9569a84a2
commit
f77461b4b7
@ -322,6 +322,8 @@ class TocTree:
|
||||
kwargs['includehidden'] = True
|
||||
if 'maxdepth' not in kwargs:
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user