Available lexers

This page lists all available builtin lexers and the options they take.

Currently, all lexers support these options:

stripnl
Strip leading and trailing newlines from the input (default: True)
stripall
Strip all leading and trailing whitespace from the input (default: False).
ensurenl

Make sure that the input ends with a newline (default: True). This is required for some lexers that consume input linewise.

New in version 1.3.

tabsize
If given and greater than 0, expand tabs in the input (default: 0).
encoding

If given, must be an encoding name (such as "utf-8"). This encoding will be used to convert the input string to Unicode (if it is not already a Unicode string). The default is "guess".

If this option is set to "guess", a simple UTF-8 vs. Latin-1 detection is used, if it is set to "chardet", the chardet library is used to guess the encoding of the input.

New in version 0.6.

The “Short Names” field lists the identifiers that can be used with the get_lexer_by_name() function.

These lexers are builtin and can be imported from pygments.lexers:

Lexers for ActionScript and MXML

class pygments.lexers.actionscript.ActionScript3Lexer
Short names:as3, actionscript3
Filenames:*.as
MIME types:application/x-actionscript3, text/x-actionscript3, text/actionscript3

For ActionScript 3 source code.

New in version 0.11.

class pygments.lexers.actionscript.ActionScriptLexer
Short names:as, actionscript
Filenames:*.as
MIME types:application/x-actionscript, text/x-actionscript, text/actionscript

For ActionScript source code.

New in version 0.9.

class pygments.lexers.actionscript.MxmlLexer
Short names:mxml
Filenames:*.mxml
MIME types:None

For MXML markup. Nested AS3 in <script> tags is highlighted by the appropriate lexer.

New in version 1.1.

Lexers for computer algebra systems

class pygments.lexers.algebra.BCLexer
Short names:bc
Filenames:*.bc
MIME types:None

A BC lexer.

New in version 2.1.

class pygments.lexers.algebra.GAPLexer
Short names:gap
Filenames:*.g, *.gd, *.gi, *.gap
MIME types:None

For GAP source code.

New in version 2.0.

class pygments.lexers.algebra.MathematicaLexer
Short names:mathematica, mma, nb
Filenames:*.nb, *.cdf, *.nbp, *.ma
MIME types:application/mathematica, application/vnd.wolfram.mathematica, application/vnd.wolfram.mathematica.package, application/vnd.wolfram.cdf

Lexer for Mathematica source code.

New in version 2.0.

class pygments.lexers.algebra.MuPADLexer
Short names:mupad
Filenames:*.mu
MIME types:None

A MuPAD lexer. Contributed by Christopher Creutzig <christopher@creutzig.de>.

New in version 0.8.

Lexers for AmbientTalk language

class pygments.lexers.ambient.AmbientTalkLexer
Short names:at, ambienttalk, ambienttalk/2
Filenames:*.at
MIME types:text/x-ambienttalk

Lexer for AmbientTalk source code.

New in version 2.0.

Lexers for APL

class pygments.lexers.apl.APLLexer
Short names:apl
Filenames:*.apl
MIME types:None

A simple APL lexer.

New in version 2.0.

Lexers for assembly languages

class pygments.lexers.asm.CObjdumpLexer
Short names:c-objdump
Filenames:*.c-objdump
MIME types:text/x-c-objdump

For the output of ‘objdump -Sr on compiled C files’

class pygments.lexers.asm.Ca65Lexer
Short names:ca65
Filenames:*.s
MIME types:None

For ca65 assembler sources.

New in version 1.6.

class pygments.lexers.asm.CppObjdumpLexer
Short names:cpp-objdump, c++-objdumb, cxx-objdump
Filenames:*.cpp-objdump, *.c++-objdump, *.cxx-objdump
MIME types:text/x-cpp-objdump

For the output of ‘objdump -Sr on compiled C++ files’

class pygments.lexers.asm.DObjdumpLexer
Short names:d-objdump
Filenames:*.d-objdump
MIME types:text/x-d-objdump

For the output of ‘objdump -Sr on compiled D files’

class pygments.lexers.asm.GasLexer
Short names:gas, asm
Filenames:*.s, *.S
MIME types:text/x-gas

For Gas (AT&T) assembly code.

class pygments.lexers.asm.LlvmLexer
Short names:llvm
Filenames:*.ll
MIME types:text/x-llvm

For LLVM assembly code.

class pygments.lexers.asm.NasmLexer
Short names:nasm
Filenames:*.asm, *.ASM
MIME types:text/x-nasm

For Nasm (Intel) assembly code.

class pygments.lexers.asm.NasmObjdumpLexer
Short names:objdump-nasm
Filenames:*.objdump-intel
MIME types:text/x-nasm-objdump

For the output of ‘objdump -d -M intel’.

New in version 2.0.

class pygments.lexers.asm.ObjdumpLexer
Short names:objdump
Filenames:*.objdump
MIME types:text/x-objdump

For the output of ‘objdump -dr’

Lexers for automation scripting languages

class pygments.lexers.automation.AutoItLexer
Short names:autoit
Filenames:*.au3
MIME types:text/x-autoit

For AutoIt files.

AutoIt is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting

New in version 1.6.

class pygments.lexers.automation.AutohotkeyLexer
Short names:ahk, autohotkey
Filenames:*.ahk, *.ahkl
MIME types:text/x-autohotkey

For autohotkey source code.

New in version 1.4.

Lexers for BASIC like languages (other than VB.net)

class pygments.lexers.basic.BlitzBasicLexer
Short names:blitzbasic, b3d, bplus
Filenames:*.bb, *.decls
MIME types:text/x-bb

For BlitzBasic source code.

New in version 2.0.

class pygments.lexers.basic.BlitzMaxLexer
Short names:blitzmax, bmax
Filenames:*.bmx
MIME types:text/x-bmx

For BlitzMax source code.

New in version 1.4.

class pygments.lexers.basic.CbmBasicV2Lexer
Short names:cbmbas
Filenames:*.bas
MIME types:None

For CBM BASIC V2 sources.

New in version 1.6.

class pygments.lexers.basic.MonkeyLexer
Short names:monkey
Filenames:*.monkey
MIME types:text/x-monkey

For Monkey source code.

New in version 1.6.

class pygments.lexers.basic.QBasicLexer
Short names:qbasic, basic
Filenames:*.BAS, *.bas
MIME types:text/basic

For QBasic source code.

New in version 2.0.

Lexers for “business-oriented” languages

class pygments.lexers.business.ABAPLexer
Short names:abap
Filenames:*.abap, *.ABAP
MIME types:text/x-abap

Lexer for ABAP, SAP’s integrated language.

New in version 1.1.

class pygments.lexers.business.CobolFreeformatLexer
Short names:cobolfree
Filenames:*.cbl, *.CBL
MIME types:None

Lexer for Free format OpenCOBOL code.

New in version 1.6.

class pygments.lexers.business.CobolLexer
Short names:cobol
Filenames:*.cob, *.COB, *.cpy, *.CPY
MIME types:text/x-cobol

Lexer for OpenCOBOL code.

New in version 1.6.

class pygments.lexers.business.GoodDataCLLexer
Short names:gooddata-cl
Filenames:*.gdc
MIME types:text/x-gooddata-cl

Lexer for GoodData-CL script files.

New in version 1.4.

class pygments.lexers.business.MaqlLexer
Short names:maql
Filenames:*.maql
MIME types:text/x-gooddata-maql, application/x-gooddata-maql

Lexer for GoodData MAQL scripts.

New in version 1.4.

class pygments.lexers.business.OpenEdgeLexer
Short names:openedge, abl, progress
Filenames:*.p, *.cls
MIME types:text/x-openedge, application/x-openedge

Lexer for OpenEdge ABL (formerly Progress) source code.

New in version 1.5.

Lexers for C/C++ languages

class pygments.lexers.c_cpp.CLexer
Short names:c
Filenames:*.c, *.h, *.idc
MIME types:text/x-chdr, text/x-csrc

For C source code with preprocessor directives.

class pygments.lexers.c_cpp.CppLexer
Short names:cpp, c++
Filenames:*.cpp, *.hpp, *.c++, *.h++, *.cc, *.hh, *.cxx, *.hxx, *.C, *.H, *.cp, *.CPP
MIME types:text/x-c++hdr, text/x-c++src

For C++ source code with preprocessor directives.

Lexers for other C-like languages

class pygments.lexers.c_like.ArduinoLexer
Short names:arduino
Filenames:*.ino
MIME types:text/x-arduino

For Arduino(tm) source.

This is an extension of the CppLexer, as the Arduino® Language is a superset of C++

New in version 2.1.

class pygments.lexers.c_like.ClayLexer
Short names:clay
Filenames:*.clay
MIME types:text/x-clay

For Clay source.

New in version 2.0.

class pygments.lexers.c_like.CudaLexer
Short names:cuda, cu
Filenames:*.cu, *.cuh
MIME types:text/x-cuda

For NVIDIA CUDA™ source.

New in version 1.6.

class pygments.lexers.c_like.ECLexer
Short names:ec
Filenames:*.ec, *.eh
MIME types:text/x-echdr, text/x-ecsrc

For eC source code with preprocessor directives.

New in version 1.5.

class pygments.lexers.c_like.MqlLexer
Short names:mql, mq4, mq5, mql4, mql5
Filenames:*.mq4, *.mq5, *.mqh
MIME types:text/x-mql

For MQL4 and MQL5 source code.

New in version 2.0.

class pygments.lexers.c_like.NesCLexer
Short names:nesc
Filenames:*.nc
MIME types:text/x-nescsrc

For nesC source code with preprocessor directives.

New in version 2.0.

class pygments.lexers.c_like.PikeLexer
Short names:pike
Filenames:*.pike, *.pmod
MIME types:text/x-pike

For Pike source code.

New in version 2.0.

class pygments.lexers.c_like.SwigLexer
Short names:swig
Filenames:*.swg, *.i
MIME types:text/swig

For SWIG source code.

New in version 2.0.

class pygments.lexers.c_like.ValaLexer
Short names:vala, vapi
Filenames:*.vala, *.vapi
MIME types:text/x-vala

For Vala source code with preprocessor directives.

New in version 1.1.

Lexer for the Chapel language

