Skip to content

Commit 660ab39

Browse files
committed
docs(conf): Use signature-only typehints to eliminate RST conflicts
why: sphinx-autodoc-typehints was injecting :type: and :rtype: directives into docstrings at runtime, causing "Unexpected indentation" errors due to RST field list parsing conflicts with Napoleon-processed docstrings. what: - Change autodoc_typehints from "description" to "signature" - Set always_document_param_types = False to disable param type injection - Set typehints_document_rtype = False to disable return type injection - Type hints are now visible in function signatures only This eliminates all 64 anonymous "Unexpected indentation" errors while maintaining type documentation in the API reference.
1 parent b9bfae2 commit 660ab39

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

docs/conf.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,18 @@
111111
# sphinx.ext.autodoc
112112
autoclass_content = "both"
113113
autodoc_member_order = "bysource"
114-
# Automatically extract typehints when specified and place them in
115-
# descriptions of the relevant function/method.
116-
autodoc_typehints = "description"
114+
# Show type hints in signature only (not in description) to avoid RST
115+
# indentation conflicts from sphinx-autodoc-typehints type injection
116+
autodoc_typehints = "signature"
117117
# Don't show class signature with the class' name.
118118
autodoc_class_signature = "separated"
119119
toc_object_entries_show_parents = "hide"
120120

121121
# sphinx-autodoc-typehints
122-
always_document_param_types = True
122+
# When autodoc_typehints = "signature", disable all docstring modifications
123+
# to prevent RST parsing conflicts
124+
always_document_param_types = False
125+
typehints_document_rtype = False
123126

124127
# Suppress warnings for forward references that can't be resolved
125128
# (types in TYPE_CHECKING blocks used for circular import avoidance)

0 commit comments

Comments
 (0)