summaryrefslogtreecommitdiffstats
path: root/user_guide_src/cilexer/cilexer/cilexer.py
blob: 265b4077fcf769fabfab681c3d6a1da8910e327c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import re
import copy

from pygments.lexer import DelegatingLexer
from pygments.lexers.web import PhpLexer, HtmlLexer

__all__ = ['CodeIgniterLexer']


class CodeIgniterLexer(DelegatingLexer):
    """
    Handles HTML, PHP, JavaScript, and CSS is highlighted
    PHP is highlighted with the "startline" option
    """

    name = 'CodeIgniter'
    aliases = ['ci', 'codeigniter']
    filenames = ['*.html', '*.css', '*.php', '*.xml', '*.static']
    mimetypes = ['text/html', 'application/xhtml+xml']

    def __init__(self, **options):
        super(CodeIgniterLexer, self).__init__(HtmlLexer,
                                               PhpLexer,
                                               startinline=True)