Pygments lexers.
copyright: | Copyright 2006-2013 by the Pygments team, see AUTHORS. |
---|---|
license: | BSD, see LICENSE for details. |
Get a lexer for a filename. If multiple lexers match the filename pattern, use analyze_text() to figure out which one is more appropriate.
Lookup a lexer class by name. Return None if not found.
Guess a lexer by strong distinctions in the text (eg, shebang).
Lexer that highlights debian sources.list files.
New in Pygments 0.7.
For Delphi (Borland Object Pascal), Turbo Pascal and Free Pascal source code.
Additional options accepted:
Subclass of the MakoLexer that highlights unlexer data with the JavascriptLexer.
New in Pygments 0.7.
For Elixir interactive console (iex) output like:
iex> [head | tail] = [1,2,3]
[1,2,3]
iex> head
1
iex> tail
[2,3]
iex> [head | tail]
[1,2,3]
iex> length [head | tail]
3
New in Pygments 1.5.
Lexer for psql sessions.
New in Pygments 1.5.
Subclass of the DjangoLexer that highlights unlexed data with the JavascriptLexer.
Subclass of the EvoqueLexer that highlights unlexed data with the HtmlLexer.
New in Pygments 1.1.
A Python lexer recognizing Numerical Python builtins.
New in Pygments 0.10.
For Modula-2 source code.
Additional options that determine which keywords are highlighted:
New in Pygments 1.3.
For LiveScript source code.
New in Pygments 1.6.
Lexer for (ba|k|)sh shell scripts.
New in Pygments 0.6.
Subclass of the DjangoLexer that highighlights unlexed data with the HtmlLexer.
Nested Javascript and CSS is highlighted too.
Subclass of PhpLexer which highlights unmatched data with the CssLexer.
Subclass of the LassoLexer which highlights unhandled data with the XmlLexer.
New in Pygments 1.6.
Lexer for VimL script files.
New in Pygments 0.8.
It’s kind of difficult to decide if something might be a keyword in VimL because it allows you to abbreviate them. In fact, ‘ab[breviate]’ is a good example. :ab, :abbre, or :abbreviate are valid ways to call it so rather than making really awful regexps like:
\bab(?:b(?:r(?:e(?:v(?:i(?:a(?:t(?:e)?)?)?)?)?)?)?)?\b
we match bw+b and then call is_in() on those tokens. See scripts/get_vimkw.py for how the lists are extracted.
A lexer that highlights CSS definitions in genshi text templates.
Pygments Lexer For Fancy.
Fancy is a self-hosted, pure object-oriented, dynamic, class-based, concurrent general-purpose programming language running on Rubinius, the Ruby VM.
New in Pygments 1.5.
Coldfusion markup in html
Coldfusion statements
Lexer for Scalate Server Pages.
New in Pygments 1.4.
Generic Smarty template lexer.
Just highlights smarty code between the preprocessor directives, other data is left untouched by the lexer.
Subclass of the EvoqueLexer that highlights unlexed data with the XmlLexer.
New in Pygments 1.1.
For haXe source code (http://haxe.org/).
New in Pygments 1.3.
For Windows PowerShell code.
New in Pygments 1.5.
Lexer for Tea Templates.
New in Pygments 1.5.
Subclass of the CheetahLexer that highlights unlexer data with the HtmlLexer.
For Ruby interactive console (irb) output like:
irb(main):001:0> a = 1
=> 1
irb(main):002:0> puts a
1
=> nil
Generic mason templates lexer. Stolen from Myghty lexer. Code that isn’t Mason markup is HTML.
New in Pygments 1.4.
Generic django and jinja template lexer.
It just highlights django/jinja code between the preprocessor directives, other data is left untouched by the lexer.
Pygments Lexer for JAGS.
New in Pygments 1.6.
Lexer for configuration files following the Apache config file format.
New in Pygments 0.6.
A lexer for DTDs (Document Type Definitions).
New in Pygments 1.5.
For Dylan interactive console output like:
? let a = 1;
=> 1
? a
=> 1
This is based on a copy of the RubyConsoleLexer.
New in Pygments 1.6.
Lexer for Lighttpd configuration files.
New in Pygments 0.11.
A lexer that highlights javascript code in genshi text templates.
A Scheme lexer, parsing a stream and outputting the tokens needed to highlight scheme code. This lexer could be most probably easily subclassed to parse other LISP-Dialects like Common Lisp, Emacs Lisp or AutoLisp.
This parser is checked with pastes from the LISP pastebin at http://paste.lisp.org/ to cover as much syntax as possible.
It supports the full Scheme syntax as defined in R5RS.
New in Pygments 0.6.
For Nemerle source code.
Additional options accepted:
Determines which Unicode characters this lexer allows for identifiers. The possible values are:
The default value is basic.
New in Pygments 1.5.
Subclass of the ERB lexer that highlights the unlexed data with the html lexer.
Nested Javascript and CSS is highlighted too.
A lexer for Ragel in a Java host file.
New in Pygments 1.1.
DarcsPatchLexer is a lexer for the various versions of the darcs patch format. Examples of this format are derived by commands such as darcs annotate --patch and darcs send.
New in Pygments 0.10.
For GNU Octave source code.
New in Pygments 1.5.
For CoffeeScript source code.
New in Pygments 1.3.
A lexer for Ragel in a D host file.
New in Pygments 1.1.
For Scilab source code.
New in Pygments 1.5.
Subclass of the MyghtyLexer that highlights unlexer data with the HtmlLexer.
New in Pygments 0.6.
Shell sessions in erl (for Erlang code).
New in Pygments 1.1.
For CSS (Cascading Style Sheets).
Subclass of the SmartyLexer that highlights unlexed data with the JavascriptLexer.
For Io (a small, prototype-based programming language) source.
New in Pygments 0.10.
Lexer for Free format OpenCOBOL code.
New in Pygments 1.6.
For VHDL source code.
New in Pygments 1.5.
For Python source code (version 3.0).
New in Pygments 0.10.
Subclass of ErbLexer which highlights unlexed data with the CssLexer.
Lexer for FORTRAN 90 code.
New in Pygments 0.10.
For the output of ‘objdump -Sr on compiled D files’
Special lexer for MySQL.
For C++ source code with preprocessor directives.
Generic ERB (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.
Since ERB doesn’t allow “<%” and other tags inside of ruby blocks we have to use a split approach here that fails for that too.
For CBM BASIC V2 sources.
New in Pygments 1.6.
Lexer for the esoteric Befunge language.
New in Pygments 0.7.
For MoonScript source code.
New in Pygments 1.5.
Subclass of the SmartyLexer that highlights unlexed data with the XmlLexer.
For MoinMoin (and Trac) Wiki markup.
New in Pygments 0.7.
For autohotkey source code.
New in Pygments 1.4.
For C source code with preprocessor directives.
For HTML 4 and XHTML 1 markup. Nested JavaScript and CSS is highlighted by the appropriate lexer.
For SourcePawn source code with preprocessor directives.
New in Pygments 1.6.
Generic mako templates lexer. Code that isn’t Mako markup is yielded as Token.Other.
New in Pygments 0.7.
For SampleManager VGL source code.
New in Pygments 1.6.
Generic Velocity template lexer.
Just highlights velocity directives and variable references, other data is left untouched by the lexer.
Lexer for IRC logs in irssi, xchat or weechat style.
Lexer for Prolog files.
Subclass of the DjangoLexer that highlights unlexed data with the CssLexer.
For verilog source code with preprocessor directives.
New in Pygments 1.4.
For Smalltalk syntax. Contributed by Stefan Matthias Aust. Rewritten by Nils Winter.
New in Pygments 0.10.
Subclass of the MyghtyLexer that highlights unlexer data with the JavascriptLexer.
New in Pygments 0.6.
Lexer for YAML, a human-friendly data serialization language.
New in Pygments 0.11.
Process an empty line in a block scalar.
Process indentation spaces in a block scalar.
Process indentation spaces in a plain scalar.
Reset the indentation levels.
Save a possible indentation level.
Set an explicit indentation level for a block scalar.
Set the previously saved indentation level.
Do not produce empty tokens.
ANTLR with ActionScript Target
New in Pygments 1.1.
Subclass of the MakoLexer that highlights unlexer data with the XmlLexer.
New in Pygments 0.7.
A lexer for XSLT.
New in Pygments 0.10.
For UrbiScript source code.
New in Pygments 1.5.
For Scaml markup. Scaml is Haml for Scala.
New in Pygments 1.4.
For S, S-plus, and R source code.
New in Pygments 0.10.
For Dylan LID (Library Interchange Definition) files.
New in Pygments 1.6.
Lexer for GoodData MAQL scripts.
New in Pygments 1.4.
Lexer for example sessions using sqlite3.
New in Pygments 0.11.
For the OCaml language.
New in Pygments 0.7.
For eC source code with preprocessor directives.
New in Pygments 1.5.
For ActionScript source code.
New in Pygments 0.9.
For Visual Basic.NET source code.
Lexer for squid configuration files.
New in Pygments 0.9.
An XQuery lexer, parsing a stream and outputting the tokens needed to highlight xquery code.
New in Pygments 1.4.
For D source.
New in Pygments 1.2.
For Fantom source code.
New in Pygments 1.5.
Lexer for Gettext catalog files.
New in Pygments 0.9.
For Logos + Objective-C source code with preprocessor directives.
New in Pygments 1.6.
For Julia console sessions. Modeled after MatlabSessionLexer.
New in Pygments 1.6.
For Lasso source code, covering both Lasso 9 syntax and LassoScript for Lasso 8.6 and earlier. For Lasso embedded in HTML, use the LassoHtmlLexer.
Additional options accepted:
New in Pygments 1.6.
For SCSS stylesheets.
A lexer that highlights BBCode(-like) syntax.
New in Pygments 0.6.
For Haml markup.
New in Pygments 1.3.
Lexer for Microsoft Visual FoxPro language.
FoxPro syntax allows to shorten all keywords and function names to 4 characters. Shortened forms are not recognized by this lexer.
New in Pygments 1.6.
For Python 3.0 tracebacks, with support for chained exceptions.
New in Pygments 1.0.
A MuPAD lexer. Contributed by Christopher Creutzig <christopher@creutzig.de>.
New in Pygments 0.8.
Subclass of ErbLexer which highlights data outside preprocessor directives with the XmlLexer.
Pygments Lexer for IDL (Interactive Data Language).
New in Pygments 1.6.
Lexer for dg, a functional and object-oriented programming language running on the CPython 3 VM.
New in Pygments 1.6.
For files using the Evoque templating system.
New in Pygments 1.1.
For Jade markup. Jade is a variant of Scaml, see: http://scalate.fusesource.org/documentation/scaml-reference.html
New in Pygments 1.4.
For the output of ‘objdump -Sr on compiled C files’
For Linux-style Kconfig files.
New in Pygments 1.6.
Lexer for Java Server Pages.
New in Pygments 0.7.
Lexer for Windows Registry files produced by regedit.
New in Pygments 1.6.
Lexer for ABAP, SAP’s integrated language.
New in Pygments 1.1.
Subclass of the VelocityLexer that highlights unlexer data with the XmlLexer.
Subclass of the CheetahLexer that highlights unlexer data with the JavascriptLexer.
Subclass of the MakoLexer that highlights unlexed data with the HtmlLexer.
New in Pygments 0.7.
A lexer for Ragel in a Ruby host file.
New in Pygments 1.1.
For Robot Framework test data.
Supports both space and pipe separated plain text formats.
New in Pygments 1.6.
Lexer for Protocol Buffer definition files.
New in Pygments 1.4.
Lexer for CFEngine3 policy files.
New in Pygments 1.5.
A pure Ragel lexer. Use this for fragments of Ragel. For .rl files, use RagelEmbeddedLexer instead (or one of the language-specific subclasses).
New in Pygments 1.1.
GLSL (OpenGL Shader) lexer.
New in Pygments 1.1.
Lexer for OpenCOBOL code.
New in Pygments 1.6.
For TypeScript source code.
New in Pygments 1.6.
For Ada source code.
New in Pygments 1.3.
Lexer for the PostgreSQL dialect of SQL.
New in Pygments 1.5.
For the output of ‘objdump -dr’
Subclass of the MakoLexer that highlights unlexer data with the CssLexer.
New in Pygments 0.7.
For ca65 assembler sources.
New in Pygments 1.6.
For Objective-C++ source code with preprocessor directives.
For Gherkin <http://github.com/aslakhellesoy/gherkin/> syntax.
New in Pygments 1.2.
Subclass of PhpLexer that highlights unhandled data with the HtmlLexer.
Nested Javascript and CSS is highlighted too.
Lexer for BSD and GNU make extensions (lenient enough to handle both in the same file even).
Rewritten in Pygments 0.10.
Lexer for PostScript files.
The PostScript Language Reference published by Adobe at <http://partners.adobe.com/public/developer/en/ps/PLRM.pdf> is the authority for this.
New in Pygments 1.4.
Lexer for haXe build files.
New in Pygments 1.6.
For Kotlin source code.
Additional options accepted:
Determines which Unicode characters this lexer allows for identifiers. The possible values are:
The default value is basic.
New in Pygments 1.5.
Handle the extra syntax in Pl/pgSQL language.
New in Pygments 1.5.
For Vala source code with preprocessor directives.
New in Pygments 1.1.
A Haskell lexer based on the lexemes defined in the Haskell 98 Report.
New in Pygments 0.8.
For Lua source code.
Additional options accepted:
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:
>>> from pygments.lexers._luabuiltins import MODULES
>>> MODULES.keys()
['string', 'coroutine', 'modules', 'io', 'basic', ...]
For Persistence of Vision Raytracer files.
New in Pygments 0.11.
For Sass stylesheets.
New in Pygments 1.3.
For Tcl source code.
New in Pygments 0.10.
ANTLR with Objective-C Target
New in Pygments 1.1.
Subclass of ErbLexer which highlights unlexed data with the JavascriptLexer.
Lexer for Racket source code (formerly known as PLT Scheme).
New in Pygments 1.6.
Lexer for simple Makefiles (no preprocessing).
New in Pygments 0.10.
For the output of ‘objdump -Sr on compiled C++ files’
For Ioke (a strongly typed, dynamic, prototype based programming language) source.
New in Pygments 1.4.
Lexer for PyPy log files.
New in Pygments 1.5.
For Objective-J source code with preprocessor directives.
New in Pygments 1.3.
For Gas (AT&T) assembly code.
Lexer for the DOS/Windows Batch file format.
New in Pygments 0.7.
Lexer for the SNOBOL4 programming language.
Recognizes the common ASCII equivalents of the original SNOBOL4 operators. Does not require spaces around binary operators.
New in Pygments 1.5.
For Python console output or doctests, such as:
>>> 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
Additional options:
Generic lexer for XML (eXtensible Markup Language).
Generic ANTLR Lexer. Should not be called directly, instead use DelegatingLexer for your target language.
New in Pygments 1.1.
Lexer for the Opa language (http://opalang.org).
New in Pygments 1.5.
Subclass of the CheetahLexer that highlights unlexer data with the XmlLexer.
Lexer for unified or context-style diffs or patches.
For MiniD source. MiniD is now known as Croc.
For Pyrex and Cython source code.
New in Pygments 1.1.
A lexer for Ragel in a C host file.
New in Pygments 1.1.
For the Erlang functional programming language.
Blame Jeremy Thurgood (http://jerith.za.net/).
New in Pygments 0.9.
Lexer for Debian control files and apt-cache show <pkg> outputs.
New in Pygments 0.9.
Lexer for highligting Visual Basic.net within ASP.NET pages.
Pygments Lexer for OpenBugs and WinBugs models.
New in Pygments 1.6.
A lexer for Ragel in a CPP host file.
New in Pygments 1.1.
Lexer for highligting C# within ASP.NET pages.
For Matlab sessions. Modeled after PythonConsoleLexer. Contributed by Ken Schutte <kschutte@csail.mit.edu>.
New in Pygments 0.10.
Lexer for configuration files in Java’s properties format.
New in Pygments 1.4.
Lexer for the (g)roff typesetting language, supporting groff extensions. Mainly useful for highlighting manpage sources.
New in Pygments 0.6.
For QML files. See http://doc.qt.digia.com/4.7/qdeclarativeintroduction.html.
New in Pygments 1.6.
Subclass of the LassoLexer which highlights unhandled data with the JavascriptLexer.
New in Pygments 1.6.
For Matlab source code.
New in Pygments 0.10.
Generic myghty templates lexer. Code that isn’t Myghty markup is yielded as Token.Other.
New in Pygments 0.6.
Lexer for Duel Views Engine (formerly JBST) markup with JavaScript code blocks. See http://duelengine.org/. See http://jsonml.org/jbst/.
New in Pygments 1.4.
For the F# language.
New in Pygments 1.5.
For reStructuredText markup.
New in Pygments 0.7.
Additional options accepted:
For newLISP. source code (version 10.3.0).
New in Pygments 1.5.
Subclass of the LassoLexer which highlights unhandled data with the CssLexer.
New in Pygments 1.6.
Subclass of PhpLexer that higlights unhandled data with the XmlLexer.
Pygments Lexer for Stan models.
New in Pygments 1.6.
Lexer for configuration files in INI style.
For MOOCode (the MOO scripting language).
New in Pygments 0.9.
Lexer for shell sessions that works with different command prompts
New in Pygments 1.6.
For Newspeak <http://newspeaklanguage.org/> syntax.
Lexer for simplistic shell sessions.
New in Pygments 1.1.
Recreate a token stream formatted with the RawTokenFormatter. This lexer raises exceptions during parsing if the token stream in the file is malformed.
Additional options accepted:
Lexer for tcsh scripts.
New in Pygments 0.10.
Subclass of the LassoLexer which highlights unhandled data with the HtmlLexer.
Nested JavaScript and CSS is also highlighted.
New in Pygments 1.6.
For C# source code.
Additional options accepted:
Determines which Unicode characters this lexer allows for identifiers. The possible values are:
The default value is basic.
New in Pygments 0.8.
For Gosu templates.
New in Pygments 1.5.
For R console transcripts or R CMD BATCH output files.
For MXML markup. Nested AS3 in <script> tags is highlighted by the appropriate lexer.
New in Pygments 1.1.
Lexer for the TeX and LaTeX typesetting languages.
Subclass of the SmartyLexer that highlights unlexed data with the CssLexer.
“Null” lexer, doesn’t highlight anything.
Lexer for OpenEdge ABL (formerly Progress) source code.
New in Pygments 1.5.
Generic cheetah templates lexer. Code that isn’t Cheetah markup is yielded as Token.Other. This also works for spitfire templates which use the same syntax.
For Smali (Android/Dalvik) assembly code.
New in Pygments 1.6.
Subclass of the MyghtyLexer that highlights unlexer data with the CssLexer.
New in Pygments 0.6.
Pygments Lexer for R documentation (Rd) files
This is a very minimal implementation, highlighting little more than the macros. A description of Rd syntax is found in Writing R Extensions and Parsing Rd files.
New in Pygments 1.6.
For LLVM assembly code.
For the Standard ML language.
New in Pygments 1.5.
For the Elixir language.
New in Pygments 1.5.
Lexer for Nginx configuration files.
New in Pygments 0.11.
Lexer for GoodData-CL script files.
New in Pygments 1.4.
For AppleScript source code, including AppleScript Studio. Contributed by Andreas Amann <aamann@mac.com>.
Subclass of the SmartyLexer that highighlights unlexed data with the HtmlLexer.
Nested Javascript and CSS is highlighted too.
For Objective-C source code with preprocessor directives.
For JavaScript source code.
Lexer for Mozilla’s Rust programming language.
New in Pygments 1.6.
A Common Lisp lexer.
New in Pygments 0.9.
A lexer for Ragel embedded in a host language file.
This will only highlight Ragel statements. If you want host language highlighting then call the language-specific Ragel lexer.
New in Pygments 1.1.
For ActionScript 3 source code.
New in Pygments 0.11.
Extends verilog lexer to recognise all SystemVerilog keywords from IEEE 1800-2009 standard.
New in Pygments 1.5.
For Literate Haskell (Bird-style or LaTeX) source.
Additional options accepted:
New in Pygments 0.9.
For Python tracebacks.
New in Pygments 0.7.
For PHP source code. For PHP embedded in HTML, use the HtmlPhpLexer.
Additional options accepted:
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:
>>> 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.
For Gosu source code.
New in Pygments 1.5.
Subclass of PhpLexer which highlights unmatched data with the JavascriptLexer.
Subclass of the VelocityLexer that highlights unlexer data with the HtmlLexer.
Lexer for Structured Query Language. Currently, this lexer does not recognize any special syntax except ANSI SQL.
Lexer for HTTP sessions.
New in Pygments 1.5.
Lexer for the declarative big-data ECL language.
New in Pygments 1.5.
A simple Redcode lexer based on ICWS‘94. Contributed by Adam Blinkinsop <blinks@acm.org>.
New in Pygments 0.8.
A lexer for Ragel in an Objective C host file.
New in Pygments 1.1.
Subclass of the DjangoLexer that highlights unlexed data with the XmlLexer.
For Awk scripts.
New in Pygments 1.5.
For JSON data structures.
New in Pygments 1.5.
For Nasm (Intel) assembly code.
Subclass of the MyghtyLexer that highlights unlexer data with the XmlLexer.
New in Pygments 0.6.
_asybuiltins.py | _clbuiltins.py | _lassobuiltins.py | _luabuiltins.py | _mapping.py | _openedgebuiltins.py | _phpbuiltins.py | _postgres_builtins.py | _robotframeworklexer.py | _scilab_bulitins.py | _sourcemodbuiltins.py | _stan_builtins.py | _vimbuiltins.py | agile.py | asm.py | complied.py | dalvik.py | dotnet.py | foxpro.py | functional.py | hdl.py | jvm.py | math.py | other.py | parsers.py | shell.py | special.py | sql.py | templates.py | text.py | web.py