diff options
author | gbrandl <devnull@localhost> | 2007-05-03 18:26:00 +0200 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2007-05-03 18:26:00 +0200 |
commit | 910c67bc2341a7f081affbc564660ec30f866182 (patch) | |
tree | 8f51b6571e7fe595d884793e6b3322b1edb2e426 | |
parent | e130dbff2eb591c7cdca4a0bef90b63502cd3d4e (diff) | |
download | pygments-910c67bc2341a7f081affbc564660ec30f866182.tar.gz |
[svn] Fix the filters example.
-rw-r--r-- | docs/src/filters.txt | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/src/filters.txt b/docs/src/filters.txt index ecda206d..522f6330 100644 --- a/docs/src/filters.txt +++ b/docs/src/filters.txt @@ -16,15 +16,15 @@ To apply a filter, you can use the `add_filter()` method of a lexer: >>> from pygments.lexers import PythonLexer >>> l = PythonLexer() - >>> # as string - >>> l.add_filter("codetagify") + >>> # add a filter given by a string and options + >>> l.add_filter('codetagify', case='lower') >>> l.filters [<pygments.filters.CodeTagFilter object at 0xb785decc>] - >>> from pygments.filters import KeywordRewriteFilter - >>> # or class - >>> l.add_filter(KeywordRewriteFilter(keywordcase='lower')) + >>> from pygments.filters import KeywordCaseFilter + >>> # or give an instance + >>> l.add_filter(KeywordCaseFilter(case='lower')) -The `add_filter()` method also takes keyword arguments which are forwarded to +The `add_filter()` method takes keyword arguments which are forwarded to the constructor of the filter. To get a list of all registered filters by name, you can use the |