Merge pull request #9084 from tk0miya/8731_docs_for_napoleon_preprocess_types

doc: Add docs for napoleon_preprocess_types
This commit is contained in:
Takeshi KOMIYA 2021-04-13 01:15:44 +09:00 committed by GitHub
commit 32337c3ba7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -301,6 +301,7 @@ sure that "sphinx.ext.napoleon" is enabled in `conf.py`::
napoleon_use_ivar = False
napoleon_use_param = True
napoleon_use_rtype = True
napoleon_preprocess_types = False
napoleon_type_aliases = None
napoleon_attr_annotations = True
@ -510,6 +511,16 @@ sure that "sphinx.ext.napoleon" is enabled in `conf.py`::
:returns: *bool* -- True if successful, False otherwise
.. confval:: napoleon_preprocess_types
True to convert the type definitions in the docstrings as references.
Defaults to *True*.
.. versionadded:: 3.2.1
.. versionchanged:: 3.5
Do preprocess the Google style docstrings also.
.. confval:: napoleon_type_aliases
A mapping to translate type names to other names or references. Works
@ -570,4 +581,4 @@ sure that "sphinx.ext.napoleon" is enabled in `conf.py`::
.. versionadded:: 1.8
.. versionchanged:: 3.5
Support ``params_style`` and ``returns_style``
Support ``params_style`` and ``returns_style``

View File

@ -240,7 +240,7 @@ class Config:
:returns: *bool* -- True if successful, False otherwise
napoleon_preprocess_types : :obj:`bool` (Defaults to False)
Enable the type preprocessor for numpy style docstrings.
Enable the type preprocessor.
napoleon_type_aliases : :obj:`dict` (Defaults to None)
Add a mapping of strings to string, translating types in numpy