class pygments.lexers.chapel.ChapelLexer
Short names:chapel, chpl
Filenames:*.chpl
MIME types:None

For Chapel source.

New in version 2.0.

Lexers for configuration file formats

class pygments.lexers.configs.ApacheConfLexer
Short names:apacheconf, aconf, apache
Filenames:.htaccess, apache.conf, apache2.conf
MIME types:text/x-apacheconf

Lexer for configuration files following the Apache config file format.

New in version 0.6.

class pygments.lexers.configs.Cfengine3Lexer
Short names:cfengine3, cf3
Filenames:*.cf
MIME types:None

Lexer for CFEngine3 policy files.

New in version 1.5.

class pygments.lexers.configs.DockerLexer
Short names:docker, dockerfile
Filenames:Dockerfile, *.docker
MIME types:text/x-dockerfile-config

Lexer for Docker configuration files.

New in version 2.0.

class pygments.lexers.configs.IniLexer
Short names:ini, cfg, dosini
Filenames:*.ini, *.cfg, *.inf
MIME types:text/x-ini, text/inf

Lexer for configuration files in INI style.

class pygments.lexers.configs.KconfigLexer
Short names:kconfig, menuconfig, linux-config, kernel-config
Filenames:Kconfig, *Config.in*, external.in*, standard-modules.in
MIME types:text/x-kconfig

For Linux-style Kconfig files.

New in version 1.6.

class pygments.lexers.configs.LighttpdConfLexer
Short names:lighty, lighttpd
Filenames:None
MIME types:text/x-lighttpd-conf

Lexer for Lighttpd configuration files.

New in version 0.11.

class pygments.lexers.configs.NginxConfLexer
Short names:nginx
Filenames:None
MIME types:text/x-nginx-conf

Lexer for Nginx configuration files.

New in version 0.11.

class pygments.lexers.configs.PacmanConfLexer
Short names:pacmanconf
Filenames:pacman.conf
MIME types:None

Lexer for pacman.conf.

Actually, IniLexer works almost fine for this format, but it yield error token. It is because pacman.conf has a form without assignment like:

UseSyslog Color TotalDownload CheckSpace VerbosePkgLists

These are flags to switch on.

New in version 2.1.

class pygments.lexers.configs.PkgConfigLexer
Short names:pkgconfig
Filenames:*.pc
MIME types:None

Lexer for pkg-config (see also manual page).

New in version 2.1.

class pygments.lexers.configs.PropertiesLexer
Short names:properties, jproperties
Filenames:*.properties
MIME types:text/x-java-properties

Lexer for configuration files in Java’s properties format.

New in version 1.4.

class pygments.lexers.configs.RegeditLexer
Short names:registry
Filenames:*.reg
MIME types:text/x-windows-registry

Lexer for Windows Registry files produced by regedit.

New in version 1.6.

class pygments.lexers.configs.SquidConfLexer
Short names:squidconf, squid.conf, squid
Filenames:squid.conf
MIME types:text/x-squidconf

Lexer for squid configuration files.

New in version 0.9.

class pygments.lexers.configs.TermcapLexer
Short names:termcap
Filenames:termcap, termcap.src
MIME types:None

Lexer for termcap database source.

This is very simple and minimal.

New in version 2.1.

class pygments.lexers.configs.TerminfoLexer
Short names:terminfo
Filenames:terminfo, terminfo.src
MIME types:None

Lexer for terminfo database source.

This is very simple and minimal.

New in version 2.1.

class pygments.lexers.configs.TerraformLexer
Short names:terraform, tf
Filenames:*.tf
MIME types:application/x-tf, application/x-terraform

Lexer for terraformi .tf files.

New in version 2.1.

Lexers for misc console output

class pygments.lexers.console.PyPyLogLexer
Short names:pypylog, pypy
Filenames:*.pypylog
MIME types:application/x-pypylog

Lexer for PyPy log files.

New in version 1.5.

class pygments.lexers.console.VCTreeStatusLexer
Short names:vctreestatus
Filenames:None
MIME types:None

For colorizing output of version control status commands, like “hg status” or “svn status”.

New in version 2.0.

Lexers for CSound languages

class pygments.lexers.csound.CsoundDocumentLexer
Short names:csound-document, csound-csd
Filenames:*.csd
MIME types:None

For Csound documents.

class pygments.lexers.csound.CsoundOrchestraLexer
Short names:csound, csound-orc
Filenames:*.orc
MIME types:None

For Csound orchestras.

New in version 2.1.

class pygments.lexers.csound.CsoundScoreLexer
Short names:csound-score, csound-sco
Filenames:*.sco
MIME types:None

For Csound scores.

New in version 2.1.

Lexers for D languages

class pygments.lexers.d.CrocLexer
Short names:croc
Filenames:*.croc
MIME types:text/x-crocsrc

For Croc source.

class pygments.lexers.d.DLexer
Short names:d
Filenames:*.d, *.di
MIME types:text/x-dsrc

For D source.

New in version 1.2.

class pygments.lexers.d.MiniDLexer
Short names:minid
Filenames:None
MIME types:text/x-minidsrc

For MiniD source. MiniD is now known as Croc.

Lexers for data file format

class pygments.lexers.data.JsonLdLexer
Short names:jsonld, json-ld
Filenames:*.jsonld
MIME types:application/ld+json

For JSON-LD linked data.

New in version 2.0.

class pygments.lexers.data.JsonLexer
Short names:json
Filenames:*.json
MIME types:application/json

For JSON data structures.

New in version 1.5.

class pygments.lexers.data.YamlLexer
Short names:yaml
Filenames:*.yaml, *.yml
MIME types:text/x-yaml

Lexer for YAML, a human-friendly data serialization language.

New in version 0.11.

Lexers for diff/patch formats

class pygments.lexers.diff.DarcsPatchLexer
Short names:dpatch
Filenames:*.dpatch, *.darcspatch
MIME types:None

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 version 0.10.

class pygments.lexers.diff.DiffLexer
Short names:diff, udiff
Filenames:*.diff, *.patch
MIME types:text/x-diff, text/x-patch

Lexer for unified or context-style diffs or patches.

Lexers for .net languages

class pygments.lexers.dotnet.BooLexer
Short names:boo
Filenames:*.boo
MIME types:text/x-boo

For Boo source code.

class pygments.lexers.dotnet.CSharpAspxLexer
Short names:aspx-cs
Filenames:*.aspx, *.asax, *.ascx, *.ashx, *.asmx, *.axd
MIME types:None

Lexer for highlighting C# within ASP.NET pages.

class pygments.lexers.dotnet.CSharpLexer
Short names:csharp, c#
Filenames:*.cs
MIME types:text/x-csharp

For C# source code.

Additional options accepted:

unicodelevel

Determines which Unicode characters this lexer allows for identifiers. The possible values are:

  • none – only the ASCII letters and numbers are allowed. This is the fastest selection.
  • basic – all Unicode characters from the specification except category Lo are allowed.
  • full – all Unicode characters as specified in the C# specs are allowed. Note that this means a considerable slowdown since the Lo category has more than 40,000 characters in it!

The default value is basic.

New in version 0.8.

class pygments.lexers.dotnet.FSharpLexer
Short names:fsharp
Filenames:*.fs, *.fsi
MIME types:text/x-fsharp

For the F# language (version 3.0).

AAAAACK Strings http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/spec.html#_Toc335818775

New in version 1.5.

class pygments.lexers.dotnet.NemerleLexer
Short names:nemerle
Filenames:*.n
MIME types:text/x-nemerle

For Nemerle source code.

Additional options accepted:

unicodelevel

Determines which Unicode characters this lexer allows for identifiers. The possible values are:

  • none – only the ASCII letters and numbers are allowed. This is the fastest selection.
  • basic – all Unicode characters from the specification except category Lo are allowed.
  • full – all Unicode characters as specified in the C# specs are allowed. Note that this means a considerable slowdown since the Lo category has more than 40,000 characters in it!

The default value is basic.

New in version 1.5.

class pygments.lexers.dotnet.VbNetAspxLexer
Short names:aspx-vb
Filenames:*.aspx, *.asax, *.ascx, *.ashx, *.asmx, *.axd
MIME types:None

Lexer for highlighting Visual Basic.net within ASP.NET pages.

class pygments.lexers.dotnet.VbNetLexer
Short names:vb.net, vbnet
Filenames:*.vb, *.bas
MIME types:text/x-vbnet, text/x-vba

For Visual Basic.NET source code.

Lexers for various domain-specific languages

class pygments.lexers.dsls.AlloyLexer
Short names:alloy
Filenames:*.als
MIME types:text/x-alloy

For Alloy source code.

New in version 2.0.

class pygments.lexers.dsls.BroLexer
Short names:bro
Filenames:*.bro
MIME types:None

For Bro scripts.

New in version 1.5.

class pygments.lexers.dsls.CrmshLexer
Short names:crmsh, pcmk
Filenames:*.crmsh, *.pcmk
MIME types:None

Lexer for crmsh configuration files for Pacemaker clusters.

New in version 2.1.

class pygments.lexers.dsls.MscgenLexer
Short names:mscgen, msc
Filenames:*.msc
MIME types:None

For Mscgen files.

New in version 1.6.

class pygments.lexers.dsls.PanLexer
Short names:pan
Filenames:*.pan
MIME types:None

Lexer for pan source files.

Based on tcsh lexer.

New in version 2.0.

class pygments.lexers.dsls.ProtoBufLexer
Short names:protobuf, proto
Filenames:*.proto
MIME types:None

Lexer for Protocol Buffer definition files.

New in version 1.4.

class pygments.lexers.dsls.PuppetLexer
Short names:puppet
Filenames:*.pp
MIME types:None

For Puppet configuration DSL.

New in version 1.6.

class pygments.lexers.dsls.RslLexer
Short names:rsl
Filenames:*.rsl
MIME types:text/rsl

RSL is the formal specification language used in RAISE (Rigorous Approach to Industrial Software Engineering) method.

New in version 2.0.

class pygments.lexers.dsls.ThriftLexer
Short names:thrift
Filenames:*.thrift
MIME types:application/x-thrift

For Thrift interface definitions.

New in version 2.1.

class pygments.lexers.dsls.VGLLexer
Short names:vgl
Filenames:*.rpf
MIME types:None

