Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
view docs/filters.rst @ 223:b902b1360991
Use xcharter-otf.sty instead of \setmainfont{XCharter} because it automatically loads the XCharter Math font
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 15 May 2026 19:25:53 +0200 |
| parents | 4e4c83a87387 |
| children | e03e8cfdcece |
line wrap: on
line source
.. -*- coding: utf-8; indent-tabs-mode: nil; -*- ********* Filters ********* The package contains the following filters: .. raw:: latex {\footnotesize .. include:: filterlist.rst .. raw:: latex } The AlgPseudocode lexer yields an error token for the following code block. `Sphinx`_ therefore suppresses highlighting completely: .. code-block:: none \nonexisting{TEST} With a custom AlgPseudocode lexer that has ``prohibit_raiseonerror_filter`` activated the output in `Sphinx`_ is as: .. code-block:: no-raiseonerror-algpseudocode \nonexisting{TEST} With the "errortogenericerror" filter the very same block is highlighted as: .. code-block:: genericerror-algpseudocode \nonexisting{TEST} ErrorToGenericErrorTokenFilter ============================== :Name: errortogenericerror :Filter Options: none Replace all :py:class:`pygments.token.Token.Error` tokens in a stream by :py:class:`pygments.token.Token.Generic.Error` tokens. TokenReplaceFilter ================== :Name: tokenreplace :Required Filter Options: ``token_from`` **Type:** :py:class:`str` or :py:class:`pygments.token.Token` The name of a token type (like ``Error``) or a token object (like :py:class:`pygments.token.Token.Error`). ``token_to`` **Type:** :py:class:`str` or :py:class:`pygments.token.Token` The name of a token type (like ``Generic.Error``) or a token object (like :py:class:`pygments.token.Token.Generic.Error`). Replace all token types given in `token_from` by the token type given in `token_to`.
