mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Close #1851: Allow to omit an argument for code-block directive
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user