summaryrefslogtreecommitdiff
path: root/doc/usage/extensions
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-01-30 23:29:32 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-01-30 23:29:32 +0900
commite7a0af807a58f97be826c19644fac72b50fb6769 (patch)
tree2ae84f05016687286e5849739ab9e035e49c40d9 /doc/usage/extensions
parenta2415706c849e0405d4fd37fbbb0577056342eea (diff)
parent0f8a868bf738342194d07f2edcc866001590fd63 (diff)
downloadsphinx-git-e7a0af807a58f97be826c19644fac72b50fb6769.tar.gz
Merge branch '2.0'
Diffstat (limited to 'doc/usage/extensions')
-rw-r--r--doc/usage/extensions/autodoc.rst21
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/usage/extensions/autodoc.rst b/doc/usage/extensions/autodoc.rst
index 6ca148706..dbc1abed0 100644
--- a/doc/usage/extensions/autodoc.rst
+++ b/doc/usage/extensions/autodoc.rst
@@ -599,3 +599,24 @@ member should be included in the documentation by using the following event:
``inherited_members``, ``undoc_members``, ``show_inheritance`` and
``noindex`` that are true if the flag option of same name was given to the
auto directive
+
+Generating documents from type annotations
+------------------------------------------
+
+As an experimental feature, autodoc provides ``sphinx.ext.autodoc.typehints`` as
+an additional extension. It extends autodoc itself to generate function document
+from its type annotations.
+
+To enable the feature, please add ``sphinx.ext.autodoc.typehints`` to list of
+extensions and set `'description'` to :confval:`autodoc_typehints`:
+
+.. code-block:: python
+
+ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.autodoc.typehints']
+
+ autodoc_typehints = 'description'
+
+.. versionadded:: 2.4
+
+ Added as an experimental feature. This will be integrated into autodoc core
+ in Sphinx-3.0.