For SampleManager VGL source code.

New in version 1.6.

Lexers for the Dylan language

class pygments.lexers.dylan.DylanConsoleLexer
Short names:dylan-console, dylan-repl
Filenames:*.dylan-console
MIME types:text/x-dylan-console

For Dylan interactive console output like:

? let a = 1;
=> 1
? a
=> 1

This is based on a copy of the RubyConsoleLexer.

New in version 1.6.

class pygments.lexers.dylan.DylanLexer
Short names:dylan
Filenames:*.dylan, *.dyl, *.intr
MIME types:text/x-dylan

For the Dylan language.

New in version 0.7.

class pygments.lexers.dylan.DylanLidLexer
Short names:dylan-lid, lid
Filenames:*.lid, *.hdp
MIME types:text/x-dylan-lid

For Dylan LID (Library Interchange Definition) files.

New in version 1.6.

Lexers for the ECL language

class pygments.lexers.ecl.ECLLexer
Short names:ecl
Filenames:*.ecl
MIME types:application/x-ecl

Lexer for the declarative big-data ECL language.

New in version 1.5.

Lexer for the Eiffel language

class pygments.lexers.eiffel.EiffelLexer
Short names:eiffel
Filenames:*.e
MIME types:text/x-eiffel

For Eiffel source code.

New in version 2.0.

Lexer for the Elm programming language

class pygments.lexers.elm.ElmLexer
Short names:elm
Filenames:*.elm
MIME types:text/x-elm

For Elm source code.

New in version 2.1.

Lexers for Erlang

class pygments.lexers.erlang.ElixirConsoleLexer
Short names:iex
Filenames:None
MIME types:text/x-elixir-shellsession

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 version 1.5.

class pygments.lexers.erlang.ElixirLexer
Short names:elixir, ex, exs
Filenames:*.ex, *.exs
MIME types:text/x-elixir

For the Elixir language.

New in version 1.5.

class pygments.lexers.erlang.ErlangLexer
Short names:erlang
Filenames:*.erl, *.hrl, *.es, *.escript
MIME types:text/x-erlang

For the Erlang functional programming language.

