Skip to content

Commit 8e16946

Browse files
cmarqustevepiercy
andcommitted
Apply suggestions from code review
Co-authored-by: Steve Piercy <[email protected]>
1 parent abd7a69 commit 8e16946

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed

sample-docs/kitchen-sink/all_in_one_restructuredtext.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def my_function2(foo: int, bar: str):
112112
Returns:
113113
None
114114
115-
.. deprecated:: 2.0
115+
.. deprecated:: x.y
116116
(This is an example of a deprecation admonition.)
117117
Use :py:func:`my_function_pure_sphinx` instead.
118118
@@ -168,9 +168,11 @@ def my_method(
168168
169169
Args:
170170
my_param: Documenting *my_param*.
171-
Another sentence on the next docstring line, still belonging to *my_param*.
171+
This is another sentence on the next docstring line,
172+
still belonging to *my_param*.
172173
keyword_only_param: Documenting *keyword_only_param*.
173-
Another sentence on the next docstring line, still belonging to *keyword_only_param*.
174+
This is another sentence on the next docstring line,
175+
still belonging to *keyword_only_param*.
174176
175177
Returns:
176178
The value of the local variable ``my_var``.
@@ -188,7 +190,7 @@ def my_method(
188190
return my_var
189191

190192
async def my_async_method(self, my_param: ParameterT = "default_value") -> ReturnT:
191-
"""An :term:`async` method.
193+
"""An :py::keyword:`async` method.
192194
193195
Text at end of docstring.
194196
"""

sample-docs/kitchen-sink/api.rst

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@
77
API documentation
88
*****************
99

10-
A domain is a collection of markup (directives and roles) to describe and link to objects belonging together,
11-
e.g. elements of a programming language.
10+
A domain is a collection of markup, consisting of directives and roles,
11+
that describe and link to objects belonging together,
12+
such as elements of a programming language.
1213

13-
-- https://www.sphinx-doc.org/en/master/usage/domains/index.html
14+
.. seealso::
1415

15-
The following sections show examples of the domains built-in to Sphinx.
16+
`Domains <https://www.sphinx-doc.org/en/master/usage/domains/index.html>`_
17+
18+
The following sections show examples of the built-in domains of Sphinx.
1619

1720
.. toctree::
1821
:titlesonly:
@@ -23,7 +26,8 @@ The following sections show examples of the domains built-in to Sphinx.
2326
Using autodoc
2427
=============
2528

26-
Using Sphinx's :any:`sphinx.ext.autodoc` plugin, it is possible to auto-generate documentation of a Python module.
29+
Using Sphinx's :any:`sphinx.ext.autodoc` plugin,
30+
it is possible to auto-generate documentation of a Python module.
2731

2832
.. tip::
2933
Avoid having in-function-signature type annotations with autodoc,
@@ -45,9 +49,18 @@ Using Sphinx's :any:`sphinx.ext.autodoc` plugin, it is possible to auto-generate
4549
The ``automodule`` Directive with reStructuredText Markup
4650
---------------------------------------------------------
4751

48-
What follows after the line is an example showing usage of the ``.. automodule::`` directive.
52+
The following markup is an example of the ``automodule`` directive.
53+
Note that the ``currentmodule`` directive sets the current module.
54+
55+
.. code-block:: rst
56+
57+
.. currentmodule:: all_in_one_restructuredtext
58+
59+
.. automodule:: all_in_one_restructuredtext
60+
:members:
61+
:member-order: bysource
4962
50-
---
63+
The foregoing markup example renders as shown below.
5164

5265
.. currentmodule:: all_in_one_restructuredtext
5366

0 commit comments

Comments
 (0)