Skip to content

Commit 9739c71

Browse files
pauloxnetsarahboyce
authored andcommitted
Improved the writing documentation contributing guide.
1 parent 7a1fa20 commit 9739c71

File tree

1 file changed

+37
-12
lines changed

1 file changed

+37
-12
lines changed

docs/internals/contributing/writing-documentation.txt

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,14 @@ Spelling check
159159

160160
Before you commit your docs, it's a good idea to run the spelling checker.
161161
You'll need to install :pypi:`sphinxcontrib-spelling` first. Then from the
162-
``docs`` directory, run ``make spelling``. Wrong words (if any) along with the
163-
file and line number where they occur will be saved to
164-
``_build/spelling/output.txt``.
162+
``docs`` directory, run:
163+
164+
.. console::
165+
166+
$ make spelling
167+
168+
Wrong words (if any) along with the file and line number where they occur will
169+
be saved to ``_build/spelling/output.txt``.
165170

166171
If you encounter false-positives (error output that actually is correct), do
167172
one of the following:
@@ -179,10 +184,21 @@ Link check
179184

180185
Links in documentation can become broken or changed such that they are no
181186
longer the canonical link. Sphinx provides a builder that can check whether the
182-
links in the documentation are working. From the ``docs`` directory, run ``make
183-
linkcheck``. Output is printed to the terminal, but can also be found in
187+
links in the documentation are working. From the ``docs`` directory, run:
188+
189+
.. console::
190+
191+
$ make linkcheck
192+
193+
Output is printed to the terminal, but can also be found in
184194
``_build/linkcheck/output.txt`` and ``_build/linkcheck/output.json``.
185195

196+
.. warning::
197+
198+
The execution of the command requires an internet connection and takes
199+
several minutes to complete, because the command tests all the links
200+
that are found in the documentation.
201+
186202
Entries that have a status of "working" are fine, those that are "unchecked" or
187203
"ignored" have been skipped because they either cannot be checked or have
188204
matched ignore rules in the configuration.
@@ -290,7 +306,8 @@ documentation:
290306
display a link with the title "auth".
291307

292308
* All Python code blocks should be formatted using the :pypi:`blacken-docs`
293-
auto-formatter. This will be run by ``pre-commit`` if that is configured.
309+
auto-formatter. This will be run by :ref:`pre-commit
310+
<coding-style-pre-commit>` if that is configured.
294311

295312
* Use :mod:`~sphinx.ext.intersphinx` to reference Python's and Sphinx'
296313
documentation.
@@ -324,8 +341,9 @@ documentation:
324341
Five
325342
^^^^
326343

327-
* Use :rst:role:`:rfc:<rfc>` to reference RFC and try to link to the relevant
328-
section if possible. For example, use ``:rfc:`2324#section-2.3.2``` or
344+
* Use :rst:role:`:rfc:<rfc>` to reference a Request for Comments (RFC) and
345+
try to link to the relevant section if possible. For example, use
346+
``:rfc:`2324#section-2.3.2``` or
329347
``:rfc:`Custom link text <2324#section-2.3.2>```.
330348

331349
* Use :rst:role:`:pep:<pep>` to reference a Python Enhancement Proposal (PEP)
@@ -339,6 +357,9 @@ documentation:
339357
also need to define a reference to the documentation for that environment
340358
variable using :rst:dir:`.. envvar:: <envvar>`.
341359

360+
* Use :rst:role:`:cve:<cve>` to reference a Common Vulnerabilities and
361+
Exposures (CVE) identifier. For example, use ``:cve:`2019-14232```.
362+
342363
Django-specific markup
343364
======================
344365

@@ -518,7 +539,7 @@ Minimizing images
518539
Optimize image compression where possible. For PNG files, use OptiPNG and
519540
AdvanceCOMP's ``advpng``:
520541

521-
.. code-block:: console
542+
.. console::
522543

523544
$ cd docs
524545
$ optipng -o7 -zm1-9 -i0 -strip all `find . -type f -not -path "./_build/*" -name "*.png"`
@@ -619,6 +640,10 @@ included in the Django repository and the releases as
619640
``docs/man/django-admin.1``. There isn't a need to update this file when
620641
updating the documentation, as it's updated once as part of the release process.
621642

622-
To generate an updated version of the man page, run ``make man`` in the
623-
``docs`` directory. The new man page will be written in
624-
``docs/_build/man/django-admin.1``.
643+
To generate an updated version of the man page, in the ``docs`` directory, run:
644+
645+
.. console::
646+
647+
$ make man
648+
649+
The new man page will be written in ``docs/_build/man/django-admin.1``.

0 commit comments

Comments
 (0)