Literal Blocks
Literal blocks render content verbatim inside a <pre> element. There are
two ways to introduce them in reStructuredText.
Like Sphinx, a :: block is still syntax-highlighted: it names no language
of its own, so it takes whichever one .. highlight:: last set.
Plain :: Introduction
A paragraph ending with :: introduces the following indented block as a
literal block. The :: is either removed entirely (standalone) or reduced
to a single : (when it follows text):
is .
and .
.A standalone :: (with no preceding text) silently introduces the block
without rendering any paragraph at all:
is :
... code-block:: Directive
The .. code-block:: directive takes a language and every presentation
option Sphinx defines. Highlighting happens during the build, into HTML
carrying one CSS class per token — see Code Blocks for the full set of
options.
Python example:
return f
Bash example:
#!/usr/bin/env bash
for; do
doneNo-language code block (.. code-block:: without an argument):
is