summaryrefslogtreecommitdiff
path: root/pygments/plugin.py
diff options
context:
space:
mode:
authorblackbird <devnull@localhost>2006-12-21 22:10:34 +0100
committerblackbird <devnull@localhost>2006-12-21 22:10:34 +0100
commitf86e5908ca4c35bcbe8fe25ba839ff5c9a7a9f34 (patch)
tree98237a777c718b58116b68e7643c79e76acf10f8 /pygments/plugin.py
parent95377ce6c229ec8cb1df8e358337fc524b8476c8 (diff)
downloadpygments-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.py13
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()