Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes
MoinMoin.support.pygments.filters.CodeTagFilter Class Reference
Inheritance diagram for MoinMoin.support.pygments.filters.CodeTagFilter:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.support.pygments.filters.CodeTagFilter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def filter

Public Attributes

 tag_re

Detailed Description

Highlight special code tags in comments and docstrings.

Options accepted:

`codetags` : list of strings
   A list of strings that are flagged as code tags.  The default is to
   highlight ``XXX``, ``TODO``, ``BUG`` and ``NOTE``.

Definition at line 73 of file __init__.py.


Constructor & Destructor Documentation

Definition at line 84 of file __init__.py.

00084 
00085     def __init__(self, **options):
00086         Filter.__init__(self, **options)
00087         tags = get_list_opt(options, 'codetags',
00088                             ['XXX', 'TODO', 'BUG', 'NOTE'])
00089         self.tag_re = re.compile(r'\b(%s)\b' % '|'.join([
00090             re.escape(tag) for tag in tags if tag
00091         ]))


Member Function Documentation

def MoinMoin.support.pygments.filters.CodeTagFilter.filter (   self,
  lexer,
  stream 
)

Definition at line 92 of file __init__.py.

00092 
00093     def filter(self, lexer, stream):
00094         regex = self.tag_re
00095         for ttype, value in stream:
00096             if ttype in String.Doc or \
00097                ttype in Comment and \
00098                ttype not in Comment.Preproc:
00099                 for sttype, svalue in _replace_special(ttype, value, regex,
00100                                                        Comment.Special):
00101                     yield sttype, svalue
00102             else:
00103                 yield ttype, value
00104 

Here is the call graph for this function:


Member Data Documentation

Definition at line 88 of file __init__.py.


The documentation for this class was generated from the following file: