package documentation

pygments.filters ~~~~~~~~~~~~~~~~ Module containing filter lookup functions and default filters. :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details.

From __init__.py:

Class CodeTagFilter Highlight special code tags in comments and docstrings.
Class GobbleFilter Gobbles source code lines (eats initial characters).
Class KeywordCaseFilter Convert keywords to lowercase or uppercase or capitalize them, which means first letter uppercase, rest lowercase.
Class NameHighlightFilter Highlight a normal Name (and Name.*) token with a different token type.
Class RaiseOnErrorTokenFilter Raise an exception when the lexer generates an error token.
Class SymbolFilter Convert mathematical symbols such as \<longrightarrow> in Isabelle or \longrightarrow in LaTeX into Unicode characters.
Class TokenMergeFilter Merges consecutive tokens with the same token type in the output stream of a lexer.
Class VisibleWhitespaceFilter Convert tabs, newlines and/or spaces to visible characters.
Exception ErrorToken Undocumented
Function find_filter_class Lookup a filter by name. Return None if not found.
Function get_all_filters Return a generator of all filter names.
Function get_filter_by_name Return an instantiated filter.
Constant FILTERS Undocumented
Function _replace_special Undocumented
def find_filter_class(filtername): (source)

Lookup a filter by name. Return None if not found.

def get_filter_by_name(filtername, **options): (source)

Return an instantiated filter. Options are passed to the filter initializer if wanted. Raise a ClassNotFound if not found.

def get_all_filters(): (source)

Return a generator of all filter names.

def _replace_special(ttype, value, regex, specialttype, replacefunc=(lambda x: x)): (source)

Undocumented

Undocumented

Value
{'codetagify': CodeTagFilter,
 'keywordcase': KeywordCaseFilter,
 'highlight': NameHighlightFilter,
 'raiseonerror': RaiseOnErrorTokenFilter,
 'whitespace': VisibleWhitespaceFilter,
 'gobble': GobbleFilter,
 'tokenmerge': TokenMergeFilter,
...