Skip to content

Commit

Permalink
Fix regression in SingleFileHTMLBuilder._get_local_toctree
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Aug 17, 2023
1 parent 49dc0dd commit 0835c3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Bugs fixed
* Fixed membership testing (``in``) for the :py:class:`str` interface
of the asset classes (``_CascadingStyleSheet`` and ``_JavaScript``),
which several extensions relied upon.
* Fixed a type error in ``SingleFileHTMLBuilder._get_local_toctree``,
``includehidden`` may be passed as a string or a boolean.

Release 7.2.1 (released Aug 17, 2023)
=====================================
Expand Down
9 changes: 5 additions & 4 deletions sphinx/builders/singlehtml.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ def fix_refuris(self, tree: Node) -> None:
refnode['refuri'] = fname + refuri[hashindex:]

def _get_local_toctree(self, docname: str, collapse: bool = True, **kwargs: Any) -> str:
if kwargs.get('includehidden', 'false').lower() == 'false':
kwargs['includehidden'] = False
elif kwargs['includehidden'].lower() == 'true':
kwargs['includehidden'] = True
if isinstance(includehidden := kwargs.get('includehidden'), str):
if includehidden.lower() == 'false':
kwargs['includehidden'] = False
elif includehidden.lower() == 'true':
kwargs['includehidden'] = True
if kwargs.get('maxdepth') == '':
kwargs.pop('maxdepth')
toctree = global_toctree_for_doc(self.env, docname, self, collapse=collapse, **kwargs)
Expand Down

0 comments on commit 0835c3e

Please sign in to comment.