Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
comparison docs/details-algpseudocode.rst @ 153:d475f5e252eb
Document an alternate variant to apply options to existing lexers
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 07 May 2026 22:35:53 +0200 |
| parents | 4acf578ae93f |
| children | b38d10ab914a |
comparison
equal
deleted
inserted
replaced
| 152:66d49e49b06b | 153:d475f5e252eb |
|---|---|
| 381 | 381 |
| 382 Customized Lexers in Sphinx | 382 Customized Lexers in Sphinx |
| 383 =========================== | 383 =========================== |
| 384 | 384 |
| 385 Defining lexers with non-default options in `Sphinx`_ can be done in its | 385 Defining lexers with non-default options in `Sphinx`_ can be done in its |
| 386 configuration file :file:`conf.py`: | 386 configuration file :file:`conf.py`. |
| 387 | |
| 388 The first option is to apply the Sphinx config value ``highlight_options`` | |
| 389 properly. An existing lexer can be customized by options. | |
| 390 | |
| 391 A more flexible alternative is to define a new lexer in the Sphinx | |
| 392 application. The very same lexer class can be used with different options: | |
| 387 | 393 |
| 388 .. code-block:: python | 394 .. code-block:: python |
| 389 | 395 |
| 390 from functools import partial | 396 from functools import partial |
| 391 from pygments_lexer_pseudocode2.algpseudocode import AlgPseudocodeLexer | 397 from pygments_lexer_pseudocode2.algpseudocode import AlgPseudocodeLexer |
