Close #1851: Allow to omit an argument for code-block directive

This commit is contained in:
Takeshi KOMIYA
2019-02-04 01:50:16 +09:00
parent 6fd191d52e
commit 6ca669295c
6 changed files with 62 additions and 10 deletions

View File

@@ -463,7 +463,7 @@ __ http://pygments.org/docs/lexers/
This will produce line numbers for all code blocks longer than five lines.
.. rst:directive:: .. code-block:: language
.. rst:directive:: .. code-block:: [language]
Example::
@@ -471,9 +471,11 @@ __ http://pygments.org/docs/lexers/
Some Ruby code.
The directive's alias name :rst:dir:`sourcecode` works as well. As with
:rst:dir:`highlight`\ 's ``language`` option, ``language`` can be any lexer
alias supported by Pygments.
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.
**Additional options**
@@ -533,6 +535,9 @@ __ http://pygments.org/docs/lexers/
.. versionchanged:: 1.6.6
LaTeX supports the ``emphasize-lines`` option.
.. versionchanged:: 2.0
The ``language`` argument becomes optional.
.. rst:directive:: .. literalinclude:: filename
Longer displays of verbatim text may be included by storing the example text