Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pip._vendor.pygments.plugin Namespace Reference

Functions

 iter_entry_points (group_name)
 
 find_plugin_lexers ()
 
 find_plugin_formatters ()
 
 find_plugin_styles ()
 
 find_plugin_filters ()
 

Variables

str LEXER_ENTRY_POINT = 'pygments.lexers'
 
str FORMATTER_ENTRY_POINT = 'pygments.formatters'
 
str STYLE_ENTRY_POINT = 'pygments.styles'
 
str FILTER_ENTRY_POINT = 'pygments.filters'
 

Detailed Description

    pygments.plugin
    ~~~~~~~~~~~~~~~

    Pygments plugin interface. By default, this tries to use
    ``importlib.metadata``, which is in the Python standard
    library since Python 3.8, or its ``importlib_metadata``
    backport for earlier versions of Python. It falls back on
    ``pkg_resources`` if not found. Finally, if ``pkg_resources``
    is not found either, no plugins are loaded at all.

    lexer plugins::

        [pygments.lexers]
        yourlexer = yourmodule:YourLexer

    formatter plugins::

        [pygments.formatters]
        yourformatter = yourformatter:YourFormatter
        /.ext = yourformatter:YourFormatter

    As you can see, you can define extensions for the formatter
    with a leading slash.

    syntax plugins::

        [pygments.styles]
        yourstyle = yourstyle:YourStyle

    filter plugin::

        [pygments.filter]
        yourfilter = yourfilter:YourFilter


    :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.

Function Documentation

◆ find_plugin_filters()

find_plugin_filters ( )

Definition at line 86 of file plugin.py.

86def find_plugin_filters():
87 for entrypoint in iter_entry_points(FILTER_ENTRY_POINT):
for i

References i, and pip._vendor.pygments.plugin.iter_entry_points().

Here is the call graph for this function:

◆ find_plugin_formatters()

find_plugin_formatters ( )

Definition at line 76 of file plugin.py.

76def find_plugin_formatters():
77 for entrypoint in iter_entry_points(FORMATTER_ENTRY_POINT):
79
80

References i, and pip._vendor.pygments.plugin.iter_entry_points().

Here is the call graph for this function:

◆ find_plugin_lexers()

find_plugin_lexers ( )

Definition at line 71 of file plugin.py.

71def find_plugin_lexers():
72 for entrypoint in iter_entry_points(LEXER_ENTRY_POINT):
73 yield entrypoint.load()
74
75

References i, and pip._vendor.pygments.plugin.iter_entry_points().

Here is the call graph for this function:

◆ find_plugin_styles()

find_plugin_styles ( )

Definition at line 81 of file plugin.py.

81def find_plugin_styles():
82 for entrypoint in iter_entry_points(STYLE_ENTRY_POINT):
84
85

References i, and pip._vendor.pygments.plugin.iter_entry_points().

Here is the call graph for this function:

◆ iter_entry_points()

iter_entry_points (   group_name)

Definition at line 47 of file plugin.py.

47def iter_entry_points(group_name):
48 try:
49 from importlib.metadata import entry_points
50 except ImportError:
51 try:
52 from importlib_metadata import entry_points
53 except ImportError:
54 try:
55 from pip._vendor.pkg_resources import iter_entry_points
56 except (ImportError, OSError):
57 return []
58 else:
59 return iter_entry_points(group_name)
60 groups = entry_points()
61 if hasattr(groups, 'select'):
62 # New interface in Python 3.10 and newer versions of the
63 # importlib_metadata backport.
64 return groups.select(group=group_name)
65 else:
66 # Older interface, deprecated in Python 3.10 and recent
67 # importlib_metadata, but we need it in Python 3.8 and 3.9.
68 return groups.get(group_name, [])
69
70

References i, and pip._vendor.pygments.plugin.iter_entry_points().

Referenced by pip._vendor.pygments.plugin.find_plugin_filters(), pip._vendor.pygments.plugin.find_plugin_formatters(), pip._vendor.pygments.plugin.find_plugin_lexers(), pip._vendor.pygments.plugin.find_plugin_styles(), and pip._vendor.pygments.plugin.iter_entry_points().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ FILTER_ENTRY_POINT

str FILTER_ENTRY_POINT = 'pygments.filters'

Definition at line 44 of file plugin.py.

◆ FORMATTER_ENTRY_POINT

str FORMATTER_ENTRY_POINT = 'pygments.formatters'

Definition at line 42 of file plugin.py.

◆ LEXER_ENTRY_POINT

str LEXER_ENTRY_POINT = 'pygments.lexers'

Definition at line 41 of file plugin.py.

◆ STYLE_ENTRY_POINT

str STYLE_ENTRY_POINT = 'pygments.styles'

Definition at line 43 of file plugin.py.