Blame Jeremy Thurgood (http://jerith.za.net/).

New in version 0.9.

class pygments.lexers.erlang.ErlangShellLexer
Short names:erl
Filenames:*.erl-sh
MIME types:text/x-erl-shellsession

Shell sessions in erl (for Erlang code).

New in version 1.1.

Lexers for esoteric languages

class pygments.lexers.esoteric.BefungeLexer
Short names:befunge
Filenames:*.befunge
MIME types:application/x-befunge

Lexer for the esoteric Befunge language.

New in version 0.7.

class pygments.lexers.esoteric.BoogieLexer
Short names:boogie
Filenames:*.bpl
MIME types:None

For Boogie source code.

New in version 2.1.

class pygments.lexers.esoteric.BrainfuckLexer
Short names:brainfuck, bf
Filenames:*.bf, *.b
MIME types:application/x-brainfuck

Lexer for the esoteric BrainFuck language.

class pygments.lexers.esoteric.CAmkESLexer
Short names:camkes, idl4
Filenames:*.camkes, *.idl4
MIME types:None

Basic lexer for the input language for the CAmkES component platform.

New in version 2.1.

class pygments.lexers.esoteric.RedcodeLexer
Short names:redcode
Filenames:*.cw
MIME types:None

A simple Redcode lexer based on ICWS‘94. Contributed by Adam Blinkinsop <blinks@acm.org>.

New in version 0.8.

Pygments lexers for Ezhil language

class pygments.lexers.ezhil.EzhilLexer
Short names:ezhil
Filenames:*.n
MIME types:text/x-ezhil

Lexer for Ezhil, a Tamil script-based programming language

New in version 2.1.

Lexers for the Factor language

class pygments.lexers.factor.FactorLexer
Short names:factor
Filenames:*.factor
MIME types:text/x-factor

Lexer for the Factor language.

New in version 1.4.

Lexer for the Fantom language

class pygments.lexers.fantom.FantomLexer
Short names:fan
Filenames:*.fan
MIME types:application/x-fantom

For Fantom source code.

New in version 1.5.

Lexer for the Felix language

class pygments.lexers.felix.FelixLexer
Short names:felix, flx
Filenames:*.flx, *.flxh
MIME types:text/x-felix

For Felix source code.

New in version 1.2.

Lexers for Fortran languages

class pygments.lexers.fortran.FortranFixedLexer
Short names:fortranfixed
Filenames:*.f, *.F
MIME types:None

Lexer for fixed format Fortran.

New in version 2.1.

class pygments.lexers.fortran.FortranLexer
Short names:fortran
Filenames:*.f03, *.f90, *.F03, *.F90
MIME types:text/x-fortran

Lexer for FORTRAN 90 code.

New in version 0.10.

Simple lexer for Microsoft Visual FoxPro source code

class pygments.lexers.foxpro.FoxProLexer
Short names:foxpro, vfp, clipper, xbase
Filenames:*.PRG, *.prg
MIME types:None

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 version 1.6.

Lexers for the Google Go language

class pygments.lexers.go.GoLexer
Short names:go
Filenames:*.go
MIME types:text/x-gosrc

For Go source.

New in version 1.2.

Lexers for grammer notations like BNF

class pygments.lexers.grammar_notation.AbnfLexer
Short names:abnf
Filenames:*.abnf
MIME types:text/x-abnf

Lexer for IETF 7405 ABNF (Updates 5234) grammars.

New in version 2.1.

class pygments.lexers.grammar_notation.BnfLexer
Short names:bnf
Filenames:*.bnf
MIME types:text/x-bnf

This lexer is for grammer notations which are similar to original BNF.

In order to maximize a number of targets of this lexer, let’s decide some designs:

  • We don’t distinguish Terminal Symbol.
  • We do assume that NonTerminal Symbol are always enclosed with arrow brackets.
  • We do assume that NonTerminal Symbol may include any printable characters except arrow brackets and ASCII 0x20. This assumption is for RBNF.
  • We do assume that target notation doesn’t support comment.
  • We don’t distinguish any operators and punctuation except ::=.

Though these desision making might cause too minimal highlighting and you might be disappointed, but it is reasonable for us.

New in version 2.1.

Lexers for graph query languages

class pygments.lexers.graph.CypherLexer
Short names:cypher
Filenames:*.cyp, *.cypher
MIME types:None

For Cypher Query Language

For the Cypher version in Neo4J 2.0

New in version 2.0.

Lexers for hardware descriptor languages

class pygments.lexers.hdl.SystemVerilogLexer
Short names:systemverilog, sv
Filenames:*.sv, *.svh
MIME types:text/x-systemverilog

Extends verilog lexer to recognise all SystemVerilog keywords from IEEE 1800-2009 standard.

New in version 1.5.

class pygments.lexers.hdl.VerilogLexer
Short names:verilog, v
Filenames:*.v
MIME types:text/x-verilog

For verilog source code with preprocessor directives.

New in version 1.4.

class pygments.lexers.hdl.VhdlLexer
Short names:vhdl
Filenames:*.vhdl, *.vhd
MIME types:text/x-vhdl

For VHDL source code.

New in version 1.5.

Lexers for hexadecimal dumps

class pygments.lexers.hexdump.HexdumpLexer
Short names:hexdump
Filenames:None
MIME types:None

For typical hex dump output formats by the UNIX and GNU/Linux tools hexdump, hd, hexcat, od and xxd, and the DOS tool DEBUG. For example:

00000000  7f 45 4c 46 02 01 01 00  00 00 00 00 00 00 00 00  |.ELF............|
00000010  02 00 3e 00 01 00 00 00  c5 48 40 00 00 00 00 00  |..>......H@.....|

The specific supported formats are the outputs of:

  • hexdump FILE
  • hexdump -C FILE – the canonical format used in the example.
  • hd FILE – same as hexdump -C FILE.
  • hexcat FILE
  • od -t x1z FILE
  • xxd FILE
  • DEBUG.EXE FILE.COM and entering d to the prompt.

New in version 2.1.

Lexers for IDL

class pygments.lexers.idl.IDLLexer
Short names:idl
Filenames:*.pro
MIME types:text/idl

Pygments Lexer for IDL (Interactive Data Language).

New in version 1.6.

Lexers for Igor Pro

class pygments.lexers.igor.IgorLexer
Short names:igor, igorpro
Filenames:*.ipf
MIME types:text/ipf

Pygments Lexer for Igor Pro procedure files (.ipf). See http://www.wavemetrics.com/ and http://www.igorexchange.com/.

New in version 2.0.

Lexers for installer/packager DSLs and formats

class pygments.lexers.installers.DebianControlLexer
Short names:control, debcontrol
Filenames:control
MIME types:None

Lexer for Debian control files and apt-cache show <pkg> outputs.

New in version 0.9.

class pygments.lexers.installers.NSISLexer
Short names:nsis, nsi, nsh
Filenames:*.nsi, *.nsh
MIME types:text/x-nsis

For NSIS scripts.

New in version 1.6.

class pygments.lexers.installers.RPMSpecLexer
Short names:spec
Filenames:*.spec
MIME types:text/x-rpm-spec

For RPM .spec files.

New in version 1.6.

class pygments.lexers.installers.SourcesListLexer
Short names:sourceslist, sources.list, debsources
Filenames:sources.list
MIME types:None

Lexer that highlights debian sources.list files.

New in version 0.7.

Lexers for interactive fiction languages

class pygments.lexers.int_fiction.Inform6Lexer
Short names:inform6, i6
Filenames:*.inf
MIME types:None

For Inform 6 source code.

New in version 2.0.

class pygments.lexers.int_fiction.Inform6TemplateLexer
Short names:i6t
Filenames:*.i6t
MIME types:None

For Inform 6 template code.

New in version 2.0.

class pygments.lexers.int_fiction.Inform7Lexer
Short names:inform7, i7
Filenames:*.ni, *.i7x
MIME types:None

For Inform 7 source code.

New in version 2.0.

class pygments.lexers.int_fiction.Tads3Lexer
Short names:tads3
Filenames:*.t
MIME types:None

For TADS 3 source code.

Lexers for the Io language

class pygments.lexers.iolang.IoLexer
Short names:io
Filenames:*.io
MIME types:text/x-iosrc

For Io (a small, prototype-based programming language) source.

New in version 0.10.

Lexer for the J programming language

class pygments.lexers.j.JLexer
Short names:j
Filenames:*.ijs
MIME types:text/x-j

For J source code.

New in version 2.1.

Lexers for the Julia language

class pygments.lexers.julia.JuliaConsoleLexer
Short names:jlcon
Filenames:None
MIME types:None

For Julia console sessions. Modeled after MatlabSessionLexer.

New in version 1.6.

class pygments.lexers.julia.JuliaLexer
Short names:julia, jl
Filenames:*.jl
MIME types:text/x-julia, application/x-julia

For Julia source code.

New in version 1.6.

Pygments lexers for JVM languages

class pygments.lexers.jvm.AspectJLexer
Short names:aspectj
Filenames:*.aj
MIME types:text/x-aspectj

For AspectJ source code.

New in version 1.6.

class pygments.lexers.jvm.CeylonLexer
Short names:ceylon
Filenames:*.ceylon
MIME types:text/x-ceylon

For Ceylon source code.

New in version 1.6.

class pygments.lexers.jvm.ClojureLexer
Short names:clojure, clj
Filenames:*.clj
MIME types:text/x-clojure, application/x-clojure

Lexer for Clojure source code.

New in version 0.11.

class pygments.lexers.jvm.ClojureScriptLexer
Short names:clojurescript, cljs
Filenames:*.cljs
MIME types:text/x-clojurescript, application/x-clojurescript

Lexer for ClojureScript source code.

New in version 2.0.

class pygments.lexers.jvm.GoloLexer
Short names:golo
Filenames:*.golo
MIME types:None

For Golo source code.

New in version 2.0.

class pygments.lexers.jvm.GosuLexer
Short names:gosu
Filenames:*.gs, *.gsx, *.gsp, *.vark
MIME types:text/x-gosu

For Gosu source code.

New in version 1.5.

class pygments.lexers.jvm.GosuTemplateLexer
Short names:gst
Filenames:*.gst
MIME types:text/x-gosu-template

For Gosu templates.

New in version 1.5.

class pygments.lexers.jvm.GroovyLexer
Short names:groovy
Filenames:*.groovy, *.gradle
MIME types:text/x-groovy

For Groovy source code.

New in version 1.5.

class pygments.lexers.jvm.IokeLexer
Short names:ioke, ik
Filenames:*.ik
MIME types:text/x-iokesrc

For Ioke (a strongly typed, dynamic, prototype based programming language) source.

New in version 1.4.

class pygments.lexers.jvm.JasminLexer
Short names:jasmin, jasminxt
Filenames:*.j
MIME types:None

For Jasmin assembly code.

New in version 2.0.

class pygments.lexers.jvm.JavaLexer
Short names:java
Filenames:*.java
MIME types:text/x-java

For Java source code.

class pygments.lexers.jvm.KotlinLexer
Short names:kotlin
Filenames:*.kt
MIME types:text/x-kotlin

For Kotlin source code.

New in version 1.5.

class pygments.lexers.jvm.PigLexer
Short names:pig
Filenames:*.pig
MIME types:text/x-pig

For Pig Latin source code.

New in version 2.0.

class pygments.lexers.jvm.ScalaLexer
Short names:scala
Filenames:*.scala
MIME types:text/x-scala

For Scala source code.

class pygments.lexers.jvm.XtendLexer
Short names:xtend
Filenames:*.xtend
MIME types:text/x-xtend

For Xtend source code.

New in version 1.6.

Lexers for Lispy languages

class pygments.lexers.lisp.CPSALexer
Short names:cpsa
Filenames:*.cpsa
MIME types:None

A CPSA lexer based on the CPSA language as of version 2.2.12

New in version 2.1.

class pygments.lexers.lisp.CommonLispLexer
Short names:common-lisp, cl, lisp
Filenames:*.cl, *.lisp
MIME types:text/x-common-lisp

A Common Lisp lexer.

New in version 0.9.

class pygments.lexers.lisp.EmacsLispLexer
Short names:emacs, elisp, emacs-lisp
Filenames:*.el
MIME types:text/x-elisp, application/x-elisp

An ELisp lexer, parsing a stream and outputting the tokens needed to highlight elisp code.

New in version 2.1.

class pygments.lexers.lisp.HyLexer
Short names:hylang
Filenames:*.hy
MIME types:text/x-hy, application/x-hy

Lexer for Hy source code.

New in version 2.0.

class pygments.lexers.lisp.NewLispLexer
Short names:newlisp
Filenames:*.lsp, *.nl
MIME types:text/x-newlisp, application/x-newlisp

For newLISP. source code (version 10.3.0).

New in version 1.5.

class pygments.lexers.lisp.RacketLexer
Short names:racket, rkt
Filenames:*.rkt, *.rktd, *.rktl
MIME types:text/x-racket, application/x-racket

Lexer for Racket source code (formerly known as PLT Scheme).

New in version 1.6.

class pygments.lexers.lisp.SchemeLexer
Short names:scheme, scm
Filenames:*.scm, *.ss
MIME types:text/x-scheme, application/x-scheme

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 version 0.6.

class pygments.lexers.lisp.ShenLexer
Short names:shen
Filenames:*.shen
MIME types:text/x-shen, application/x-shen

Lexer for Shen source code.

New in version 2.1.

Lexers for Makefiles and similar

class pygments.lexers.make.BaseMakefileLexer
Short names:basemake
Filenames:None
MIME types:None

Lexer for simple Makefiles (no preprocessing).

New in version 0.10.

class pygments.lexers.make.CMakeLexer
Short names:cmake
Filenames:*.cmake, CMakeLists.txt
MIME types:text/x-cmake

Lexer for CMake files.

New in version 1.2.

class pygments.lexers.make.MakefileLexer
Short names:make, makefile, mf, bsdmake
Filenames:*.mak, *.mk, Makefile, makefile, Makefile.*, GNUmakefile
MIME types:text/x-makefile

Lexer for BSD and GNU make extensions (lenient enough to handle both in the same file even).

Rewritten in Pygments 0.10.

Lexers for non-HTML markup languages

class pygments.lexers.markup.BBCodeLexer
Short names:bbcode
Filenames:None
MIME types:text/x-bbcode

A lexer that highlights BBCode(-like) syntax.

New in version 0.6.

class pygments.lexers.markup.GroffLexer
Short names:groff, nroff, man
Filenames:*.[1234567], *.man
MIME types:application/x-troff, text/troff

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

New in version 0.6.

class pygments.lexers.markup.MoinWikiLexer
Short names:trac-wiki, moin
Filenames:None
MIME types:text/x-trac-wiki

For MoinMoin (and Trac) Wiki markup.

New in version 0.7.

class pygments.lexers.markup.MozPreprocCssLexer
Short names:css+mozpreproc
Filenames:*.css.in
MIME types:None

Subclass of the MozPreprocHashLexer that highlights unlexed data with the CssLexer.

New in version 2.0.

class pygments.lexers.markup.MozPreprocHashLexer
Short names:mozhashpreproc
Filenames:None
MIME types:None

Lexer for Mozilla Preprocessor files (with ‘#’ as the marker).

Other data is left untouched.

New in version 2.0.

class pygments.lexers.markup.MozPreprocJavascriptLexer
Short names:javascript+mozpreproc
Filenames:*.js.in
MIME types:None

Subclass of the MozPreprocHashLexer that highlights unlexed data with the JavascriptLexer.

New in version 2.0.

class pygments.lexers.markup.MozPreprocPercentLexer
Short names:mozpercentpreproc
Filenames:None
MIME types:None

Lexer for Mozilla Preprocessor files (with ‘%’ as the marker).

Other data is left untouched.

New in version 2.0.

class pygments.lexers.markup.MozPreprocXulLexer
Short names:xul+mozpreproc
Filenames:*.xul.in
MIME types:None

Subclass of the MozPreprocHashLexer that highlights unlexed data with the XmlLexer.

New in version 2.0.

class pygments.lexers.markup.RstLexer
Short names:rst, rest, restructuredtext
Filenames:*.rst, *.rest
MIME types:text/x-rst, text/prs.fallenstein.rst

For reStructuredText markup.

New in version 0.7.

Additional options accepted:

handlecodeblocks

Highlight the contents of .. sourcecode:: language, .. code:: language and .. code-block:: language directives with a lexer for the given language (default: True).

New in version 0.8.

class pygments.lexers.markup.TexLexer
Short names:tex, latex
Filenames:*.tex, *.aux, *.toc
MIME types:text/x-tex, text/x-latex

Lexer for the TeX and LaTeX typesetting languages.

Lexers for ML family languages

class pygments.lexers.ml.OcamlLexer
Short names:ocaml
Filenames:*.ml, *.mli, *.mll, *.mly
MIME types:text/x-ocaml

For the OCaml language.

New in version 0.7.

class pygments.lexers.ml.OpaLexer
Short names:opa
Filenames:*.opa
MIME types:text/x-opa

Lexer for the Opa language (http://opalang.org).

New in version 1.5.

class pygments.lexers.ml.SMLLexer
Short names:sml
Filenames:*.sml, *.sig, *.fun
MIME types:text/x-standardml, application/x-standardml

For the Standard ML language.

New in version 1.5.

Lexers for modeling languages

class pygments.lexers.modeling.BugsLexer
Short names:bugs, winbugs, openbugs
Filenames:*.bug
MIME types:None

Pygments Lexer for OpenBugs and WinBugs models.

New in version 1.6.

class pygments.lexers.modeling.JagsLexer
Short names:jags
Filenames:*.jag, *.bug
MIME types:None

Pygments Lexer for JAGS.

New in version 1.6.

class pygments.lexers.modeling.ModelicaLexer
Short names:modelica
Filenames:*.mo
MIME types:text/x-modelica

For Modelica source code.

New in version 1.1.

class pygments.lexers.modeling.StanLexer
Short names:stan
Filenames:*.stan
MIME types:None

Pygments Lexer for Stan models.

The Stan modeling language is specified in the Stan Modeling Language User’s Guide and Reference Manual, v2.8.0, pdf.

New in version 1.6.

Multi-Dialect Lexer for Modula-2

class pygments.lexers.modula2.Modula2Lexer
Short names:modula2, m2
Filenames:*.def, *.mod
MIME types:text/x-modula2

For Modula-2 source code.

The Modula-2 lexer supports several dialects. By default, it operates in fallback mode, recognising the combined literals, punctuation symbols and operators of all supported dialects, and the combined reserved words and builtins of PIM Modula-2, ISO Modula-2 and Modula-2 R10, while not differentiating between library defined identifiers.

To select a specific dialect, a dialect option may be passed or a dialect tag may be embedded into a source file.

Dialect Options:

m2pim
Select PIM Modula-2 dialect.
m2iso
Select ISO Modula-2 dialect.
m2r10
Select Modula-2 R10 dialect.
objm2
Select Objective Modula-2 dialect.

The PIM and ISO dialect options may be qualified with a language extension.

Language Extensions:

+aglet
Select Aglet Modula-2 extensions, available with m2iso.
+gm2
Select GNU Modula-2 extensions, available with m2pim.
+p1
Select p1 Modula-2 extensions, available with m2iso.
+xds
Select XDS Modula-2 extensions, available with m2iso.

Passing a Dialect Option via Unix Commandline Interface

Dialect options may be passed to the lexer using the dialect key. Only one such option should be passed. If multiple dialect options are passed, the first valid option is used, any subsequent options are ignored.

Examples:

$ pygmentize -O full,dialect=m2iso -f html -o /path/to/output /path/to/input
Use ISO dialect to render input to HTML output
$ pygmentize -O full,dialect=m2iso+p1 -f rtf -o /path/to/output /path/to/input
Use ISO dialect with p1 extensions to render input to RTF output

Embedding a Dialect Option within a source file

A dialect option may be embedded in a source file in form of a dialect tag, a specially formatted comment that specifies a dialect option.

Dialect Tag EBNF:

dialectTag :
    OpeningCommentDelim Prefix dialectOption ClosingCommentDelim ;

dialectOption :
    'm2pim' | 'm2iso' | 'm2r10' | 'objm2' |
    'm2iso+aglet' | 'm2pim+gm2' | 'm2iso+p1' | 'm2iso+xds' ;

Prefix : '!' ;

OpeningCommentDelim : '(*' ;

ClosingCommentDelim : '*)' ;

No whitespace is permitted between the tokens of a dialect tag.

In the event that a source file contains multiple dialect tags, the first tag that contains a valid dialect option will be used and any subsequent dialect tags will be ignored. Ideally, a dialect tag should be placed at the beginning of a source file.

An embedded dialect tag overrides a dialect option set via command line.

Examples:

(*!m2r10*) DEFINITION MODULE Foobar; ...
Use Modula2 R10 dialect to render this source file.
(*!m2pim+gm2*) DEFINITION MODULE Bazbam; ...
Use PIM dialect with GNU extensions to render this source file.

Algol Publication Mode:

In Algol publication mode, source text is rendered for publication of algorithms in scientific papers and academic texts, following the format of the Revised Algol-60 Language Report. It is activated by passing one of two corresponding styles as an option:

algol
render reserved words lowercase underline boldface and builtins lowercase boldface italic
algol_nu
render reserved words lowercase boldface (no underlining) and builtins lowercase boldface italic

The lexer automatically performs the required lowercase conversion when this mode is activated.

Example:

$ pygmentize -O full,style=algol -f latex -o /path/to/output /path/to/input
Render input file in Algol publication mode to LaTeX output.

Rendering Mode of First Class ADT Identifiers:

The rendering of standard library first class ADT identifiers is controlled by option flag “treat_stdlib_adts_as_builtins”.

When this option is turned on, standard library ADT identifiers are rendered as builtins. When it is turned off, they are rendered as ordinary library identifiers.

treat_stdlib_adts_as_builtins (default: On)

The option is useful for dialects that support ADTs as first class objects and provide ADTs in the standard library that would otherwise be built-in.

At present, only Modula-2 R10 supports library ADTs as first class objects and therefore, no ADT identifiers are defined for any other dialects.

Example:

$ pygmentize -O full,dialect=m2r10,treat_stdlib_adts_as_builtins=Off ...
Render standard library ADTs as ordinary library types.

New in version 1.3.

Changed in version 2.1: Added multi-dialect support.

Lexer for the Nimrod language

class pygments.lexers.nimrod.NimrodLexer
Short names:nimrod, nim
Filenames:*.nim, *.nimrod
MIME types:text/x-nimrod

For Nimrod source code.

New in version 1.5.

Lexer for the Nit language

class pygments.lexers.nit.NitLexer
Short names:nit
Filenames:*.nit
MIME types:None

For nit source.

New in version 2.0.

Lexers for the NixOS Nix language

class pygments.lexers.nix.NixLexer
Short names:nixos, nix
Filenames:*.nix
MIME types:text/x-nix

For the Nix language.

New in version 2.0.

Lexers for Oberon family languages

class pygments.lexers.oberon.ComponentPascalLexer
Short names:componentpascal, cp
Filenames:*.cp, *.cps
MIME types:text/x-component-pascal

For Component Pascal source code.

New in version 2.1.

Lexers for Objective-C family languages

class pygments.lexers.objective.LogosLexer
Short names:logos
Filenames:*.x, *.xi, *.xm, *.xmi
MIME types:text/x-logos

For Logos + Objective-C source code with preprocessor directives.

New in version 1.6.

class pygments.lexers.objective.ObjectiveCLexer
Short names:objective-c, objectivec, obj-c, objc
Filenames:*.m, *.h
MIME types:text/x-objective-c

For Objective-C source code with preprocessor directives.

class pygments.lexers.objective.ObjectiveCppLexer
Short names:objective-c++, objectivec++, obj-c++, objc++
Filenames:*.mm, *.hh
MIME types:text/x-objective-c++

For Objective-C++ source code with preprocessor directives.

class pygments.lexers.objective.SwiftLexer
Short names:swift
Filenames:*.swift
MIME types:text/x-swift

For Swift source.

New in version 2.0.

Lexers for the Ooc language

class pygments.lexers.ooc.OocLexer
Short names:ooc
Filenames:*.ooc
MIME types:text/x-ooc

For Ooc source code

New in version 1.2.

Lexer for ParaSail

class pygments.lexers.parasail.ParaSailLexer
Short names:parasail
Filenames:*.psi, *.psl
MIME types:text/x-parasail

For ParaSail source code.

New in version 2.1.

Lexers for parser generators

class pygments.lexers.parsers.AntlrActionScriptLexer
Short names:antlr-as, antlr-actionscript
Filenames:*.G, *.g
MIME types:None

ANTLR with ActionScript Target

New in version 1.1.

class pygments.lexers.parsers.AntlrCSharpLexer
Short names:antlr-csharp, antlr-c#
Filenames:*.G, *.g
MIME types:None

ANTLR with C# Target

New in version 1.1.

class pygments.lexers.parsers.AntlrCppLexer
Short names:antlr-cpp
Filenames:*.G, *.g
MIME types:None

ANTLR with CPP Target

New in version 1.1.

class pygments.lexers.parsers.AntlrJavaLexer
Short names:antlr-java
Filenames:*.G, *.g
MIME types:None

ANTLR with Java Target

New in version 1..

class pygments.lexers.parsers.AntlrLexer
Short names:antlr
Filenames:None
MIME types:None

Generic ANTLR Lexer. Should not be called directly, instead use DelegatingLexer for your target language.

New in version 1.1.

class pygments.lexers.parsers.AntlrObjectiveCLexer
Short names:antlr-objc
Filenames:*.G, *.g
MIME types:None

ANTLR with Objective-C Target

New in version 1.1.

class pygments.lexers.parsers.AntlrPerlLexer
Short names:antlr-perl
Filenames:*.G, *.g
MIME types:None

ANTLR with Perl Target

New in version 1.1.

class pygments.lexers.parsers.AntlrPythonLexer
Short names:antlr-python
Filenames:*.G, *.g
MIME types:None

ANTLR with Python Target

New in version 1.1.

class pygments.lexers.parsers.AntlrRubyLexer
Short names:antlr-ruby, antlr-rb
Filenames:*.G, *.g
MIME types:None

ANTLR with Ruby Target

New in version 1.1.

class pygments.lexers.parsers.EbnfLexer
Short names:ebnf
Filenames:*.ebnf
MIME types:text/x-ebnf

Lexer for ISO/IEC 14977 EBNF grammars.

New in version 2.0.

class pygments.lexers.parsers.RagelCLexer
Short names:ragel-c
Filenames:*.rl
MIME types:None

A lexer for Ragel in a C host file.

New in version 1.1.

class pygments.lexers.parsers.RagelCppLexer
Short names:ragel-cpp
Filenames:*.rl
MIME types:None

A lexer for Ragel in a CPP host file.

New in version 1.1.

class pygments.lexers.parsers.RagelDLexer
Short names:ragel-d
Filenames:*.rl
MIME types:None

A lexer for Ragel in a D host file.

New in version 1.1.

class pygments.lexers.parsers.RagelEmbeddedLexer
Short names:ragel-em
Filenames:*.rl
MIME types:None

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 version 1.1.

class pygments.lexers.parsers.RagelJavaLexer
Short names:ragel-java
Filenames:*.rl
MIME types:None

A lexer for Ragel in a Java host file.

New in version 1.1.

class pygments.lexers.parsers.RagelLexer
Short names:ragel
Filenames:None
MIME types:None

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 version 1.1.

class pygments.lexers.parsers.RagelObjectiveCLexer
Short names:ragel-objc
Filenames:*.rl
MIME types:None

A lexer for Ragel in an Objective C host file.

New in version 1.1.

class pygments.lexers.parsers.RagelRubyLexer
Short names:ragel-ruby, ragel-rb
Filenames:*.rl
MIME types:None

A lexer for Ragel in a Ruby host file.

New in version 1.1.

class pygments.lexers.parsers.TreetopLexer
Short names:treetop
Filenames:*.treetop, *.tt
MIME types:None

A lexer for Treetop grammars.

New in version 1.6.

Lexers for Pascal family languages

class pygments.lexers.pascal.AdaLexer
Short names:ada, ada95, ada2005
Filenames:*.adb, *.ads, *.ada
MIME types:text/x-ada

For Ada source code.

New in version 1.3.

class pygments.lexers.pascal.DelphiLexer
Short names:delphi, pas, pascal, objectpascal
Filenames:*.pas
MIME types:text/x-pascal

For Delphi (Borland Object Pascal), Turbo Pascal and Free Pascal source code.

Additional options accepted:

turbopascal
Highlight Turbo Pascal specific keywords (default: True).
delphi
Highlight Borland Delphi specific keywords (default: True).
freepascal
Highlight Free Pascal specific keywords (default: True).
units
A list of units that should be considered builtin, supported are System, SysUtils, Classes and Math. Default is to consider all of them builtin.

Lexers for the Pawn languages

class pygments.lexers.pawn.PawnLexer
Short names:pawn
Filenames:*.p, *.pwn, *.inc
MIME types:text/x-pawn

For Pawn source code.

New in version 2.0.

class pygments.lexers.pawn.SourcePawnLexer
Short names:sp
Filenames:*.sp
MIME types:text/x-sourcepawn

For SourcePawn source code with preprocessor directives.

New in version 1.6.

Lexer for Praat

class pygments.lexers.praat.PraatLexer
Short names:praat
Filenames:*.praat, *.proc, *.psc
MIME types:None

For Praat scripts.

New in version 2.1.

Lexers for Prolog and Prolog-like languages

class pygments.lexers.prolog.LogtalkLexer
Short names:logtalk
Filenames:*.lgt, *.logtalk
MIME types:text/x-logtalk

For Logtalk source code.

New in version 0.10.

class pygments.lexers.prolog.PrologLexer
Short names:prolog
Filenames:*.ecl, *.prolog, *.pro, *.pl
MIME types:text/x-prolog

Lexer for Prolog files.

Lexer for QVT Operational language

class pygments.lexers.qvt.QVToLexer
Short names:qvto, qvt
Filenames:*.qvto
MIME types:None

For the QVT Operational Mapping language.

Reference for implementing this: «Meta Object Facility (MOF) 2.0 Query/View/Transformation Specification», Version 1.1 - January 2011 (http://www.omg.org/spec/QVT/1.1/), see §8.4, «Concrete Syntax» in particular.

Notable tokens assignments:

  • Name.Class is assigned to the identifier following any of the following keywords: metamodel, class, exception, primitive, enum, transformation or library
  • Name.Function is assigned to the names of mappings and queries
  • Name.Builtin.Pseudo is assigned to the pre-defined variables ‘this’, ‘self’ and ‘result’.

Lexers for the R/S languages

class pygments.lexers.r.RConsoleLexer
Short names:rconsole, rout
Filenames:*.Rout
MIME types:None

For R console transcripts or R CMD BATCH output files.

class pygments.lexers.r.RdLexer
Short names:rd
Filenames:*.Rd
MIME types:text/x-r-doc

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 version 1.6.

class pygments.lexers.r.SLexer
Short names:splus, s, r
Filenames:*.S, *.R, .Rhistory, .Rprofile, .Renviron
MIME types:text/S-plus, text/S, text/x-r-source, text/x-r, text/x-R, text/x-r-history, text/x-r-profile

For S, S-plus, and R source code.

New in version 0.10.

Lexers for semantic web and RDF query languages and markup

class pygments.lexers.rdf.SparqlLexer
Short names:sparql
Filenames:*.rq, *.sparql
MIME types:application/sparql-query

Lexer for SPARQL query language.

New in version 2.0.

class pygments.lexers.rdf.TurtleLexer
Short names:turtle
Filenames:*.ttl
MIME types:text/turtle, application/x-turtle

Lexer for Turtle data language.

New in version 2.1.

Lexer for resource definition files

class pygments.lexers.resource.ResourceLexer
Short names:resource, resourcebundle
Filenames:*.txt
MIME types:None

Lexer for ICU Resource bundles.

New in version 2.0.

Lexers for Roboconf DSL

class pygments.lexers.roboconf.RoboconfGraphLexer
Short names:roboconf-graph
Filenames:*.graph
MIME types:None

Lexer for Roboconf graph files.

New in version 2.1.

class pygments.lexers.roboconf.RoboconfInstancesLexer
Short names:roboconf-instances
Filenames:*.instances
MIME types:None

Lexer for Roboconf instances files.

New in version 2.1.

Lexer for Robot Framework

class pygments.lexers.robotframework.RobotFrameworkLexer
Short names:robotframework
Filenames:*.txt, *.robot
MIME types:text/x-robotframework

For Robot Framework test data.

Supports both space and pipe separated plain text formats.

New in version 1.6.

Lexers for the Rust language

class pygments.lexers.rust.RustLexer
Short names:rust
Filenames:*.rs, *.rs.in
MIME types:text/rust

Lexer for the Rust programming language (version 1.0).

New in version 1.6.

Lexer for scripting and embedded languages

class pygments.lexers.scripting.AppleScriptLexer
Short names:applescript
Filenames:*.applescript
MIME types:None

For AppleScript source code, including AppleScript Studio. Contributed by Andreas Amann <aamann@mac.com>.

New in version 1.0.

class pygments.lexers.scripting.ChaiscriptLexer
Short names:chai, chaiscript
Filenames:*.chai
MIME types:text/x-chaiscript, application/x-chaiscript

For ChaiScript source code.

New in version 2.0.

class pygments.lexers.scripting.EasytrieveLexer
Short names:easytrieve
Filenames:*.ezt, *.mac
MIME types:text/x-easytrieve

Easytrieve Plus is a programming language for extracting, filtering and converting sequential data. Furthermore it can layout data for reports. It is mainly used on mainframe platforms and can access several of the mainframe’s native file formats. It is somewhat comparable to awk.

New in version 2.1.

class pygments.lexers.scripting.HybrisLexer
Short names:hybris, hy
Filenames:*.hy, *.hyb
MIME types:text/x-hybris, application/x-hybris

For Hybris source code.

New in version 1.4.

class pygments.lexers.scripting.JclLexer
Short names:jcl
Filenames:*.jcl
MIME types:text/x-jcl

Job Control Language (JCL) is a scripting language used on mainframe platforms to instruct the system on how to run a batch job or start a subsystem. It is somewhat comparable to MS DOS batch and Unix shell scripts.

New in version 2.1.

class pygments.lexers.scripting.LSLLexer
Short names:lsl
Filenames:*.lsl
MIME types:text/x-lsl

For Second Life’s Linden Scripting Language source code.

New in version 2.0.

class pygments.lexers.scripting.LuaLexer
Short names:lua
Filenames:*.lua, *.wlua
MIME types:text/x-lua, application/x-lua

For Lua source code.

Additional options accepted:

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 _lua_builtins module:

>>> from pygments.lexers._lua_builtins import MODULES
>>> MODULES.keys()
['string', 'coroutine', 'modules', 'io', 'basic', ...]
class pygments.lexers.scripting.MOOCodeLexer
Short names:moocode, moo
Filenames:*.moo
MIME types:text/x-moocode

For MOOCode (the MOO scripting language).

New in version 0.9.

class pygments.lexers.scripting.MoonScriptLexer
Short names:moon, moonscript
Filenames:*.moon
MIME types:text/x-moonscript, application/x-moonscript

For MoonScript source code.

New in version 1.5.

class pygments.lexers.scripting.RexxLexer
Short names:rexx, arexx
Filenames:*.rexx, *.rex, *.rx, *.arexx
MIME types:text/x-rexx

Rexx is a scripting language available for a wide range of different platforms with its roots found on mainframe systems. It is popular for I/O- and data based tasks and can act as glue language to bind different applications together.

New in version 2.0.

Lexers for various shells

class pygments.lexers.shell.BashLexer
Short names:bash, sh, ksh, shell
Filenames:*.sh, *.ksh, *.bash, *.ebuild, *.eclass, *.exheres-0, *.exlib, .bashrc, bashrc, .bash\*, bash\*, PKGBUILD
MIME types:application/x-sh, application/x-shellscript

Lexer for (ba|k|)sh shell scripts.

New in version 0.6.

class pygments.lexers.shell.BashSessionLexer
Short names:console, shell-session
Filenames:*.sh-session, *.shell-session
MIME types:application/x-shell-session, application/x-sh-session

Lexer for simplistic shell sessions.

New in version 1.1.

class pygments.lexers.shell.BatchLexer
Short names:bat, batch, dosbatch, winbatch
Filenames:*.bat, *.cmd
MIME types:application/x-dos-batch

Lexer for the DOS/Windows Batch file format.

New in version 0.7.

class pygments.lexers.shell.FishShellLexer
Short names:fish, fishshell
Filenames:*.fish, *.load
MIME types:application/x-fish

Lexer for Fish shell scripts.

New in version 2.1.

class pygments.lexers.shell.MSDOSSessionLexer
Short names:doscon
Filenames:None
MIME types:None

Lexer for simplistic MSDOS sessions.

New in version 2.1.

class pygments.lexers.shell.PowerShellLexer
Short names:powershell, posh, ps1, psm1
Filenames:*.ps1, *.psm1
MIME types:text/x-powershell

For Windows PowerShell code.

New in version 1.5.

class pygments.lexers.shell.PowerShellSessionLexer
Short names:ps1con
Filenames:None
MIME types:None

Lexer for simplistic Windows PowerShell sessions.

New in version 2.1.

class pygments.lexers.shell.TcshLexer
Short names:tcsh, csh
Filenames:*.tcsh, *.csh
MIME types:application/x-csh

Lexer for tcsh scripts.

New in version 0.10.

class pygments.lexers.shell.TcshSessionLexer
Short names:tcshcon
Filenames:None
MIME types:None

Lexer for Tcsh sessions.

New in version 2.1.

Lexers for the SNOBOL language

class pygments.lexers.snobol.SnobolLexer
Short names:snobol
Filenames:*.snobol
MIME types:text/x-snobol

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 version 1.5.

Special lexers

class pygments.lexers.special.RawTokenLexer
Short names:raw
Filenames:None
MIME types:application/x-pygments-tokens

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:

compress
If set to "gz" or "bz2", decompress the token stream with the given compression algorithm before lexing (default: "").
class pygments.lexers.special.TextLexer
Short names:text
Filenames:*.txt
MIME types:text/plain

“Null” lexer, doesn’t highlight anything.

Lexer for SuperCollider

class pygments.lexers.supercollider.SuperColliderLexer
Short names:sc, supercollider
Filenames:*.sc, *.scd
MIME types:application/supercollider, text/supercollider

For SuperCollider source code.

New in version 2.1.

Lexers for various template engines’ markup

class pygments.lexers.templates.CheetahHtmlLexer
Short names:html+cheetah, html+spitfire, htmlcheetah
Filenames:None
MIME types:text/html+cheetah, text/html+spitfire

Subclass of the CheetahLexer that highlights unlexed data with the HtmlLexer.

class pygments.lexers.templates.CheetahJavascriptLexer
Short names:js+cheetah, javascript+cheetah, js+spitfire, javascript+spitfire
Filenames:None
MIME types:application/x-javascript+cheetah, text/x-javascript+cheetah, text/javascript+cheetah, application/x-javascript+spitfire, text/x-javascript+spitfire, text/javascript+spitfire

Subclass of the CheetahLexer that highlights unlexed data with the JavascriptLexer.

class pygments.lexers.templates.CheetahLexer
Short names:cheetah, spitfire
Filenames:*.tmpl, *.spt
MIME types:application/x-cheetah, application/x-spitfire

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.

class pygments.lexers.templates.CheetahXmlLexer
Short names:xml+cheetah, xml+spitfire
Filenames:None
MIME types:application/xml+cheetah, application/xml+spitfire

Subclass of the CheetahLexer that highlights unlexed data with the XmlLexer.

class pygments.lexers.templates.ColdfusionCFCLexer
Short names:cfc
Filenames:*.cfc
MIME types:None

Coldfusion markup/script components

New in version 2.0.

class pygments.lexers.templates.ColdfusionHtmlLexer
Short names:cfm
Filenames:*.cfm, *.cfml
MIME types:application/x-coldfusion

Coldfusion markup in html

class pygments.lexers.templates.ColdfusionLexer
Short names:cfs
Filenames:None
MIME types:None

Coldfusion statements

class pygments.lexers.templates.CssDjangoLexer
Short names:css+django, css+jinja
Filenames:None
MIME types:text/css+django, text/css+jinja

Subclass of the DjangoLexer that highlights unlexed data with the CssLexer.

class pygments.lexers.templates.CssErbLexer
Short names:css+erb, css+ruby
Filenames:None
MIME types:text/css+ruby

Subclass of ErbLexer which highlights unlexed data with the CssLexer.

class pygments.lexers.templates.CssGenshiLexer
Short names:css+genshitext, css+genshi
Filenames:None
MIME types:text/css+genshi

A lexer that highlights CSS definitions in genshi text templates.

class pygments.lexers.templates.CssPhpLexer
Short names:css+php
Filenames:None
MIME types:text/css+php

Subclass of PhpLexer which highlights unmatched data with the CssLexer.

class pygments.lexers.templates.CssSmartyLexer
Short names:css+smarty
Filenames:None
MIME types:text/css+smarty

Subclass of the SmartyLexer that highlights unlexed data with the CssLexer.

class pygments.lexers.templates.DjangoLexer
Short names:django, jinja
Filenames:None
MIME types:application/x-django-templating, application/x-jinja

Generic django and jinja template lexer.

It just highlights django/jinja code between the preprocessor directives, other data is left untouched by the lexer.

class pygments.lexers.templates.ErbLexer
Short names:erb
Filenames:None
MIME types:application/x-ruby-templating

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.

class pygments.lexers.templates.EvoqueHtmlLexer
Short names:html+evoque
Filenames:*.html
MIME types:text/html+evoque

Subclass of the EvoqueLexer that highlights unlexed data with the HtmlLexer.

New in version 1.1.

class pygments.lexers.templates.EvoqueLexer
Short names:evoque
Filenames:*.evoque
MIME types:application/x-evoque

For files using the Evoque templating system.

New in version 1.1.

class pygments.lexers.templates.EvoqueXmlLexer
Short names:xml+evoque
Filenames:*.xml
MIME types:application/xml+evoque

Subclass of the EvoqueLexer that highlights unlexed data with the XmlLexer.

New in version 1.1.

class pygments.lexers.templates.GenshiLexer
Short names:genshi, kid, xml+genshi, xml+kid
Filenames:*.kid
MIME types:application/x-genshi, application/x-kid

A lexer that highlights genshi and kid kid XML templates.

class pygments.lexers.templates.GenshiTextLexer
Short names:genshitext
Filenames:None
MIME types:application/x-genshi-text, text/x-genshi

A lexer that highlights genshi text templates.

class pygments.lexers.templates.HandlebarsHtmlLexer
Short names:html+handlebars
Filenames:*.handlebars, *.hbs
MIME types:text/html+handlebars, text/x-handlebars-template

Subclass of the HandlebarsLexer that highlights unlexed data with the HtmlLexer.

New in version 2.0.

class pygments.lexers.templates.HandlebarsLexer
Short names:handlebars
Filenames:None
MIME types:None

Generic handlebars <http://handlebarsjs.com/> template lexer.

Highlights only the Handlebars template tags (stuff between {{ and }}). Everything else is left for a delegating lexer.

New in version 2.0.

class pygments.lexers.templates.HtmlDjangoLexer
Short names:html+django, html+jinja, htmldjango
Filenames:None
MIME types:text/html+django, text/html+jinja

Subclass of the DjangoLexer that highlights unlexed data with the HtmlLexer.

Nested Javascript and CSS is highlighted too.

class pygments.lexers.templates.HtmlGenshiLexer
Short names:html+genshi, html+kid
Filenames:None
MIME types:text/html+genshi

A lexer that highlights genshi and kid kid HTML templates.

class pygments.lexers.templates.HtmlPhpLexer
Short names:html+php
Filenames:*.phtml
MIME types:application/x-php, application/x-httpd-php, application/x-httpd-php3, application/x-httpd-php4, application/x-httpd-php5

Subclass of PhpLexer that highlights unhandled data with the HtmlLexer.

Nested Javascript and CSS is highlighted too.

class pygments.lexers.templates.HtmlSmartyLexer
Short names:html+smarty
Filenames:None
MIME types:text/html+smarty

Subclass of the SmartyLexer that highlights unlexed data with the HtmlLexer.

Nested Javascript and CSS is highlighted too.

class pygments.lexers.templates.JavascriptDjangoLexer
Short names:js+django, javascript+django, js+jinja, javascript+jinja
Filenames:None
MIME types:application/x-javascript+django, application/x-javascript+jinja, text/x-javascript+django, text/x-javascript+jinja, text/javascript+django, text/javascript+jinja

Subclass of the DjangoLexer that highlights unlexed data with the JavascriptLexer.

class pygments.lexers.templates.JavascriptErbLexer
Short names:js+erb, javascript+erb, js+ruby, javascript+ruby
Filenames:None
MIME types:application/x-javascript+ruby, text/x-javascript+ruby, text/javascript+ruby

Subclass of ErbLexer which highlights unlexed data with the JavascriptLexer.

class pygments.lexers.templates.JavascriptGenshiLexer
Short names:js+genshitext, js+genshi, javascript+genshitext, javascript+genshi
Filenames:None
MIME types:application/x-javascript+genshi, text/x-javascript+genshi, text/javascript+genshi

A lexer that highlights javascript code in genshi text templates.

class pygments.lexers.templates.JavascriptPhpLexer
Short names:js+php, javascript+php
Filenames:None
MIME types:application/x-javascript+php, text/x-javascript+php, text/javascript+php

Subclass of PhpLexer which highlights unmatched data with the JavascriptLexer.

class pygments.lexers.templates.JavascriptSmartyLexer
Short names:js+smarty, javascript+smarty
Filenames:None
MIME types:application/x-javascript+smarty, text/x-javascript+smarty, text/javascript+smarty

Subclass of the SmartyLexer that highlights unlexed data with the JavascriptLexer.

class pygments.lexers.templates.JspLexer
Short names:jsp
Filenames:*.jsp
MIME types:application/x-jsp

Lexer for Java Server Pages.

New in version 0.7.

class pygments.lexers.templates.LassoCssLexer
Short names:css+lasso
Filenames:None
MIME types:text/css+lasso

Subclass of the LassoLexer which highlights unhandled data with the CssLexer.

New in version 1.6.

class pygments.lexers.templates.LassoHtmlLexer
Short names:html+lasso
Filenames:None
MIME types:text/html+lasso, application/x-httpd-lasso, application/x-httpd-lasso[89]

Subclass of the LassoLexer which highlights unhandled data with the HtmlLexer.

Nested JavaScript and CSS is also highlighted.

New in version 1.6.

class pygments.lexers.templates.LassoJavascriptLexer
Short names:js+lasso, javascript+lasso
Filenames:None
MIME types:application/x-javascript+lasso, text/x-javascript+lasso, text/javascript+lasso

Subclass of the LassoLexer which highlights unhandled data with the JavascriptLexer.

New in version 1.6.

class pygments.lexers.templates.LassoXmlLexer
Short names:xml+lasso
Filenames:None
MIME types:application/xml+lasso

Subclass of the LassoLexer which highlights unhandled data with the XmlLexer.

New in version 1.6.

class pygments.lexers.templates.LiquidLexer
Short names:liquid
Filenames:*.liquid
MIME types:None

Lexer for Liquid templates.

New in version 2.0.

class pygments.lexers.templates.MakoCssLexer
Short names:css+mako
Filenames:None
MIME types:text/css+mako

Subclass of the MakoLexer that highlights unlexed data with the CssLexer.

New in version 0.7.

class pygments.lexers.templates.MakoHtmlLexer
Short names:html+mako
Filenames:None
MIME types:text/html+mako

Subclass of the MakoLexer that highlights unlexed data with the HtmlLexer.

New in version 0.7.

class pygments.lexers.templates.MakoJavascriptLexer
Short names:js+mako, javascript+mako
Filenames:None
MIME types:application/x-javascript+mako, text/x-javascript+mako, text/javascript+mako

Subclass of the MakoLexer that highlights unlexed data with the JavascriptLexer.

New in version 0.7.

class pygments.lexers.templates.MakoLexer
Short names:mako
Filenames:*.mao
MIME types:application/x-mako

Generic mako templates lexer. Code that isn’t Mako markup is yielded as Token.Other.

New in version 0.7.

class pygments.lexers.templates.MakoXmlLexer
Short names:xml+mako
Filenames:None
MIME types:application/xml+mako

Subclass of the MakoLexer that highlights unlexed data with the XmlLexer.

New in version 0.7.

class pygments.lexers.templates.MasonLexer
Short names:mason
Filenames:*.m, *.mhtml, *.mc, *.mi, autohandler, dhandler
MIME types:application/x-mason

Generic mason templates lexer. Stolen from Myghty lexer. Code that isn’t Mason markup is HTML.

New in version 1.4.

class pygments.lexers.templates.MyghtyCssLexer
Short names:css+myghty
Filenames:None
MIME types:text/css+myghty

Subclass of the MyghtyLexer that highlights unlexed data with the CssLexer.

New in version 0.6.

class pygments.lexers.templates.MyghtyHtmlLexer
Short names:html+myghty
Filenames:None
MIME types:text/html+myghty

Subclass of the MyghtyLexer that highlights unlexed data with the HtmlLexer.

New in version 0.6.

class pygments.lexers.templates.MyghtyJavascriptLexer
Short names:js+myghty, javascript+myghty
Filenames:None
MIME types:application/x-javascript+myghty, text/x-javascript+myghty, text/javascript+mygthy

Subclass of the MyghtyLexer that highlights unlexed data with the JavascriptLexer.

New in version 0.6.

class pygments.lexers.templates.MyghtyLexer
Short names:myghty
Filenames:*.myt, autodelegate
MIME types:application/x-myghty

Generic myghty templates lexer. Code that isn’t Myghty markup is yielded as Token.Other.

New in version 0.6.

class pygments.lexers.templates.MyghtyXmlLexer
Short names:xml+myghty
Filenames:None
MIME types:application/xml+myghty

Subclass of the MyghtyLexer that highlights unlexed data with the XmlLexer.

New in version 0.6.

class pygments.lexers.templates.RhtmlLexer
Short names:rhtml, html+erb, html+ruby
Filenames:*.rhtml
MIME types:text/html+ruby

Subclass of the ERB lexer that highlights the unlexed data with the html lexer.

Nested Javascript and CSS is highlighted too.

class pygments.lexers.templates.SmartyLexer
Short names:smarty
Filenames:*.tpl
MIME types:application/x-smarty

Generic Smarty template lexer.

Just highlights smarty code between the preprocessor directives, other data is left untouched by the lexer.

class pygments.lexers.templates.SspLexer
Short names:ssp
Filenames:*.ssp
MIME types:application/x-ssp

Lexer for Scalate Server Pages.

New in version 1.4.

class pygments.lexers.templates.TeaTemplateLexer
Short names:tea
Filenames:*.tea
MIME types:text/x-tea

Lexer for Tea Templates.

New in version 1.5.

class pygments.lexers.templates.TwigHtmlLexer
Short names:html+twig
Filenames:*.twig
MIME types:text/html+twig

Subclass of the TwigLexer that highlights unlexed data with the HtmlLexer.

New in version 2.0.

class pygments.lexers.templates.TwigLexer
Short names:twig
Filenames:None
MIME types:application/x-twig

Twig template lexer.

It just highlights Twig code between the preprocessor directives, other data is left untouched by the lexer.

New in version 2.0.

class pygments.lexers.templates.VelocityHtmlLexer
Short names:html+velocity
Filenames:None
MIME types:text/html+velocity

Subclass of the VelocityLexer that highlights unlexed data with the HtmlLexer.

class pygments.lexers.templates.VelocityLexer
Short names:velocity
Filenames:*.vm, *.fhtml
MIME types:None

Generic Velocity template lexer.

Just highlights velocity directives and variable references, other data is left untouched by the lexer.

class pygments.lexers.templates.VelocityXmlLexer
Short names:xml+velocity
Filenames:None
MIME types:application/xml+velocity

Subclass of the VelocityLexer that highlights unlexed data with the XmlLexer.

class pygments.lexers.templates.XmlDjangoLexer
Short names:xml+django, xml+jinja
Filenames:None
MIME types:application/xml+django, application/xml+jinja

Subclass of the DjangoLexer that highlights unlexed data with the XmlLexer.

class pygments.lexers.templates.XmlErbLexer
Short names:xml+erb, xml+ruby
Filenames:None
MIME types:application/xml+ruby

Subclass of ErbLexer which highlights data outside preprocessor directives with the XmlLexer.

class pygments.lexers.templates.XmlPhpLexer
Short names:xml+php
Filenames:None
MIME types:application/xml+php

Subclass of PhpLexer that highlights unhandled data with the XmlLexer.

class pygments.lexers.templates.XmlSmartyLexer
Short names:xml+smarty
Filenames:None
MIME types:application/xml+smarty

Subclass of the SmartyLexer that highlights unlexed data with the XmlLexer.

class pygments.lexers.templates.YamlJinjaLexer
Short names:yaml+jinja, salt, sls
Filenames:*.sls
MIME types:text/x-yaml+jinja, text/x-sls

Subclass of the DjangoLexer that highlights unlexed data with the YamlLexer.

Commonly used in Saltstack salt states.

New in version 2.0.

Lexers for testing languages

class pygments.lexers.testing.GherkinLexer
Short names:cucumber, gherkin
Filenames:*.feature
MIME types:text/x-gherkin

For Gherkin <http://github.com/aslakhellesoy/gherkin/> syntax.

New in version 1.2.

class pygments.lexers.testing.TAPLexer
Short names:tap
Filenames:*.tap
MIME types:None

For Test Anything Protocol (TAP) output.

New in version 2.1.

Lexers for various text formats

class pygments.lexers.textfmts.GettextLexer
Short names:pot, po
Filenames:*.pot, *.po
MIME types:application/x-gettext, text/x-gettext, text/gettext

Lexer for Gettext catalog files.

New in version 0.9.

class pygments.lexers.textfmts.HttpLexer
Short names:http
Filenames:None
MIME types:None

Lexer for HTTP sessions.

New in version 1.5.

class pygments.lexers.textfmts.IrcLogsLexer
Short names:irc
Filenames:*.weechatlog
MIME types:text/x-irclog

Lexer for IRC logs in irssi, xchat or weechat style.

class pygments.lexers.textfmts.TodotxtLexer
Short names:todotxt
Filenames:todo.txt, *.todotxt
MIME types:text/x-todo

Lexer for Todo.txt todo list format.

New in version 2.0.

Lexers for theorem-proving languages

class pygments.lexers.theorem.CoqLexer
Short names:coq
Filenames:*.v
MIME types:text/x-coq

For the Coq theorem prover.

New in version 1.5.

class pygments.lexers.theorem.IsabelleLexer
Short names:isabelle
Filenames:*.thy
MIME types:text/x-isabelle

For the Isabelle proof assistant.

New in version 2.0.

class pygments.lexers.theorem.LeanLexer
Short names:lean
Filenames:*.lean
MIME types:text/x-lean

For the Lean theorem prover.

New in version 2.0.

Lexer for RiverBed’s TrafficScript (RTS) language

class pygments.lexers.trafficscript.RtsLexer
Short names:rts, trafficscript
Filenames:*.rts
MIME types:None

For Riverbed Stingray Traffic Manager

New in version 2.1.

Lexers for UrbiScript language

class pygments.lexers.urbi.UrbiscriptLexer
Short names:urbiscript
Filenames:*.u
MIME types:application/x-urbiscript

For UrbiScript source code.

New in version 1.5.

Lexers for misc. web stuff

class pygments.lexers.webmisc.CirruLexer
Short names:cirru
Filenames:*.cirru
MIME types:text/x-cirru

Syntax rules of Cirru can be found at: http://cirru.org/

  • using () for expressions, but restricted in a same line
  • using "" for strings, with \ for escaping chars
  • using $ as folding operator
  • using , as unfolding operator
  • using indentations for nested blocks

New in version 2.0.

class pygments.lexers.webmisc.DuelLexer
Short names:duel, jbst, jsonml+bst
Filenames:*.duel, *.jbst
MIME types:text/x-duel, text/x-jbst

Lexer for Duel Views Engine (formerly JBST) markup with JavaScript code blocks. See http://duelengine.org/. See http://jsonml.org/jbst/.

New in version 1.4.

class pygments.lexers.webmisc.QmlLexer
Short names:qml, qbs
Filenames:*.qml, *.qbs
MIME types:application/x-qml, application/x-qt.qbs+qml

For QML files. See http://doc.qt.digia.com/4.7/qdeclarativeintroduction.html.

New in version 1.6.

class pygments.lexers.webmisc.SlimLexer
Short names:slim
Filenames:*.slim
MIME types:text/x-slim

For Slim markup.

New in version 2.0.

class pygments.lexers.webmisc.XQueryLexer
Short names:xquery, xqy, xq, xql, xqm
Filenames:*.xqy, *.xquery, *.xq, *.xql, *.xqm
MIME types:text/xquery, application/xquery

An XQuery lexer, parsing a stream and outputting the tokens needed to highlight xquery code.

New in version 1.4.

Lexers for the X10 programming language

class pygments.lexers.x10.X10Lexer
Short names:x10, xten
Filenames:*.x10
MIME types:text/x-x10

For the X10 language.

New in version 0.1.

Iterating over all lexers

New in version 0.6.

To get all lexers (both the builtin and the plugin ones), you can use the get_all_lexers() function from the pygments.lexers module:

>>> from pygments.lexers import get_all_lexers
>>> i = get_all_lexers()
>>> i.next()
('Diff', ('diff',), ('*.diff', '*.patch'), ('text/x-diff', 'text/x-patch'))
>>> i.next()
('Delphi', ('delphi', 'objectpascal', 'pas', 'pascal'), ('*.pas',), ('text/x-pascal',))
>>> i.next()
('XML+Ruby', ('xml+erb', 'xml+ruby'), (), ())

As you can see, the return value is an iterator which yields tuples in the form (name, aliases, filetypes, mimetypes).