Skip to content

Commit

Permalink
Merge pull request #7888 from McSinyx/imperative-napoleon
Browse files Browse the repository at this point in the history
ext.napoleon: Add aliases Warn and Raise
  • Loading branch information
tk0miya committed Jun 29, 2020
2 parents e4c3e24 + 1a86506 commit ec9af60
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -14,6 +14,7 @@ Features added
--------------

* #7853: C and C++, support parameterized GNU style attributes.
* #7888: napoleon: Add aliases Warn and Raise.

Bugs fixed
----------
Expand Down
2 changes: 2 additions & 0 deletions doc/usage/extensions/napoleon.rst
Expand Up @@ -115,13 +115,15 @@ All of the following section headers are supported:
* ``Parameters``
* ``Return`` *(alias of Returns)*
* ``Returns``
* ``Raise`` *(alias of Raises)*
* ``Raises``
* ``References``
* ``See Also``
* ``Tip``
* ``Todo``
* ``Warning``
* ``Warnings`` *(alias of Warning)*
* ``Warn`` *(alias of Warns)*
* ``Warns``
* ``Yield`` *(alias of Yields)*
* ``Yields``
Expand Down
2 changes: 2 additions & 0 deletions sphinx/ext/napoleon/docstring.py
Expand Up @@ -162,13 +162,15 @@ def __init__(self, docstring: Union[str, List[str]], config: SphinxConfig = None
'parameters': self._parse_parameters_section,
'return': self._parse_returns_section,
'returns': self._parse_returns_section,
'raise': self._parse_raises_section,
'raises': self._parse_raises_section,
'references': self._parse_references_section,
'see also': self._parse_see_also_section,
'tip': partial(self._parse_admonition, 'tip'),
'todo': partial(self._parse_admonition, 'todo'),
'warning': partial(self._parse_admonition, 'warning'),
'warnings': partial(self._parse_admonition, 'warning'),
'warn': self._parse_warns_section,
'warns': self._parse_warns_section,
'yield': self._parse_yields_section,
'yields': self._parse_yields_section,
Expand Down

0 comments on commit ec9af60

Please sign in to comment.