Skip to content

Commit 8117bca

Browse files
timhoffmAA-Turner
andauthored
Format autosummary options in docs (#13106)
Co-authored-by: Adam Turner <[email protected]>
1 parent c6b9dc1 commit 8117bca

File tree

1 file changed

+32
-28
lines changed

1 file changed

+32
-28
lines changed

doc/usage/extensions/autosummary.rst

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -61,63 +61,67 @@ The :mod:`sphinx.ext.autosummary` extension does this in two parts:
6161
:event:`autodoc-process-docstring` and :event:`autodoc-process-signature`
6262
hooks as :mod:`~sphinx.ext.autodoc`.
6363

64-
**Options**
64+
.. rubric:: Options
6565

66-
* If you want the :rst:dir:`autosummary` table to also serve as a
67-
:rst:dir:`toctree` entry, use the ``toctree`` option, for example::
66+
.. rst:directive:option:: toctree: optional directory name
67+
68+
If you want the :rst:dir:`autosummary` table to also serve as a
69+
:rst:dir:`toctree` entry, use the ``toctree`` option, for example::
6870
6971
.. autosummary::
7072
:toctree: DIRNAME
7173
7274
sphinx.environment.BuildEnvironment
7375
sphinx.util.relative_uri
7476
75-
The ``toctree`` option also signals to the :program:`sphinx-autogen` script
76-
that stub pages should be generated for the entries listed in this
77-
directive. The option accepts a directory name as an argument;
78-
:program:`sphinx-autogen` will by default place its output in this
79-
directory. If no argument is given, output is placed in the same directory
80-
as the file that contains the directive.
77+
The ``toctree`` option also signals to the :program:`sphinx-autogen` script
78+
that stub pages should be generated for the entries listed in this
79+
directive. The option accepts a directory name as an argument;
80+
:program:`sphinx-autogen` will by default place its output in this
81+
directory. If no argument is given, output is placed in the same directory
82+
as the file that contains the directive.
8183
82-
You can also use ``caption`` option to give a caption to the toctree.
84+
.. versionadded:: 0.6
8385
84-
.. versionadded:: 3.1
86+
.. rst:directive:option:: caption: caption of ToC
8587
86-
caption option added.
88+
Add a caption to the toctree.
8789
88-
* If you don't want the :rst:dir:`autosummary` to show function signatures in
89-
the listing, include the ``nosignatures`` option::
90+
.. versionadded:: 3.1
9091
91-
.. autosummary::
92-
:nosignatures:
92+
.. rst:directive:option:: nosignatures
9393
94-
sphinx.environment.BuildEnvironment
95-
sphinx.util.relative_uri
94+
Do not show function signatures in the summary.
9695
97-
* You can specify a custom template with the ``template`` option.
98-
For example, ::
96+
.. versionadded:: 0.6
97+
98+
.. rst:directive:option:: template: filename
99+
100+
Specify a custom template for rendering the summary.
101+
For example, ::
99102
100103
.. autosummary::
101104
:template: mytemplate.rst
102105
103106
sphinx.environment.BuildEnvironment
104107
105-
would use the template :file:`mytemplate.rst` in your
106-
:confval:`templates_path` to generate the pages for all entries
107-
listed. See `Customizing templates`_ below.
108+
would use the template :file:`mytemplate.rst` in your
109+
:confval:`templates_path` to generate the pages for all entries
110+
listed. See `Customizing templates`_ below.
111+
112+
.. versionadded:: 1.0
108113
109-
.. versionadded:: 1.0
114+
.. rst:directive:option:: recursive
110115
111-
* You can specify the ``recursive`` option to generate documents for
112-
modules and sub-packages recursively. It defaults to disabled.
113-
For example, ::
116+
Generate documents for modules and sub-packages recursively.
117+
For example, ::
114118
115119
.. autosummary::
116120
:recursive:
117121
118122
sphinx.environment.BuildEnvironment
119123
120-
.. versionadded:: 3.1
124+
.. versionadded:: 3.1
121125
122126
123127
:program:`sphinx-autogen` -- generate autodoc stub pages

0 commit comments

Comments
 (0)