Include all in page headings in the sidebar ToC

The furo theme tries to make this impossible, fortunately,
this being python, we dont care what it wants
This commit is contained in:
Kovid Goyal
2021-07-21 10:35:58 +05:30
parent 8dfef58f29
commit 329d95fd3a
11 changed files with 33 additions and 21 deletions

View File

@@ -482,8 +482,16 @@ def write_conf_docs(app: Any, all_kitten_names: Iterable[str]) -> None:
# }}}
def add_html_context(app: Any, pagename: str, templatename: str, context: Any, *args: Any) -> None:
def add_html_context(app: Any, pagename: str, templatename: str, context: Any, doctree: Any, *args: Any) -> None:
context['analytics_id'] = app.config.analytics_id
if 'toctree' in context:
original_toctee_function = context['toctree']
def include_sub_headings(**kwargs: Any) -> Any:
kwargs['titles_only'] = False
return original_toctee_function(**kwargs)
context['toctree'] = include_sub_headings
def setup(app: Any) -> None: