From 2f3d9f130ceca37a35c7b1b9b809cb22483d6f8b Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Fri, 30 Oct 2026 20:24:51 +0000 Subject: [PATCH] Fix a rendering issue in the sidebar of Appendix documents The removal of the first node is specific to PEPs; for appendices the first section in the Appendix went missing from the sidebar. This is currently visible in Appendix documents for PEP 639 and 825 for example. --- pep_sphinx_extensions/pep_processor/html/pep_html_builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pep_sphinx_extensions/pep_processor/html/pep_html_builder.py b/pep_sphinx_extensions/pep_processor/html/pep_html_builder.py index 4790836f53a..3897ae7feff 100644 --- a/pep_sphinx_extensions/pep_processor/html/pep_html_builder.py +++ b/pep_sphinx_extensions/pep_processor/html/pep_html_builder.py @@ -34,7 +34,7 @@ def get_doc_context(self, docname: str, body: str, _metatags: str) -> dict: toc_tree = self.env.tocs[docname].deepcopy() if len(toc_tree) and len(toc_tree[0]) > 1: toc_tree = toc_tree[0][1] # don't include document title - if docname.startswith("pep-"): + if docname.startswith("pep-") and "/" not in docname: del toc_tree[0] # remove contents node from PEPs for node in toc_tree.findall(nodes.reference): node["refuri"] = node["anchorname"] or "#" # fix targets