From 92734d868b1b046298bbcbdca4ab2039ec922e63 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 20 Jan 2023 13:50:15 +1100 Subject: [PATCH] PyDoc: resolve bpy.types & bpy.ops expanding sub-modules inline The bpy.types page was unreasonably long (over 17k lines). Resolve by setting the `maxdepth` for this and the `bpy.ops` page too. This problem showed up in v3.4 release and may be caused by changes to Sphinx's default behavior as there doesn't seem to be any change that would cause this in the generated docs. --- doc/python_api/sphinx_doc_gen.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index b070a54407c..74bee60d662 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -2098,6 +2098,8 @@ def write_rst_types_index(basepath): fw(title_string("Types (bpy.types)", "=")) fw(".. module:: bpy.types\n\n") fw(".. toctree::\n") + # Only show top-level entries (avoids unreasonably large pages). + fw(" :maxdepth: 1\n") fw(" :glob:\n\n") fw(" bpy.types.*\n\n") @@ -2124,6 +2126,8 @@ def write_rst_ops_index(basepath): write_example_ref("", fw, "bpy.ops") fw(".. toctree::\n") fw(" :caption: Submodules\n") + # Only show top-level entries (avoids unreasonably large pages). + fw(" :maxdepth: 1\n") fw(" :glob:\n\n") fw(" bpy.ops.*\n\n") file.close()