Move reference to list of Pygments lexers

This commit is contained in:
Juan Luis Cano Rodríguez 2021-06-21 07:38:51 +02:00
parent d08c3677d1
commit 3fcaa172db
2 changed files with 9 additions and 13 deletions

View File

@ -342,15 +342,9 @@ As an example, create a new file ``docs/source/usage.rst`` (next to
(.venv) $ pip install lumache
This new file contains two :ref:`section <rst-sections>` headers, normal
paragraph text, and a ``code-block`` directive that renders a block of content
as source code, with appropriate syntax highlighting (in this case, generic
``console`` text).
.. note::
You can read `the list of available highlight
languages <https://pygments.org/docs/lexers/>`_ in the Pygments
documentation.
paragraph text, and a :ref:`code-block <rst-code-block>` directive that renders
a block of content as source code, with appropriate syntax highlighting
(in this case, generic ``console`` text).
The structure of the document is determined by the succession of heading
styles, which means that, by using ``---`` for the "Installation" section

View File

@ -488,6 +488,8 @@ __ https://pygments.org/docs/lexers
.. versionadded:: 2.1
.. _rst-code-block:
.. rst:directive:: .. code-block:: [language]
Example::
@ -497,10 +499,10 @@ __ https://pygments.org/docs/lexers
Some Ruby code.
The directive's alias name :rst:dir:`sourcecode` works as well. This
directive takes a language name as an argument. It can be any lexer alias
supported by Pygments. If it is not given, the setting of
:rst:dir:`highlight` directive will be used. If not set,
:confval:`highlight_language` will be used.
directive takes a language name as an argument. It can be `any lexer alias
supported by Pygments <https://pygments.org/docs/lexers/>`_. If it is not
given, the setting of :rst:dir:`highlight` directive will be used.
If not set, :confval:`highlight_language` will be used.
.. versionchanged:: 2.0
The ``language`` argument becomes optional.