summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarrissou Sant-anna <delazj@gmail.com>2021-02-08 13:03:16 +0100
committerGitHub <noreply@github.com>2021-02-08 13:03:16 +0100
commit08c2c23bb4b0eb1c3b6a9a889ad488612c33d0e0 (patch)
tree677ce7933ae9828772940ae6bbc9305908c440bf
parent84458da82889e28fc44988601a79c0c562e0e994 (diff)
downloadsphinx-git-08c2c23bb4b0eb1c3b6a9a889ad488612c33d0e0.tar.gz
Make code block types more visible
-rw-r--r--doc/usage/restructuredtext/directives.rst13
1 files changed, 9 insertions, 4 deletions
diff --git a/doc/usage/restructuredtext/directives.rst b/doc/usage/restructuredtext/directives.rst
index e8b88c21b..53625ac9e 100644
--- a/doc/usage/restructuredtext/directives.rst
+++ b/doc/usage/restructuredtext/directives.rst
@@ -404,10 +404,15 @@ Showing code examples
single: sourcecode
There are multiple ways to show syntax-highlighted literal code blocks in
-Sphinx: using :ref:`reST doctest blocks <rst-doctest-blocks>`; using :ref:`reST
-literal blocks <rst-literal-blocks>`, optionally in combination with the
-:rst:dir:`highlight` directive; using the :rst:dir:`code-block` directive; and
-using the :rst:dir:`literalinclude` directive. Doctest blocks can only be used
+Sphinx:
+
+* using :ref:`reST doctest blocks <rst-doctest-blocks>`;
+* using :ref:`reST literal blocks <rst-literal-blocks>`, optionally in
+ combination with the :rst:dir:`highlight` directive;
+* using the :rst:dir:`code-block` directive;
+* and using the :rst:dir:`literalinclude` directive.
+
+Doctest blocks can only be used
to show interactive Python sessions, while the remaining three can be used for
other languages. Of these three, literal blocks are useful when an entire
document, or at least large sections of it, use code blocks with the same