Skip to content

Commit

Permalink
DOC: Format aliases in kwargs tables
Browse files Browse the repository at this point in the history
The primary property name was given as link and code-formatted but the aliases were plain-text. This PR adds consistent formatting to the aliases as well, but still does not link them (by setting the `!` prefix).
  • Loading branch information
timhoffm committed Nov 5, 2024
1 parent ce4b660 commit edf918b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/matplotlib/artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,8 @@ def aliased_name_rest(self, s, target):
if target in self._NOT_LINKABLE:
return f'``{s}``'

aliases = ''.join(' or %s' % x for x in sorted(self.aliasd.get(s, [])))
aliases = ''.join(
f' or :meth:`{a} <{target}>`' for a in sorted(self.aliasd.get(s, [])))
return f':meth:`{s} <{target}>`{aliases}'

def pprint_setters(self, prop=None, leadingspace=2):
Expand Down

0 comments on commit edf918b

Please sign in to comment.