Skip to content
Snippets Groups Projects
Commit b80d1199 authored by David Douard's avatar David Douard
Browse files

devel/contributing/sphinx: declare rst highlighting for literal blocks

parent 584cf691
No related branches found
No related tags found
1 merge request!468Several minor updates/improvements and remove the phabricator page
Pipeline #13065 passed
...@@ -3,7 +3,12 @@ ...@@ -3,7 +3,12 @@
Sphinx gotchas Sphinx gotchas
============== ==============
Here is a list of common gotchas when formatting Python docstrings for `Sphinx <https://www.sphinx-doc.org/en/stable/>`_ and the `Napoleon <https://www.sphinx-doc.org/en/stable/ext/napoleon.html>`_ style. Here is a list of common gotchas when formatting Python docstrings for `Sphinx
<https://www.sphinx-doc.org/en/stable/>`_ and the `Napoleon
<https://www.sphinx-doc.org/en/stable/ext/napoleon.html>`_ style.
.. highlight:: rst
Sphinx Sphinx
------ ------
...@@ -11,12 +16,12 @@ Sphinx ...@@ -11,12 +16,12 @@ Sphinx
Lists Lists
+++++ +++++
All sorts of `lists <https://www.sphinx-doc.org/en/stable/rest.html#lists-and-quote-like-blocks>`_ All sorts of `lists
require an empty line before the first bullet and after the last one, <https://www.sphinx-doc.org/en/stable/rest.html#lists-and-quote-like-blocks>`_
to be properly interpreted as list. require an empty line before the first bullet and after the last one, to be
No indentation is required for list elements w.r.t. surrounding text, properly interpreted as list. No indentation is required for list elements
and line continuations should be indented like the first character w.r.t. surrounding text, and line continuations should be indented like the
after the bullet. first character after the bullet.
Bad:: Bad::
...@@ -177,10 +182,13 @@ Good:: ...@@ -177,10 +182,13 @@ Good::
Args: Args:
foo (int): first argument foo (int): first argument
bar: second argument, which happen to have a fairly bar: second argument, which happen to have a fairly
long description of what it does long description of what it does
baz (bool): third argument baz (bool): third argument
Returns Returns
+++++++ +++++++
...@@ -232,6 +240,7 @@ Good:: ...@@ -232,6 +240,7 @@ Good::
ValueError: if you botched it ValueError: if you botched it
RuntimeError: if we botched it RuntimeError: if we botched it
See also See also
-------- --------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment