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:
Jean Kossaifi 2021-01-08 15:26:09 +00:00
parent d9569a84a2
commit f77461b4b7

View File

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