comparison docs/filters.rst @ 287:f506d752e801

FIX: the type of a is pygments.token._TokenType -- not pygments.token.Token
author Franz Glasner <fzglas.hg@dom66.de>
date Fri, 22 May 2026 12:31:09 +0200
parents 315e94bac8a7
children a094305c5708
comparison
equal deleted inserted replaced
286:051c8877ee22 287:f506d752e801
68 ================== 68 ==================
69 69
70 :Name: tokenreplace 70 :Name: tokenreplace
71 :Filter Options: 71 :Filter Options:
72 ``replacements`` 72 ``replacements``
73 **Type:** :py:class:`dict[str | pygments.token.Token, str | pygments.token.Token]` 73 **Type:** :py:class:`dict[str | pygments.token._TokenType, str | pygments.token._TokenType]`
74 74
75 A map from tokens to their replacements. 75 A map from tokens to their replacements.
76 76
77 ``token_from`` 77 ``token_from``
78 **Type:** :py:class:`str` or :py:class:`pygments.token.Token` 78 **Type:** :py:class:`str` or :py:class:`pygments.token._TokenType`
79 79
80 The name of a token type (like ``Error``) or a token object 80 The name of a token type (like ``Error``) or a token object
81 (like :py:class:`pygments.token.Token.Error`). 81 (like :py:class:`pygments.token.Token.Error`).
82 82
83 If given the `token_to` options is required and `replacements` will be 83 If given the `token_to` options is required and `replacements` will be
84 augmented with their respective values. 84 augmented with their respective values.
85 85
86 ``token_to`` 86 ``token_to``
87 **Type:** :py:class:`str` or :py:class:`pygments.token.Token` 87 **Type:** :py:class:`str` or :py:class:`pygments.token._TokenType`
88 88
89 The name of a token type (like ``Generic.Error``) or a token object 89 The name of a token type (like ``Generic.Error``) or a token object
90 (like :py:class:`pygments.token.Token.Generic.Error`). 90 (like :py:class:`pygments.token.Token.Generic.Error`).
91 91
92 This option is required if `token_from` is given. 92 This option is required if `token_from` is given.