Back to index

moin  1.9.0~rc2
Public Member Functions | Static Public Attributes Class Reference
Inheritance diagram for
Inheritance graph
Collaboration diagram for
Collaboration graph

List of all members.

Public Member Functions

def analyse_text

Static Public Attributes

string name = 'Groff'
list aliases = ['groff', 'nroff', 'man']
list filenames = ['*.[1234567]', '*.man']
list mimetypes = ['application/x-troff', 'text/troff']
dictionary tokens

Detailed Description

Lexer for the (g)roff typesetting language, supporting groff
extensions. Mainly useful for highlighting manpage sources.

*New in Pygments 0.6.*

Definition at line 437 of file

Member Function Documentation

Definition at line 481 of file

00482     def analyse_text(text):
00483         if text[:1] != '.':
00484             return False
00485         if text[:3] == '.\\"':
00486             return True
00487         if text[:4] == '.TH ':
00488             return True
00489         if text[1:3].isalnum() and text[3].isspace():
00490             return 0.9

Member Data Documentation

list = ['groff', 'nroff', 'man'] [static]

Definition at line 446 of file

list = ['*.[1234567]', '*.man'] [static]

Definition at line 447 of file

list = ['application/x-troff', 'text/troff'] [static]

Definition at line 448 of file

Definition at line 445 of file

Initial value:
        'root': [
            (r'(?i)(\.)(\w+)', bygroups(Text, Keyword), 'request'),
            (r'\.', Punctuation, 'request'),
            # Regular characters, slurp till we find a backslash or newline
            (r'[^\\\n]*', Text, 'textline'),
        'textline': [
            (r'[^\\\n]+', Text),
            (r'\n', Text, '#pop'),
        'escapes': [
            # groff has many ways to write escapes.
            (r'\\"[^\n]*', Comment),            (r'\\[fn]\w', String.Escape),            (r'\\\(..', String.Escape),            (r'\\.\[.*\]', String.Escape),            (r'\\.', String.Escape),            (r'\\\n', Text, 'request'),        ],        'request': [            (r'\n', Text, '#pop'),            include('escapes'),            (r'"[^\n"]+"', String.Double),
            (r'\d+', Number),
            (r'\S+', String),
            (r'\s+', Text),

Definition at line 450 of file

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