Skip to content

Commit

Permalink
napoleon: simplify seealso transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya committed Oct 29, 2020
1 parent 078aaf5 commit 0b200d8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sphinx/ext/napoleon/docstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -1240,14 +1240,13 @@ def translate(func, description, role):
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]
Expand Down

0 comments on commit 0b200d8

Please sign in to comment.