diff options
| author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-06-13 16:28:58 +0900 |
|---|---|---|
| committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-06-13 16:28:58 +0900 |
| commit | eb8f3b539a8be5a97eca02b1a8c5b51ca8a74463 (patch) | |
| tree | 0554e4fde88706e5e98ae23258423256b716173f /sphinx/ext | |
| parent | 46f79c55e1242ae8bb49b14c0a9e226d119460e5 (diff) | |
| download | sphinx-git-eb8f3b539a8be5a97eca02b1a8c5b51ca8a74463.tar.gz | |
Revert "ext.napoleon: Emit type annotations at the start of `.. attribute::`"
This reverts commit 9d7171899a7621592397be7d428971f049294bc6.
Diffstat (limited to 'sphinx/ext')
| -rw-r--r-- | sphinx/ext/napoleon/__init__.py | 3 | ||||
| -rw-r--r-- | sphinx/ext/napoleon/docstring.py | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sphinx/ext/napoleon/__init__.py b/sphinx/ext/napoleon/__init__.py index 9b41152fc..10b1ff3a3 100644 --- a/sphinx/ext/napoleon/__init__.py +++ b/sphinx/ext/napoleon/__init__.py @@ -168,10 +168,11 @@ class Config: **If False**:: .. attribute:: attr1 - :type: int Description of `attr1` + :type: int + napoleon_use_param : :obj:`bool` (Defaults to True) True to use a ``:param:`` role for each function parameter. False to use a single ``:parameters:`` role for all the parameters. diff --git a/sphinx/ext/napoleon/docstring.py b/sphinx/ext/napoleon/docstring.py index 32edd7f8f..769d1ed22 100644 --- a/sphinx/ext/napoleon/docstring.py +++ b/sphinx/ext/napoleon/docstring.py @@ -588,12 +588,13 @@ class GoogleDocstring: lines.append('.. attribute:: ' + _name) if self._opt and 'noindex' in self._opt: lines.append(' :noindex:') - if _type: - lines.extend(self._indent([':type: %s' % _type], 3)) lines.append('') fields = self._format_field('', '', _desc) lines.extend(self._indent(fields, 3)) + if _type: + lines.append('') + lines.extend(self._indent([':type: %s' % _type], 3)) lines.append('') if self._config.napoleon_use_ivar: lines.append('') |
