Return type does not get linked if napoleon_use_rtype = True
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- documentation
Research direction
Start by reproducing the two configurations described for sphinx.ext.napoleon with a basic Returns statement, then compare the sphinx-build output when napoleon_use_rtype is False and True. Trace the Napoleon return-type handling and make the linked type consistent in both formats; verify the generated documentation for each configuration.
Written by the indexing model from the issue text.
Description
Describe the bug
If I set napoleon_use_rtype to False, I get a nice link to the type of the return value.
However, if I change napoleon_use_rtype to True, because I much prefer the single-line format, there is no more link. Unless I manually add backticks
I find this to be wholly inconsistent with the rest of Napoleon and therefore consider it to be a bug.
To Reproduce
Steps to reproduce the behavior:
Write a basic napoleon "Returns" statement:
Returns:
bool: success or failure.
Set napoleon_use_rtype to False, run sphinx-build. You get a linked but separate "Rtype" field.
Set napoleon_use_rtype to True, run sphinx-build. The bool type is inlined with your text, but is no longer linked.
Expected behavior
Whether I want to have an inline return type, or a separated field, should have no impact on whether or not the type gets linked.
Environment info
- Sphinx version: 3.2.1
- Sphinx extensions: sphinx.ext.napoleon
- Dominant language
- Python
- Stars
- 8k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sphinx-doc/sphinx
-
type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
sphinx-doc/sphinx#14699 ·
-
type:bug type:tests
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sphinx-doc/sphinx#14678 ·
-
type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
sphinx-doc/sphinx#14659 ·
-
autodoc: IndexError formatting signature for callable data object with annotated class variable Openextensions:autodoc type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
sphinx-doc/sphinx#14576 · 2 comments ·
-
extensions:autodoc extensions:autosummary type:bug type:docs
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
sphinx-doc/sphinx#14555 · 2 comments ·
All issues in sphinx-doc/sphinx
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100