package documentation

Pygments formatters.

Unknown Field: copyright
Copyright 2006-2021 by the Pygments team, see AUTHORS.
Unknown Field: license
BSD, see LICENSE for details.
Module ​_mapping pygments.formatters._mapping ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Module bbcode pygments.formatters.bbcode ~~~~~~~~~~~~~~~~~~~~~~~~~~
Module groff pygments.formatters.groff ~~~~~~~~~~~~~~~~~~~~~~~~~
Module html pygments.formatters.html ~~~~~~~~~~~~~~~~~~~~~~~~
Module img pygments.formatters.img ~~~~~~~~~~~~~~~~~~~~~~~
Module irc pygments.formatters.irc ~~~~~~~~~~~~~~~~~~~~~~~
Module latex pygments.formatters.latex ~~~~~~~~~~~~~~~~~~~~~~~~~
Module other pygments.formatters.other ~~~~~~~~~~~~~~~~~~~~~~~~~
Module pangomarkup pygments.formatters.pangomarkup ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Module rtf pygments.formatters.rtf ~~~~~~~~~~~~~~~~~~~~~~~
Module svg pygments.formatters.svg ~~~~~~~~~~~~~~~~~~~~~~~
Module terminal pygments.formatters.terminal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Module terminal256 pygments.formatters.terminal256 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From __init__.py:

Function get​_formatter​_by​_name Lookup and instantiate a formatter by alias.
Function get​_formatter​_for​_filename Lookup and instantiate a formatter by filename pattern.
Function load​_formatter​_from​_file Load a formatter from a file.
Variable newmod Undocumented
Variable oldmod Undocumented
Class ​_automodule Automatically import formatters.
Function ​_fn​_matches Return whether the supplied file name fn matches pattern filename.
Function ​_load​_formatters Load a formatter (and all others in the module too).
Function find​_formatter​_class Lookup a formatter by alias.
Function get​_all​_formatters Return a generator for all formatter classes.
Variable ​_formatter​_cache Undocumented
Variable ​_pattern​_cache Undocumented
_formatter_cache: dict =

Undocumented

_pattern_cache: dict =

Undocumented

def _fn_matches(fn, glob):
Return whether the supplied file name fn matches pattern filename.
def _load_formatters(module_name):
Load a formatter (and all others in the module too).
def get_all_formatters():
Return a generator for all formatter classes.
def find_formatter_class(alias):

Lookup a formatter by alias.

Returns None if not found.

def get_formatter_by_name(_alias, **options):

Lookup and instantiate a formatter by alias.

Raises ClassNotFound if not found.

def load_formatter_from_file(filename, formattername='CustomFormatter', **options):

Load a formatter from a file.

This method expects a file located relative to the current working directory, which contains a class named CustomFormatter. By default, it expects the Formatter to be named CustomFormatter; you can specify your own class name as the second argument to this function.

Users should be very careful with the input, because this method is equivalent to running eval on the input file.

Raises ClassNotFound if there are any problems importing the Formatter.

New in version 2.2.
def get_formatter_for_filename(fn, **options):

Lookup and instantiate a formatter by filename pattern.

Raises ClassNotFound if not found.

oldmod =

Undocumented

newmod =

Undocumented