diff options
author | blackbird <devnull@localhost> | 2006-12-21 22:10:34 +0100 |
---|---|---|
committer | blackbird <devnull@localhost> | 2006-12-21 22:10:34 +0100 |
commit | f86e5908ca4c35bcbe8fe25ba839ff5c9a7a9f34 (patch) | |
tree | 98237a777c718b58116b68e7643c79e76acf10f8 /pygments/plugin.py | |
parent | 95377ce6c229ec8cb1df8e358337fc524b8476c8 (diff) | |
download | pygments-f86e5908ca4c35bcbe8fe25ba839ff5c9a7a9f34.tar.gz |
[svn] implemented filters for pygments (first approach, api might change), it's impossible at the moment to add filters by using pygmentize
Diffstat (limited to 'pygments/plugin.py')
-rw-r--r-- | pygments/plugin.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pygments/plugin.py b/pygments/plugin.py index 4422cbb5..89300677 100644 --- a/pygments/plugin.py +++ b/pygments/plugin.py @@ -26,6 +26,11 @@ [pygments.styles] yourstyle = yourstyle:YourStyle + filter plugin:: + + [pygments.filter] + yourfilter = yourfilter:YourFilter + :copyright: 2006 by Armin Ronacher. :license: BSD, see LICENSE for more details. @@ -38,6 +43,7 @@ except ImportError: LEXER_ENTRY_POINT = 'pygments.lexers' FORMATTER_ENTRY_POINT = 'pygments.formatters' STYLE_ENTRY_POINT = 'pygments.styles' +FILTER_ENTRY_POINT = 'pygments.filters' def find_plugin_lexers(): @@ -59,3 +65,10 @@ def find_plugin_styles(): return for entrypoint in pkg_resources.iter_entry_points(STYLE_ENTRY_POINT): yield entrypoint.name, entrypoint.load() + + +def find_plugin_filters(): + if pkg_recources is None: + return + for entrypoint in pkg_resources.iter_entry_points(FILTER_ENTRY_POINT): + yield entrypoint.name, entrypoint.load() |