diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/generate.py | 128 | ||||
-rw-r--r-- | docs/src/filters.txt | 20 | ||||
-rw-r--r-- | docs/src/formatters.txt | 258 | ||||
-rw-r--r-- | docs/src/lexers.txt | 815 |
4 files changed, 104 insertions, 1117 deletions
diff --git a/docs/generate.py b/docs/generate.py index 91a280e3..abc4565a 100644 --- a/docs/generate.py +++ b/docs/generate.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- """ Generate Pygments Documentation - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Generates a bunch of html files containing the documentation. @@ -27,6 +27,77 @@ from pygments.lexers import get_lexer_by_name from pygments.formatters import HtmlFormatter +LEXERDOC = ''' +`%s` +%s + :Aliases: %s + :Filename patterns: %s + :Mimetypes: %s + +''' + +def generate_lexer_docs(): + from pygments.lexers import LEXERS + + out = [] + + modules = {} + moduledocstrings = {} + for classname, data in sorted(LEXERS.iteritems(), key=lambda x: x[0]): + module = data[0] + mod = __import__(module, fromlist=[classname]) + cls = getattr(mod, classname) + if not cls.__doc__: + print "Warning: %s does not have a docstring." % classname + modules.setdefault(module, []).append(( + classname, + cls.__doc__, + ', '.join(data[2]) or 'None', + ', '.join(data[3]).replace('*', '\\*') or 'None', + ', '.join(data[4]) or 'None')) + if module not in moduledocstrings: + moduledocstrings[module] = mod.__doc__ + + for module, lexers in sorted(modules.iteritems(), key=lambda x: x[0]): + heading = moduledocstrings[module].splitlines()[4].strip().rstrip('.') + out.append('\n' + heading + '\n' + '-'*len(heading) + '\n') + for data in lexers: + out.append(LEXERDOC % data) + return ''.join(out) + +def generate_formatter_docs(): + from pygments.formatters import FORMATTERS + + out = [] + for cls, data in FORMATTERS.iteritems(): + heading = cls.__name__ + out.append('`' + heading + '`\n' + '-'*(2+len(heading)) + '\n') + out.append(cls.__doc__) + out.append(''' + :Aliases: %s + :Filename patterns: %s + + +''' % (', '.join(data[1]) or 'None', ', '.join(data[2]).replace('*', '\\*') or 'None')) + return ''.join(out) + +def generate_filter_docs(): + from pygments.filters import FILTERS + + out = [] + for name, cls in FILTERS.iteritems(): + out.append(''' +`%s` +%s + :Name: %s +''' % (cls.__name__, cls.__doc__, name)) + return ''.join(out) + +LEXERDOCS = generate_lexer_docs() +FORMATTERDOCS = generate_formatter_docs() +FILTERDOCS = generate_filter_docs() + + PYGMENTS_FORMATTER = HtmlFormatter(style='pastie', cssclass='syntax') USAGE = '''\ @@ -207,24 +278,7 @@ div.toc { div.toc h2 { font-size: 20px; } -''' - - -def generate_documentation(data, link_style): - writer = DocumentationWriter(link_style) - parts = publish_parts( - data, - writer=writer, - settings_overrides={ - 'initial_header_level': 3, - 'field_name_limit': 50, - } - ) - return { - 'title': parts['title'].encode('utf-8'), - 'body': parts['body'].encode('utf-8'), - 'toc': parts['toc'] - } +''' #' def pygments_directive(name, arguments, options, content, lineno, @@ -241,6 +295,16 @@ pygments_directive.content = 1 directives.register_directive('sourcecode', pygments_directive) +def create_translator(link_style): + class Translator(html4css1.HTMLTranslator): + def visit_reference(self, node): + refuri = node.get('refuri') + if refuri is not None and '/' not in refuri and refuri.endswith('.txt'): + node['refuri'] = link_style(refuri[:-4]) + html4css1.HTMLTranslator.visit_reference(self, node) + return Translator + + class DocumentationWriter(html4css1.Writer): def __init__(self, link_style): @@ -279,14 +343,24 @@ class DocumentationWriter(html4css1.Writer): return [] -def create_translator(link_style): - class Translator(html4css1.HTMLTranslator): - def visit_reference(self, node): - refuri = node.get('refuri') - if refuri is not None and '/' not in refuri and refuri.endswith('.txt'): - node['refuri'] = link_style(refuri[:-4]) - html4css1.HTMLTranslator.visit_reference(self, node) - return Translator +def generate_documentation(data, link_style): + writer = DocumentationWriter(link_style) + data = data.replace('[builtin_lexer_docs]', LEXERDOCS).\ + replace('[builtin_formatter_docs]', FORMATTERDOCS).\ + replace('[builtin_filter_docs]', FILTERDOCS) + parts = publish_parts( + data, + writer=writer, + settings_overrides={ + 'initial_header_level': 3, + 'field_name_limit': 50, + } + ) + return { + 'title': parts['title'].encode('utf-8'), + 'body': parts['body'].encode('utf-8'), + 'toc': parts['toc'] + } def handle_python(filename, fp, dst): diff --git a/docs/src/filters.txt b/docs/src/filters.txt index 570be584..ecda206d 100644 --- a/docs/src/filters.txt +++ b/docs/src/filters.txt @@ -39,22 +39,4 @@ If you want to write your own filter, have a look at `Write your own filter`_. Builtin Filters =============== -`CodeTagFilter` - - Highlights special code tags in comments and docstrings. Per default, the - list of highlighted tags is ``XXX``, ``TODO``, ``BUG`` and ``NOTE``. You can - override this list by specifying a `codetags` parameter that takes a list of - words. - - :Name: ``codetagify`` - - -`KeywordCaseFilter` - - Converts keywords to ``lower``, ``upper`` or ``capitalize`` which means - first letter uppercase, rest lowercase. This can be useful e.g. if you - highlight Pascal code and want to adapt the code to your styleguide. The - default is ``lower``, override that by providing the `keywordcase` - parameter. - - :Name: ``keywordcase`` +[builtin_filter_docs] diff --git a/docs/src/formatters.txt b/docs/src/formatters.txt index 4eb64e7d..3832a3f1 100644 --- a/docs/src/formatters.txt +++ b/docs/src/formatters.txt @@ -59,260 +59,4 @@ Formatter classes All these classes are importable from `pygments.formatters`. - -`HtmlFormatter` ---------------- - - Formats tokens as HTML 4 ``<span>`` tags within a ``<pre>`` tag, wrapped - in a ``<div>`` tag. The ``<div>``'s CSS class can be set by the `cssclass` - option. - - If the `linenos` option is given and true, the ``<pre>`` is additionally - wrapped inside a ``<table>`` which has one row and two cells: one - containing the line numbers and one containing the code. Example: - - .. sourcecode:: html - - <div class="highlight" > - <table><tr> - <td class="linenos" title="click to toggle" - onclick="with (this.firstChild.style) - { display = (display == '') ? 'none' : '' }"> - <pre>1 - 2</pre> - </td> - <td class="code"> - <pre><span class="Ke">def </span><span class="NaFu">foo</span>(bar): - <span class="Ke">pass</span> - </pre> - </td> - </tr></table></div> - - (whitespace added to improve clarity). Wrapping can be disabled using the - `nowrap` option. - - With the `full` option, a complete HTML 4 document is output, including - the style definitions inside a ``<style>`` tag, or in a separate file if - the `cssfile` option is given. - - The `get_style_defs(arg='')` method of a `HtmlFormatter` returns a string - containing CSS rules for the CSS classes used by the formatter. The - argument `arg` can be used to specify additional CSS selectors that - are prepended to the classes. A call `fmter.get_style_defs('td .code')` - would result in the following CSS classes: - - .. sourcecode:: css - - td .code .kw { font-weight: bold; color: #00FF00 } - td .code .cm { color: #999999 } - ... - - If you have pygments 0.6 or higher you can also pass a list of tuple to the - `get_style_defs` method to request multiple prefixes for the tokens: - - .. sourcecode:: python - - formatter.get_style_defs(['div.syntax pre', 'pre.syntax']) - - The output would then look like this: - - .. sourcecode:: css - - div.syntax pre .kw, - pre.syntax .kw { font-weight: bold; color: #00FF00 } - div.syntax pre .cm, - pre.syntax .cm { color: #999999 } - ... - - Additional options accepted by the `HtmlFormatter`: - - `nowrap` - If set to ``True``, don't wrap the tokens at all, not even in a ``<pre>`` - tag. This disables all other options (default: ``False``). - - `noclasses` - If set to true, token ``<span>`` tags will not use CSS classes, but - inline styles. This is not recommended for larger pieces of code since - it increases output size by quite a bit (default: ``False``). - - `classprefix` - Since the token types use relatively short class names, they may clash - with some of your own class names. In this case you can use the - `classprefix` option to give a string to prepend to all Pygments-generated - CSS class names for token types. - Note that this option also affects the output of `get_style_defs()`. - - `cssclass` - CSS class for the wrapping ``<div>`` tag (default: ``'highlight'``). - - `cssstyles` - Inline CSS styles for the wrapping ``<div>`` tag (default: ``''``). - - `cssfile` - If the `full` option is true and this option is given, it must be the - name of an external file. The stylesheet is then written to this file - instead of the HTML file. *New in Pygments 0.6.* - - `linenospecial` - If set to a number n > 0, every nth line number is given the CSS - class ``"special"`` (default: ``0``). - - `nobackground` - If set to ``True``, the formatter won't output the background color - for the wrapping element (this automatically defaults to ``False`` - when there is no wrapping element [eg: no argument for the - `get_syntax_defs` method given]) (default: ``False``). *New in - Pygments 0.6.* - - :Aliases: ``html`` - :Filename patterns: ``*.html``, ``*.htm`` - - -`LatexFormatter` ----------------- - - Formats tokens as LaTeX code. This needs the `fancyvrb` and `color` - standard packages. - - Without the `full` option, code is formatted as one ``Verbatim`` - environment, like this: - - .. sourcecode:: latex - - \begin{Verbatim}[commandchars=@\[\]] - @Can[def ]@Cax[foo](bar): - @Can[pass] - \end{Verbatim} - - The command sequences used here (``@Can`` etc.) are generated from the given - `style` and can be retrieved using the `get_style_defs` method. - - With the `full` option, a complete LaTeX document is output, including - the command definitions in the preamble. - - The `get_style_defs(arg='')` method of a `LatexFormatter` returns a string - containing ``\newcommand`` commands defining the commands used inside the - ``Verbatim`` environments. If the argument `arg` is true, - ``\renewcommand`` is used instead. - - Additional options accepted by the `LatexFormatter`: - - `docclass` - If the `full` option is enabled, this is the document class to use - (default: ``'article'``). - - `preamble` - If the `full` option is enabled, this can be further preamble commands, - e.g. ``\usepackage`` (default: ``''``). - - `verboptions` - Additional options given to the Verbatim environment (see the *fancyvrb* - docs for possible values) (default: ``''``). - - :Aliases: ``latex``, ``tex`` - :Filename pattern: ``*.tex`` - - -`RtfFormatter` --------------- - - Formats tokens as RTF markup. This formatter automatically outputs full RTF - documents with color information and other useful stuff. Perfect for Copy and - Paste into Microsoft® Word® documents. - - *New in Pygments 0.6.* - - Additional options accepted by the `RtfFormatter`: - - `fontface` - The used font famliy, for example ``Bitstream Vera Sans``. Defaults to - some generic font which is supposed to have fixed width. - - :Aliases: ``rtf`` - :Filename pattern: ``*.rtf`` - - -`BBCodeFormatter` ------------------ - - Formats tokens with BBcodes. These formatting codes are used by many - bulletin boards, so you can highlight your sourcecode with pygments before - posting it there. - - This formatter has no support for background colors and borders, as there - are no common BBcode tags for that. - - Some board systems (e.g. phpBB) don't support colors in their [code] tag, - so you can't use the highlighting together with that tag. - Text in a [code] tag usually is shown with a monospace font (which this - formatter can do with the ``monofont`` option) and no spaces (which you - need for indentation) are removed. - - The `BBCodeFormatter` accepts two additional option: - - `codetag` - If set to true, put the output into ``[code]`` tags (default: - ``false``) - - `monofont` - If set to true, add a tag to show the code with a monospace font - (default: ``false``). - - :Aliases: ``bbcode``, ``bb`` - :Filename pattern: None - - -`TerminalFormatter` -------------------- - - Formats tokens with ANSI color sequences, for output in a text console. - Color sequences are terminated at newlines, so that paging the output - works correctly. - - The `get_style_defs()` method doesn't do anything special since there is - no support for common styles. - - The TerminalFormatter class supports only these options: - - `bg` - Set to ``"light"`` or ``"dark"`` depending on the terminal's background - (default: ``"light"``). - - `colorscheme` - A dictionary mapping token types to (lightbg, darkbg) color names or - ``None`` (default: ``None`` = use builtin colorscheme). - - `debug` - If this option is true, output the string "<<ERROR>>" after each error - token. This is meant as a help for debugging Pygments (default: ``False``). - - :Aliases: ``terminal``, ``console`` - :Filename pattern: None - - -`RawTokenFormatter` -------------------- - - Formats tokens as a raw representation for storing token streams. - - The format is ``tokentype<TAB>repr(tokenstring)\n``. The output can later - be converted to a token stream with the `RawTokenLexer`, described in the - `lexer list <lexers.txt>`_. - - One option is accepted: - - `compress` - If set to ``'gz'`` or ``'bz2'``, compress the output with the given - compression algorithm after encoding (default: ``''``). - - :Aliases: ``raw``, ``tokens`` - :Filename pattern: ``*.raw`` - - -`NullFormatter` ---------------- - - Just output all tokens, don't format in any way. - - :Aliases: ``text``, ``null`` - :Filename pattern: ``*.txt`` +[builtin_formatter_docs] diff --git a/docs/src/lexers.txt b/docs/src/lexers.txt index 262f92f2..2727f8ca 100644 --- a/docs/src/lexers.txt +++ b/docs/src/lexers.txt @@ -33,820 +33,7 @@ Currently, **all lexers** support these options: These lexers are builtin and can be imported from `pygments.lexers`: - -Special lexers -============== - -`TextLexer` - - "Null" lexer, doesn't highlight anything. - - :Aliases: ``text`` - :Filename patterns: ``*.txt`` - :Mimetypes: ``text/plain`` - - -`RawTokenLexer` - - Recreates a token stream formatted with the `RawTokenFormatter`. - - Additional option: - - `compress` - If set to ``'gz'`` or ``'bz2'``, decompress the token stream with - the given compression algorithm before lexing (default: ''). - - :Aliases: ``raw`` - :Filename patterns: ``*.raw`` - :Mimetypes: ``application/x-pygments/tokens`` - - -Agile languages -=============== - -`PythonLexer` - - For `Python <http://www.python.org>`_ source code. - - :Aliases: ``python``, ``py`` - :Filename patterns: ``*.py``, ``*.pyw`` - :Mimetypes: ``text/x-python``, ``application/x-python`` - - -`PythonConsoleLexer` - - For Python console output or doctests, such as: - - .. sourcecode:: pycon - - >>> a = 'foo' - >>> print a - foo - >>> 1 / 0 - Traceback (most recent call last): - File "<stdin>", line 1, in <module> - ZeroDivisionError: integer division or modulo by zero - - :Aliases: ``pycon`` - :Filename patterns: None - :Mimetypes: None - - -`PythonTracebackLexer` - - For Python tracebacks. - - *New in Pygments 0.7.* - - :Aliases: ``pytb`` - :Filename patterns: ``*.pytb`` - :Mimetypes: ``application/x-python-traceback`` - - -`RubyLexer` - - For `Ruby <http://www.ruby-lang.org>`_ source code. - - :Aliases: ``ruby``, ``rb`` - :Filename patterns: ``*.rb`` - :Mimetypes: ``text/x-ruby``, ``application/x-ruby`` - - -`RubyConsoleLexer` - - For Ruby interactive console (**irb**) output like: - - .. sourcecode:: rbcon - - irb(main):001:0> a = 1 - => 1 - irb(main):002:0> puts a - 1 - => nil - - :Aliases: ``rbcon``, ``irb`` - :Filename patterns: None - :Mimetypes: None - - -`PerlLexer` - - For `Perl <http://www.perl.org>`_ source code. - - :Aliases: ``perl``, ``pl`` - :Filename patterns: ``*.pl``, ``*.pm`` - :Mimetypes: ``text/x-perl``, ``application/x-perl`` - - -`LuaLexer` - - For `Lua <http://www.lua.org>`_ source code. - - Additional options: - - `func_name_highlighting` - If given and ``True``, highlight builtin function names - (default: ``True``). - `disabled_modules` - If given, must be a list of module names whose function names - should not be highlighted. By default all modules are highlighted. - - To get a list of allowed modules have a look into the - `_luabuiltins` module: - - .. sourcecode:: pycon - - >>> from pygments.lexers._luabuiltins import MODULES - >>> MODULES.keys() - ['string', 'coroutine', 'modules', 'io', 'basic', ...] - - :Aliases: ``lua`` - :Filename patterns: ``*.lua`` - :Mimetypes: ``text/x-lua``, ``application/x-lua`` - - -`SchemeLexer` - - For Scheme source code. It supports the whole R5RS specification. - - *New in Pygments 0.6.* - - :Aliases: ``scheme`` - :Filename patterns: ``*.scm`` - :Mimetypes: ``text/x-scheme``, ``application/x-scheme`` - - -Compiled languages -================== - -`CLexer` - - For C source code with preprocessor directives. - - :Aliases: ``c`` - :Filename patterns: ``*.c``, ``*.h`` - :Mimetypes: ``text/x-chdr``, ``text/x-csrc`` - - -`CppLexer` - - For C++ source code with preprocessor directives. - - :Aliases: ``cpp``, ``c++`` - :Filename patterns: ``*.cpp``, ``*.hpp``, ``*.c++``, ``*.h++`` - :Mimetypes: ``text/x-c++hdr``, ``text/x-c++src`` - - -`DelphiLexer` - - For `Delphi <http://www.borland.com/delphi/>`_ - (Borland Object Pascal) source code. - - :Aliases: ``delphi``, ``pas``, ``pascal``, ``objectpascal`` - :Filename patterns: ``*.pas`` - :Mimetypes: ``text/x-pascal`` - - -`JavaLexer` - - For `Java <http://www.sun.com/java/>`_ source code. - - :Aliases: ``java`` - :Filename patterns: ``*.java`` - :Mimetypes: ``text/x-java`` - - -.NET languages -============== - -`CSharpLexer` - - For `C# <http://msdn2.microsoft.com/en-us/vcsharp/default.aspx>`_ - source code. - - :Aliases: ``c#``, ``csharp`` - :Filename patterns: ``*.cs`` - :Mimetypes: ``text/x-csharp`` - - -`BooLexer` - - For `Boo <http://boo.codehaus.org/>`_ source code. - - :Aliases: ``boo`` - :Filename patterns: ``*.boo`` - :Mimetypes: ``text/x-boo`` - - -`VbNetLexer` - - For - `Visual Basic.NET <http://msdn2.microsoft.com/en-us/vbasic/default.aspx>`_ - source code. - - :Aliases: ``vbnet``, ``vb.net`` - :Filename patterns: ``*.vb``, ``*.bas`` - :Mimetypes: ``text/x-vbnet``, ``text/x-vba`` - - -Web-related languages -===================== - -`JavascriptLexer` - - For JavaScript source code. - - :Aliases: ``js``, ``javascript`` - :Filename patterns: ``*.js`` - :Mimetypes: ``text/x-javascript``, ``application/x-javascript``, ``text/javascript`` - - -`CssLexer` - - For CSS (Cascading Style Sheets). - - :Aliases: ``css`` - :Filename patterns: ``*.css`` - :Mimetypes: ``text/css`` - - -`HtmlLexer` - - For HTML 4 and XHTML 1 markup. Nested JavaScript and CSS is highlighted - by the appropriate lexer. - - :Aliases: ``html`` - :Filename patterns: ``*.html``, ``*.htm``, ``*.xhtml`` - :Mimetypes: ``text/html``, ``application/xhtml+xml`` - - -`PhpLexer` - - For `PHP <http://www.php.net/>`_ source code. - For PHP embedded in HTML, use the `HtmlPhpLexer`. - - Additional options: - - `startinline` - If given and ``True`` the lexer starts highlighting with - php code. (i.e.: no starting ``<?php`` required) - `funcnamehighlighting` - If given and ``True``, highlight builtin function names - (default: ``True``). - `disabledmodules` - If given, must be a list of module names whose function names - should not be highlighted. By default all modules are highlighted - except the special ``'unknown'`` module that includes functions - that are known to php but are undocumented. - - To get a list of allowed modules have a look into the - `_phpbuiltins` module: - - .. sourcecode:: pycon - - >>> from pygments.lexers._phpbuiltins import MODULES - >>> MODULES.keys() - ['PHP Options/Info', 'Zip', 'dba', ...] - - In fact the names of those modules match the module names from - the php documentation. - - :Aliases: ``php``, ``php3``, ``php4``, ``php5`` - :Filename patterns: ``*.php``, ``*.php[345]`` - :Mimetypes: None - - -`XmlLexer` - - Generic lexer for XML (extensible markup language). - - :Aliases: ``xml`` - :Filename patterns: ``*.xml`` - :Mimetypes: ``text/xml``, ``application/xml``, ``image/svg+xml``, - ``application/rss+xml``, ``application/atom+xml``, - ``application/xsl+xml``, ``application/xslt+xml`` - - -Template languages -================== - -`ErbLexer` - - Generic `ERB <http://ruby-doc.org/core/classes/ERB.html>`_ (Ruby Templating) - lexer. - - Just highlights ruby code between the preprocessor directives, other data - is left untouched by the lexer. - - All options are also forwarded to the `RubyLexer`. - - :Aliases: ``erb`` - :Filename patterns: None - :Mimetypes: None - - -`RhtmlLexer` - - Subclass of the ERB lexer that highlights the unlexed data with the - html lexer. - - Nested Javascript and CSS is highlighted too. - - :Aliases: ``rhtml``, ``html+erb``, ``html+ruby`` - :Filename patterns: ``*.rhtml`` - :Mimetypes: None - - -`XmlErbLexer` - - Subclass of `ErbLexer` which highlights data outside preprocessor - directives with the `XmlLexer`. - - :Aliases: ``xml+erb``, ``xml+ruby`` - :Filename patterns: None - :Mimetypes: None - - -`CssErbLexer` - - Subclass of `ErbLexer` which highlights unlexed data with the `CssLexer`. - - :Aliases: ``css+erb``, ``css+ruby`` - :Filename patterns: None - :Mimetypes: None - - -`JavascriptErbLexer` - - Subclass of `ErbLexer` which highlights unlexed data with the - `JavascriptLexer`. - - :Aliases: ``js+erb``, ``javascript+erb``, ``js+ruby``, ``javascript+ruby`` - :Filename patterns: None - :Mimetypes: None - - -`HtmlPhpLexer` - - Subclass of `PhpLexer` that highlights unhandled data with the `HtmlLexer`. - - Nested Javascript and CSS is highlighted too. - - :Aliases: ``html+php`` - :Filename patterns: ``*.phtml`` - :Mimetypes: ``text/x-php``, ``application/x-php``, - ``application/x-httpd-php``, ``application/x-httpd-php3``, - ``application/x-httpd-php4``, ``application/x-httpd-php5`` - - -`XmlPhpLexer` - - Subclass of `PhpLexer` that higlights unhandled data with the `XmlLexer`. - - :Aliases: ``xml+php`` - :Filename patterns: None - :Mimetypes: None - - -`CssPhpLexer` - - Subclass of `PhpLexer` which highlights unmatched data with the `CssLexer`. - - :Aliases: ``css+php`` - :Filename patterns: None - :Mimetypes: None - - -`JavascriptPhpLexer` - - Subclass of `PhpLexer` which highlights unmatched data with the - `JavascriptLexer`. - - :Aliases: ``js+php``, ``javascript+php`` - :Filename patterns: None - :Mimetypes: None - - -`DjangoLexer` - - Generic `django <http://www.djangoproject.com/documentation/templates/>`_ - and `jinja <http://wsgiarea.pocoo.org/jinja/>`_ template lexer. - - It just highlights django/jinja code between the preprocessor directives, - other data is left untouched by the lexer. - - :Aliases: ``django``, ``jinja`` - :Filename patterns: None - :Mimetypes: None - - -`HtmlDjangoLexer` - - Subclass of the `DjangoLexer` that highighlights unlexed data with the - `HtmlLexer`. - - Nested Javascript and CSS is highlighted too. - - :Aliases: ``html+django``, ``html+jinja`` - :Filename patterns: None - :Mimetypes: None - - -`XmlDjangoLexer` - - Subclass of the `DjangoLexer` that highlights unlexed data with the - `XmlLexer`. - - :Aliases: ``xml+django``, ``xml+jinja`` - :Filename patterns: None - :Mimetypes: None - - -`CssDjangoLexer` - - Subclass of the `DjangoLexer` that highlights unlexed data with the - `CssLexer`. - - :Aliases: ``css+django``, ``css+jinja`` - :Filename patterns: None - :Mimetypes: None - - -`JavascriptDjangoLexer` - - Subclass of the `DjangoLexer` that highlights unlexed data with the - `JavascriptLexer`. - - :Aliases: ``javascript+django``, ``js+django``, - ``javascript+jinja``, ``js+jinja`` - :Filename patterns: None - :Mimetypes: None - - -`SmartyLexer` - - Generic `Smarty <http://smarty.php.net/>`_ template lexer. - - Just highlights smarty code between the preprocessor directives, other - data is left untouched by the lexer. - - :Aliases: ``smarty`` - :Filename patterns: None - :Mimetypes: None - - -`HtmlSmartyLexer` - - Subclass of the `SmartyLexer` that highighlights unlexed data with the - `HtmlLexer`. - - Nested Javascript and CSS is highlighted too. - - :Aliases: ``html+smarty`` - :Filename patterns: None - :Mimetypes: None - - -`XmlSmartyLexer` - - Subclass of the `SmartyLexer` that highlights unlexed data with the - `XmlLexer`. - - :Aliases: ``xml+smarty`` - :Filename patterns: None - :Mimetypes: None - - -`CssSmartyLexer` - - Subclass of the `SmartyLexer` that highlights unlexed data with the - `CssLexer`. - - :Aliases: ``css+smarty`` - :Filename patterns: None - :Mimetypes: None - - -`JavascriptSmartyLexer` - - Subclass of the `SmartyLexer` that highlights unlexed data with the - `JavascriptLexer`. - - :Aliases: ``javascript+smarty`` - :Filename patterns: None - :Mimetypes: None - - -`GenshiTextLexer` - - A lexer that highlights `genshi <http://genshi.edgewall.org/>`_ text - templates. - - :Aliases: ``genshitext`` - :Filename patterns: None - :Mimetypes: None - - -`HtmlGenshiLexer` - - A lexer that highlights `genshi <http://genshi.edgewall.org/>`_ and - `kid <http://kid-templating.org/>`_ kid HTML templates. - - :Aliases: ``html+genshi``, ``html+kid`` - :Filename patterns: None - :Mimetypes: None - - -`GenshiLexer` - - A lexer that highlights `genshi <http://genshi.edgewall.org/>`_ and - `kid <http://kid-templating.org/>`_ kid XML templates. - - :Aliases: ``genshi``, ``kid``, ``xml+genshi``, ``xml.kid`` - :Filename patterns: ``*.kid`` - :Mimetypes: None - - -`JavascriptGenshiLexer` - - A lexer that highlights javascript code in genshi text templates. - - :Aliases: ``js+genshitext``, ``js+genshi``, ``javascript+genshitext``, - ``javascript+genshi`` - :Filename patterns: None - :Mimetypes: None - - -`CssGenshiLexer` - - A lexer that highlights CSS definitions in genshi text templates. - - :Aliases: ``css+genshitext``, ``css+genshi`` - :Filename patterns: None - :Mimetypes: None - - -`MyghtyLexer` - - Generic `myghty templates`_ lexer. Code that isn't Myghty - markup is yielded as `Token.Other`. - - *New in Pygments 0.6.* - - .. _myghty templates: http://www.myghty.org/ - - :Aliases: ``myghty`` - :Filename patterns: ``*.myt``, ``autodelegate`` - :Mimetypes: None - - -`MyghtyHtmlLexer` - - Subclass of the `MyghtyLexer` that highlights unlexer data - with the `HtmlLexer`. - - *New in Pygments 0.6.* - - :Aliases: ``html+myghty`` - :Filename patterns: None - :Mimetypes: None - - -`MyghtyXmlLexer` - - Subclass of the `MyghtyLexer` that highlights unlexer data - with the `XmlLexer`. - - *New in Pygments 0.6.* - - :Aliases: ``xml+myghty`` - :Filename patterns: None - :Mimetypes: None - - -`MyghtyJavascriptLexer` - - Subclass of the `MyghtyLexer` that highlights unlexer data - with the `JavascriptLexer`. - - *New in Pygments 0.6.* - - :Aliases: ``js+myghty``, ``javascript+myghty`` - :Filename patterns: None - :Mimetypes: None - - -`MyghtyCssLexer` - - Subclass of the `MyghtyLexer` that highlights unlexer data - with the `CssLexer`. - - *New in Pygments 0.6.* - - :Aliases: ``css+myghty`` - :Filename patterns: None - :Mimetypes: None - - -`MakoLexer` - - Generic `mako templates`_ lexer. Code that isn't Mako - markup is yielded as `Token.Other`. - - *New in Pygments 0.7.* - - .. _mako templates: http://www.makotemplates.org/ - - :Aliases: ``mako`` - :Filename patterns: ``*.mao`` - :Mimetypes: None - - -`MakoHtmlLexer` - - Subclass of the `MakoLexer` that highlights unlexer data - with the `HtmlLexer`. - - *New in Pygments 0.7.* - - :Aliases: ``html+mako`` - :Filename patterns: None - :Mimetypes: None - - -`MakoXmlLexer` - - Subclass of the `MakoLexer` that highlights unlexer data - with the `XmlLexer`. - - *New in Pygments 0.7.* - - :Aliases: ``xml+mako`` - :Filename patterns: None - :Mimetypes: None - - -`MakoJavascriptLexer` - - Subclass of the `MakoLexer` that highlights unlexer data - with the `JavascriptLexer`. - - *New in Pygments 0.7.* - - :Aliases: ``js+mako``, ``javascript+mako`` - :Filename patterns: None - :Mimetypes: None - - -`MakoCssLexer` - - Subclass of the `MakoLexer` that highlights unlexer data - with the `CssLexer`. - - *New in Pygments 0.7.* - - :Aliases: ``css+mako`` - :Filename patterns: None - :Mimetypes: None - - -Other languages -=============== - -`SqlLexer` - - Lexer for Structured Query Language. Currently, this lexer does - not recognize any special syntax except ANSI SQL. - - :Aliases: ``sql`` - :Filename patterns: ``*.sql`` - :Mimetypes: ``text/x-sql`` - - -`BrainfuckLexer` - - Lexer for the esoteric `BrainFuck <http://www.muppetlabs.com/~breadbox/bf/>`_ - language. - - :Aliases: ``brainfuck`` - :Filename patterns: ``*.bf``, ``*.b`` - :Mimetypes: None - - -`BashLexer` - - Lexer for (ba)sh shell scripts. - - *New in Pygments 0.6.* - - :Aliases: ``bash``, ``sh`` - :Filename patterns: ``*.sh`` - :Mimetypes: ``application/x-sh``, ``application/x-shellscript`` - - -Text lexers -=========== - -`IniLexer` - - Lexer for configuration files in INI style. - - :Aliases: ``ini``, ``cfg`` - :Filename patterns: ``*.ini``, ``*.cfg`` - :Mimetypes: None - - -`MakefileLexer` - - Lexer for Makefiles. - - :Aliases: ``make``, ``makefile``, ``mf`` - :Filename patterns: ``*.mak``, ``Makefile``, ``makefile`` - :Mimetypes: ``text/x-makefile`` - - -`DiffLexer` - - Lexer for unified or context-style diffs. - - :Aliases: ``diff`` - :Filename patterns: ``*.diff``, ``*.patch`` - :Mimetypes: ``text/x-diff``, ``text/x-patch`` - - -`IrcLogsLexer` - - Lexer for IRC logs in **irssi** or **xchat** style. - - :Aliases: ``irc`` - :Filename patterns: None - :Mimetypes: None - - -`TexLexer` - - Lexer for the TeX and LaTeX typesetting languages. - - :Aliases: ``tex``, ``latex`` - :Filename patterns: ``*.tex``, ``*.aux``, ``*.toc`` - :Mimetypes: ``text/x-tex``, ``text/x-latex`` - - -`GroffLexer` - - Lexer for the (g)roff typesetting language, supporting groff - extensions. Mainly useful for highlighting manpage sources. - - *New in Pygments 0.6.* - - :Aliases: ``groff``, ``nroff``, ``man`` - :Filename patterns: ``*.[1234567]``, ``*.man`` - :Mimetypes: ``text/troff``, ``application/x-troff`` - - -`ApacheConfLexer` - - Lexer for configuration files following the Apache config file - format. - - *New in Pygments 0.6.* - - :Aliases: ``apacheconf``, ``aconf``, ``apache`` - :Filename patterns: ``.htaccess``, ``apache.conf``, ``apache2.conf`` - :Mimetypes: None - - -`SourcesListLexer` - - Lexer that highlights debian sources.list files. - - *New in Pygments 0.7.* - - :Aliases: ``sources.list``, ``sourceslist`` - :Filename patterns: ``sources.list`` - :Mimetypes: None - - -`BBCodeLexer` - - A Lexer that highlights BBCode(-like) syntax. - - *New in Pygments 0.6.* - - :Aliases: ``bbcode`` - :Filename patterns: None - :Mimetypes: None - - -`MoinWikiLexer` - - For MoinMoin (and Trac) Wiki markup. - - *New in Pygments 0.7.* - - :Aliases: ``moin``, ``trac-wiki`` - :Filename patterns: None - :Mimetypes: ``text/x-trac-wiki`` +[builtin_lexer_docs] Iterating over all lexers |