Skip to content

Commit 5720f08

Browse files
authored
DOC: Use :ref: when referring to section headers (#424)
Improve links to section headers in style guide
1 parent d50e1f8 commit 5720f08

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

doc/format.rst

+14-8
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Use a code checker:
3131
* pyflakes_: a tool to check Python code for errors by parsing
3232
the source file instead of importing it.
3333
* pycodestyle_: (formerly ``pep8``) a tool to check Python code against
34-
some of the style conventions in PEP 8.
34+
some of the style conventions in :pep:`8`.
3535
* flake8_: a tool that glues together ``pycodestyle``, ``pyflakes``,
3636
``mccabe`` to check the style and quality of Python code.
3737
* vim-flake8_: a ``flake8`` plugin for Vim.
@@ -287,14 +287,18 @@ takes the same form as the :ref:`Returns <returns>` section::
287287
Support for the :ref:`Yields <yields>` section was added in `numpydoc
288288
<https://github.com/numpy/numpydoc>`_ version 0.6.
289289

290+
.. _receives:
291+
290292
7. Receives
291293
```````````
292294

293295
Explanation of parameters passed to a generator's ``.send()`` method,
294-
formatted as for Parameters, above. Since, like for Yields and Returns, a
295-
single object is always passed to the method, this may describe either the
296-
single parameter, or positional arguments passed as a tuple. If a docstring
297-
includes Receives it must also include Yields.
296+
formatted as for :ref:`Parameters <params>`, above. Since, like for
297+
:ref:`Yields <yields>` and :ref:`Returns <returns>`, a single object is
298+
always passed to the method, this may describe either the single parameter,
299+
or positional arguments passed as a tuple. If a docstring
300+
includes :ref:`Receives <receives>` it must also include
301+
:ref:`Yields <yields>`.
298302

299303
8. Other Parameters
300304
```````````````````
@@ -303,6 +307,8 @@ An optional section used to describe infrequently used parameters.
303307
It should only be used if a function has a large number of keyword
304308
parameters, to prevent cluttering the :ref:`Parameters <params>` section.
305309

310+
.. _raises:
311+
306312
9. Raises
307313
`````````
308314

@@ -321,7 +327,7 @@ that are non-obvious or have a large chance of getting raised.
321327
`````````
322328

323329
An optional section detailing which warnings get raised and
324-
under what conditions, formatted similarly to Raises.
330+
under what conditions, formatted similarly to :ref:`Raises <raises>`.
325331

326332
11. Warnings
327333
````````````
@@ -545,8 +551,8 @@ Documenting classes
545551

546552
Class docstring
547553
```````````````
548-
Use the same sections as outlined above (all except ``Returns`` are
549-
applicable). The constructor (``__init__``) should also be documented
554+
Use the same sections as outlined above (all except :ref:`Returns <returns>`
555+
are applicable). The constructor (``__init__``) should also be documented
550556
here, the :ref:`Parameters <params>` section of the docstring details the
551557
constructor's parameters.
552558

0 commit comments

Comments
 (0)