diff --git a/cuda_bindings_13/docs/source/conf.py b/cuda_bindings_13/docs/source/conf.py
index 2043cfae359..b0437159042 100644
--- a/cuda_bindings_13/docs/source/conf.py
+++ b/cuda_bindings_13/docs/source/conf.py
@@ -64,6 +64,9 @@ def _html_baseurl():
"enum_documenter",
]
+# PR previews skip the (very large) autosummary-generated stub pages to save space.
+autosummary_generate = not int(os.environ.get("BUILD_PREVIEW", 0))
+
nb_execution_mode = "off"
numfig = True
@@ -106,7 +109,10 @@ def _html_baseurl():
if int(os.environ.get("BUILD_PREVIEW", 0)):
PR_NUMBER = f"{os.environ['PR_NUMBER']}"
PR_TEXT = f'PR {PR_NUMBER}'
- html_theme_options["announcement"] = f"Warning: This documentation is only a preview for {PR_TEXT}!"
+ html_theme_options["announcement"] = (
+ f"Warning: This documentation is only a preview for {PR_TEXT}! "
+ "To keep previews small, the autosummary-generated API pages are omitted."
+ )
elif int(os.environ.get("BUILD_LATEST", 0)):
html_theme_options["announcement"] = (
"Warning: This documentation is built from the development branch!"