doc: rewrite options for highlight by directive:option directive

This commit is contained in:
Takeshi KOMIYA 2019-05-30 01:54:37 +09:00
parent 7a98c2bfa1
commit d82e0bb5a5

View File

@ -453,21 +453,29 @@ __ http://pygments.org/docs/lexers/
As discussed previously, *language* can be any lexer alias supported by As discussed previously, *language* can be any lexer alias supported by
Pygments. Pygments.
**Additional options** .. rubric:: options
Pygments can generate line numbers for code blocks. To enable this, use the .. rst:directive:option:: linenothreshold: threshold
``linenothreshold`` option. :: :type: number (optional)
Enable to generate line numbers for code blocks.
This option takes an optional number as threshold parameter. If any
threshold given, the directive will produce line numbers only for the code
blocks longer than N lines. If not given, line numbers will be produced
for all of code blocks.
Example::
.. highlight:: python .. highlight:: python
:linenothreshold: 5 :linenothreshold: 5
This will produce line numbers for all code blocks longer than five lines. .. rst:directive:option:: force
:type: no value
To ignore minor errors on highlighting, you can specifiy ``:force:`` option. If given, minor errors on highlighting are ignored.
.. versionchanged:: 2.1 .. versionadded:: 2.1
``:force:`` option.
.. rst:directive:: .. code-block:: [language] .. rst:directive:: .. code-block:: [language]