From 53c0526a51179032e6cb4034d70e35e729065476 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Wed, 16 Jul 2025 16:17:15 +0200 Subject: [PATCH 1/2] Table of Content improvements * Remove extra top levels from main ToC. * Don't include sub-chapters of the specification in the main ToC. * Reduce the ToC level by one on the guides index. --- docs/guides/index.rst | 7 ++++++- docs/index.rst | 25 ++++++++++++++++++++----- docs/reference/index.rst | 5 +++++ 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/docs/guides/index.rst b/docs/guides/index.rst index 9a3bbe28a..b13e03486 100644 --- a/docs/guides/index.rst +++ b/docs/guides/index.rst @@ -1,9 +1,14 @@ +:orphan: + ****************** Type System Guides ****************** +.. + Keep in sync with docs/index.rst. + .. toctree:: - :maxdepth: 2 + :maxdepth: 1 :caption: Contents: libraries diff --git a/docs/index.rst b/docs/index.rst index 0dfdf131d..bc6bfbbf6 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -5,18 +5,33 @@ Static Typing with Python Guides ====== +.. + Keep in sync with docs/guides/index.rst. + .. toctree:: - :maxdepth: 2 + :maxdepth: 1 - guides/index + guides/libraries + guides/writing_stubs + guides/modernizing + guides/unreachable + guides/type_narrowing + guides/typing_anti_pitch Reference ========= +.. + Keep in sync with docs/reference/index.rst. + .. toctree:: - :maxdepth: 2 + :maxdepth: 1 - reference/index + reference/generics + reference/protocols + reference/best_practices + reference/quality + typing Module Documentation .. seealso:: @@ -27,7 +42,7 @@ Specification ============= .. toctree:: - :maxdepth: 2 + :maxdepth: 1 spec/index diff --git a/docs/reference/index.rst b/docs/reference/index.rst index 720e21277..bab77a268 100644 --- a/docs/reference/index.rst +++ b/docs/reference/index.rst @@ -1,7 +1,12 @@ +:orphan: + ********************* Type System Reference ********************* +.. + Keep in sync with docs/index.rst. + .. toctree:: :maxdepth: 2 :caption: Contents: From 9d5b58719d27d4e504b537fad17e91b9a8038cd4 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 11 Aug 2025 12:49:57 +0200 Subject: [PATCH 2/2] Restore maxdepth for specification --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index bc6bfbbf6..7bd07ba3a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -42,7 +42,7 @@ Specification ============= .. toctree:: - :maxdepth: 1 + :maxdepth: 2 spec/index