summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-10-30 00:53:59 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-10-30 00:53:59 +0900
commit0b200d82fd48cf60a51648a9a67eec77296cb61b (patch)
treeca67a834100dcaeda40de6095b18519423a8aa12
parent078aaf5f13e01b99619763e4f4eae6665ec2da26 (diff)
downloadsphinx-git-cleanup_napoleon.tar.gz
napoleon: simplify seealso transformationcleanup_napoleon
-rw-r--r--sphinx/ext/napoleon/docstring.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/sphinx/ext/napoleon/docstring.py b/sphinx/ext/napoleon/docstring.py
index 20d9e1b9e..bcd2d2426 100644
--- a/sphinx/ext/napoleon/docstring.py
+++ b/sphinx/ext/napoleon/docstring.py
@@ -1240,14 +1240,13 @@ class NumpyDocstring(GoogleDocstring):
for func, description, role in items
]
- func_role = 'obj'
lines = [] # type: List[str]
last_had_desc = True
- for func, desc, role in items:
+ for name, desc, role in items:
if role:
- link = ':%s:`%s`' % (role, func)
+ link = ':%s:`%s`' % (role, name)
else:
- link = ':%s:`%s`' % (func_role, func)
+ link = ':obj:`%s`' % name
if desc or last_had_desc:
lines += ['']
lines += [link]