Skip to content

fix(docs): stop rendering duplicate parameter type hints in the API reference - #67

Open
dhedey wants to merge 1 commit into
mainfrom
dhedey/fix-duplicate-param-typehints
Open

fix(docs): stop rendering duplicate parameter type hints in the API reference#67
dhedey wants to merge 1 commit into
mainfrom
dhedey/fix-duplicate-param-typehints

Conversation

@dhedey

@dhedey dhedey commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

What

docs/source/conf.py enables two type-hint renderers at once:

  • core autodoc via autodoc_typehints = "description", and
  • the sphinx_autodoc_typehints extension (with typehints_description_target = "documented_params").

Both inject type hints into the parameter descriptions, so every parameter in the API reference renders twice — once with its description and merged type (from the extension), and once as a bare type-only entry (from core autodoc, whose own target defaults to "all").

Screenshot 2026-07-28 at 13 19 05

Fix

Set autodoc_typehints = "none" so the extension is the sole renderer. The extension already handles this correctly and honors documented_params.

Effect

Built against the docs toolchain (--group docs, Sphinx 8.2), on the API reference page:

Parameter entries With description Bare duplicates
before 273 114 159
after 114 114 0

Each parameter now appears once, keeping its description with the type merged in, e.g.:

name (str | None) – Name of your experiment (defaults to a generated name).

Returns / Return type fields are unaffected.

conf.py enables both core autodoc's `autodoc_typehints = "description"` and
the sphinx-autodoc-typehints extension. Both render type hints into the
parameter descriptions, so every parameter in the API reference appeared
twice — once with its description (from the extension, honoring
`typehints_description_target = "documented_params"`) and once as a bare type
(from core autodoc, whose target defaults to "all").

Set `autodoc_typehints = "none"` so the extension is the sole renderer. On the
API reference page this drops the parameter list from 273 entries to 114, with
every parameter keeping its description and merged type, and no bare
duplicates.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant