mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Close #207: Now highlight_language supports multiple languages
This changes the structure of `highlight_options` to a dictionary that maps language names to option dictionary. It allows to setting pygments options for multiple languages at once.
This commit is contained in:
@@ -582,12 +582,27 @@ General configuration
|
||||
|
||||
.. confval:: highlight_options
|
||||
|
||||
A dictionary of options that modify how the lexer specified by
|
||||
:confval:`highlight_language` generates highlighted source code. These are
|
||||
lexer-specific; for the options understood by each, see the
|
||||
`Pygments documentation <https://pygments.org/docs/lexers>`_.
|
||||
A dictionary that maps language names to options for the lexer modules of
|
||||
Pygments. These are lexer-specific; for the options understood by each,
|
||||
see the `Pygments documentation <https://pygments.org/docs/lexers>`_.
|
||||
|
||||
Example::
|
||||
|
||||
highlight_options = {
|
||||
'default': {'stripall': True},
|
||||
'php': {'startinline': True},
|
||||
}
|
||||
|
||||
A single dictionary of options are also allowed. Then it is recognized
|
||||
as options to the lexer specified by :confval:`highlight_language`::
|
||||
|
||||
# configuration for the ``highlight_language``
|
||||
highlight_options = {'stripall': True}
|
||||
|
||||
.. versionadded:: 1.3
|
||||
.. versionchanged:: 3.5
|
||||
|
||||
Allow to configure highlight options for multiple languages
|
||||
|
||||
.. confval:: pygments_style
|
||||
|
||||
|
||||
Reference in New Issue
Block a user