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.Added 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.Added 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:
actionscript3, as3
- Filenames:
*.as
- MIME types:
application/x-actionscript3, text/x-actionscript3, text/actionscript3
For ActionScript 3 source code.
Added in version 0.11.
- class pygments.lexers.actionscript.ActionScriptLexer¶
- Short names:
actionscript, as
- Filenames:
*.as
- MIME types:
application/x-actionscript, text/x-actionscript, text/actionscript
For ActionScript source code.
Added 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.
Added in version 1.1.
Lexers for Ada family languages¶
- class pygments.lexers.ada.AdaLexer¶
- Short names:
ada, ada95, ada2005
- Filenames:
*.adb, *.ads, *.ada
- MIME types:
text/x-ada
For Ada source code.
Added in version 1.3.
Lexers for computer algebra systems¶
- class pygments.lexers.algebra.BCLexer¶
- Short names:
bc
- Filenames:
*.bc
- MIME types:
None
A BC lexer.
Added in version 2.1.
- class pygments.lexers.algebra.GAPConsoleLexer¶
- Short names:
gap-console, gap-repl
- Filenames:
*.tst
- MIME types:
None
For GAP console sessions. Modeled after JuliaConsoleLexer.
Example
#@local checkEuclideanRing gap> START_TEST("euclidean.tst"); # test consistency of EuclideanDegree, EuclideanQuotient, EuclideanRemainder, # and QuotientRemainder for some ring and elements of it gap> checkEuclideanRing := > function(R, colls...) > local coll1, coll2, a, b, deg_b, deg_r, q, r, qr; > if Length(colls) >= 1 then coll1:=colls[1]; > elif Size(R) <= 100 then coll1 := R; > else coll1 := List([1..100],i->Random(R)); > fi; > if Length(colls) >= 2 then coll2:=colls[2]; > elif Size(R) <= 100 then coll2 := R; > else coll2 := List([1..100],i->Random(R)); > fi; > for b in coll1 do > if IsZero(b) then continue; fi; > deg_b := EuclideanDegree(R, b); > for a in coll2 do > q := EuclideanQuotient(R, a, b); Assert(0, q in R); > r := EuclideanRemainder(R, a, b); Assert(0, r in R); > if a <> q*b + r then Error("a <> q*b + r for ", [R,a,b]); fi; > deg_r := EuclideanDegree(R, r); > if not IsZero(r) and deg_r >= deg_b then Error("Euclidean degree did not decrease for ",[R,a,b]); fi; > qr := QuotientRemainder(R, a, b); > if qr <> [q, r] then Error("QuotientRemainder inconsistent for ", [R,a,b]); fi; > od; > od; > return true; > end;; # rings in characteristic 0 gap> checkEuclideanRing(Integers,[-100..100],[-100..100]); true gap> checkEuclideanRing(Rationals); true gap> checkEuclideanRing(GaussianIntegers); true gap> checkEuclideanRing(GaussianRationals); true # finite fields gap> ForAll(Filtered([2..50], IsPrimePowerInt), q->checkEuclideanRing(GF(q))); true # ZmodnZ gap> ForAll([1..50], m -> checkEuclideanRing(Integers mod m)); true gap> checkEuclideanRing(Integers mod ((2*3*5)^2)); true gap> checkEuclideanRing(Integers mod ((2*3*5)^3)); true gap> checkEuclideanRing(Integers mod ((2*3*5*7)^2)); true gap> checkEuclideanRing(Integers mod ((2*3*5*7)^3)); true # gap> STOP_TEST( "euclidean.tst", 1);
Added in version 2.14.
- class pygments.lexers.algebra.GAPLexer¶
- Short names:
gap
- Filenames:
*.g, *.gd, *.gi, *.gap
- MIME types:
None
For GAP source code.
Added 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.
Added 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>.
Added in version 0.8.
Lexers for AmbientTalk language¶
- class pygments.lexers.ambient.AmbientTalkLexer¶
- Short names:
ambienttalk, ambienttalk/2, at
- Filenames:
*.at
- MIME types:
text/x-ambienttalk
Lexer for AmbientTalk source code.
Added in version 2.0.
Lexers for the AMDGPU ISA assembly¶
- class pygments.lexers.amdgpu.AMDGPULexer¶
- Short names:
amdgpu
- Filenames:
*.isa
- MIME types:
None
For AMD GPU assembly.
Added in version 2.8.
Lexers for the AMPL language¶
- class pygments.lexers.ampl.AmplLexer¶
- Short names:
ampl
- Filenames:
*.run
- MIME types:
None
For AMPL source code.
Added in version 2.2.
Lexers for ANSYS Parametric Design Language¶
- class pygments.lexers.apdlexer.apdlexer¶
- Short names:
ansys, apdl
- Filenames:
*.ans
- MIME types:
None
For APDL source code.
Added in version 2.9.
Lexers for APL¶
- class pygments.lexers.apl.APLLexer¶
- Short names:
apl
- Filenames:
*.apl, *.aplf, *.aplo, *.apln, *.aplc, *.apli, *.dyalog
- MIME types:
None
A simple APL lexer.
Added in version 2.0.
Lexer for Arrow¶
- class pygments.lexers.arrow.ArrowLexer¶
- Short names:
arrow
- Filenames:
*.arw
- MIME types:
None
Lexer for Arrow
Added in version 2.7.
Lexer for the Arturo language¶
- class pygments.lexers.arturo.ArturoLexer¶
- Short names:
arturo, art
- Filenames:
*.art
- MIME types:
None
For Arturo source code.
See Arturo’s Github and Arturo’s Website.
Added in version 2.14.
Lexer for various ASCII armored files¶
- class pygments.lexers.asc.AscLexer¶
- Short names:
asc, pem
- Filenames:
*.asc, *.pem, iddsa, idecdsa, idecdsask, ided25519, ided25519sk, idrsa
- MIME types:
application/pgp-keys, application/pgp-encrypted, application/pgp-signature, application/pem-certificate-chain
Lexer for ASCII armored files, containing —–BEGIN/END …—– wrapped base64 data.
Added in version 2.10.
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.
Added 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.Dasm16Lexer¶
- Short names:
dasm16
- Filenames:
*.dasm16, *.dasm
- MIME types:
text/x-dasm16
For DCPU-16 Assembly.
Added in version 2.4.
- 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.HsailLexer¶
- Short names:
hsail, hsa
- Filenames:
*.hsail
- MIME types:
text/x-hsail
For HSAIL assembly code.
Added in version 2.2.
- class pygments.lexers.asm.LlvmLexer¶
- Short names:
llvm
- Filenames:
*.ll
- MIME types:
text/x-llvm
For LLVM assembly code.
- class pygments.lexers.asm.LlvmMirBodyLexer¶
- Short names:
llvm-mir-body
- Filenames:
None
- MIME types:
None
For LLVM MIR examples without the YAML wrapper.
Added in version 2.6.
- class pygments.lexers.asm.LlvmMirLexer¶
- Short names:
llvm-mir
- Filenames:
*.mir
- MIME types:
None
Lexer for the overall LLVM MIR document format.
MIR is a human readable serialization format that’s used to represent LLVM’s machine specific intermediate representation. It allows LLVM’s developers to see the state of the compilation process at various points, as well as test individual pieces of the compiler.
Added in version 2.6.
- class pygments.lexers.asm.NasmLexer¶
- Short names:
nasm
- Filenames:
*.asm, *.ASM, *.nasm
- 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
.Added 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
.
- class pygments.lexers.asm.TasmLexer¶
- Short names:
tasm
- Filenames:
*.asm, *.ASM, *.tasm
- MIME types:
text/x-tasm
For Tasm (Turbo Assembler) assembly code.
Pygments lexers for ASN.1¶
- class pygments.lexers.asn1.Asn1Lexer¶
- Short names:
asn1
- Filenames:
*.asn1
- MIME types:
None
Lexer for ASN.1 module definition
Added in version 2.16.
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
Added in version 1.6.
- class pygments.lexers.automation.AutohotkeyLexer¶
- Short names:
autohotkey, ahk
- Filenames:
*.ahk, *.ahkl
- MIME types:
text/x-autohotkey
For autohotkey source code.
Added in version 1.4.
Lexer for the BARE schema¶
- class pygments.lexers.bare.BareLexer¶
- Short names:
bare
- Filenames:
*.bare
- MIME types:
None
For BARE schema source.
Added in version 2.7.
Lexers for BASIC like languages (other than VB.net)¶
- class pygments.lexers.basic.BBCBasicLexer¶
- Short names:
bbcbasic
- Filenames:
*.bbc
- MIME types:
None
BBC Basic was supplied on the BBC Micro, and later Acorn RISC OS. It is also used by BBC Basic For Windows.
Added in version 2.4.
- class pygments.lexers.basic.BlitzBasicLexer¶
- Short names:
blitzbasic, b3d, bplus
- Filenames:
*.bb, *.decls
- MIME types:
text/x-bb
For BlitzBasic source code.
Added in version 2.0.
- class pygments.lexers.basic.BlitzMaxLexer¶
- Short names:
blitzmax, bmax
- Filenames:
*.bmx
- MIME types:
text/x-bmx
For BlitzMax source code.
Added in version 1.4.
- class pygments.lexers.basic.CbmBasicV2Lexer¶
- Short names:
cbmbas
- Filenames:
*.bas
- MIME types:
None
For CBM BASIC V2 sources.
Added in version 1.6.
- class pygments.lexers.basic.MonkeyLexer¶
- Short names:
monkey
- Filenames:
*.monkey
- MIME types:
text/x-monkey
For Monkey source code.
Added in version 1.6.
- class pygments.lexers.basic.QBasicLexer¶
- Short names:
qbasic, basic
- Filenames:
*.BAS, *.bas
- MIME types:
text/basic
For QBasic source code.
Added in version 2.0.
- class pygments.lexers.basic.VBScriptLexer¶
- Short names:
vbscript
- Filenames:
*.vbs, *.VBS
- MIME types:
None
VBScript is scripting language that is modeled on Visual Basic.
Added in version 2.4.
Lexer for BDD(Behavior-driven development)¶
- class pygments.lexers.bdd.BddLexer¶
- Short names:
bdd
- Filenames:
*.feature
- MIME types:
text/x-bdd
Lexer for BDD(Behavior-driven development), which highlights not only keywords, but also comments, punctuations, strings, numbers, and variables.
Added in version 2.11.
Lexer for Berry¶
- class pygments.lexers.berry.BerryLexer¶
- Short names:
berry, be
- Filenames:
*.be
- MIME types:
text/x-berry, application/x-berry
For Berry source code.
Added in version 2.12.
Lexers for BibTeX bibliography data and styles¶
- class pygments.lexers.bibtex.BSTLexer¶
- Short names:
bst, bst-pybtex
- Filenames:
*.bst
- MIME types:
None
A lexer for BibTeX bibliography styles.
Added in version 2.2.
- class pygments.lexers.bibtex.BibTeXLexer¶
- Short names:
bibtex, bib
- Filenames:
*.bib
- MIME types:
text/x-bibtex
A lexer for BibTeX bibliography data format.
Added in version 2.2.
Lexer for the Blueprint UI markup language¶
- class pygments.lexers.blueprint.BlueprintLexer¶
- Short names:
blueprint
- Filenames:
*.blp
- MIME types:
text/x-blueprint
For Blueprint UI markup.
Added in version 2.16.
Lexers for the Boa language¶
- class pygments.lexers.boa.BoaLexer¶
- Short names:
boa
- Filenames:
*.boa
- MIME types:
None
Lexer for the Boa language.
Added in version 2.4.
Lexer for BQN¶
- class pygments.lexers.bqn.BQNLexer¶
- Short names:
bqn
- Filenames:
*.bqn
- MIME types:
None
A simple BQN lexer.
Added in version 2.16.
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.
Added in version 1.1.
- class pygments.lexers.business.CobolFreeformatLexer¶
- Short names:
cobolfree
- Filenames:
*.cbl, *.CBL
- MIME types:
None
Lexer for Free format OpenCOBOL code.
Added 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.
Added 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.
Added 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.
Added 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.
Added in version 1.5.
Lexers for C/C++ languages¶
- class pygments.lexers.c_cpp.CLexer¶
- Short names:
c
- Filenames:
*.c, *.h, *.idc, *.x[bp]m
- MIME types:
text/x-chdr, text/x-csrc, image/x-xbitmap, image/x-xpixmap
For C source code with preprocessor directives.
Additional options accepted:
- stdlibhighlighting
Highlight common types found in the C/C++ standard library (e.g. size_t). (default:
True
).- c99highlighting
Highlight common types found in the C99 standard library (e.g. int8_t). Actually, this includes all fixed-width integer types. (default:
True
).- c11highlighting
Highlight atomic types found in the C11 standard library (e.g. atomic_bool). (default:
True
).- platformhighlighting
Highlight common types found in the platform SDK headers (e.g. clockid_t on Linux). (default:
True
).
- class pygments.lexers.c_cpp.CppLexer¶
- Short names:
cpp, c++
- Filenames:
*.cpp, *.hpp, *.c++, *.h++, *.cc, *.hh, *.cxx, *.hxx, *.C, *.H, *.cp, *.CPP, *.tpp
- MIME types:
text/x-c++hdr, text/x-c++src
For C++ source code with preprocessor directives.
Additional options accepted:
- stdlibhighlighting
Highlight common types found in the C/C++ standard library (e.g. size_t). (default:
True
).- c99highlighting
Highlight common types found in the C99 standard library (e.g. int8_t). Actually, this includes all fixed-width integer types. (default:
True
).- c11highlighting
Highlight atomic types found in the C11 standard library (e.g. atomic_bool). (default:
True
).- platformhighlighting
Highlight common types found in the platform SDK headers (e.g. clockid_t on Linux). (default:
True
).
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++
Added in version 2.1.
- class pygments.lexers.c_like.CharmciLexer¶
- Short names:
charmci
- Filenames:
*.ci
- MIME types:
None
For Charm++ interface files (.ci).
Added in version 2.4.
- class pygments.lexers.c_like.ClayLexer¶
- Short names:
clay
- Filenames:
*.clay
- MIME types:
text/x-clay
For Clay source.
Added 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.
Added 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.
Added 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.
Added 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.
Added in version 2.0.
- class pygments.lexers.c_like.OmgIdlLexer¶
- Short names:
omg-idl
- Filenames:
*.idl, *.pidl
- MIME types:
None
Lexer for Object Management Group Interface Definition Language.
Added in version 2.9.
- class pygments.lexers.c_like.PikeLexer¶
- Short names:
pike
- Filenames:
*.pike, *.pmod
- MIME types:
text/x-pike
For Pike source code.
Added in version 2.0.
- class pygments.lexers.c_like.PromelaLexer¶
- Short names:
promela
- Filenames:
*.pml, *.prom, *.prm, *.promela, *.pr, *.pm
- MIME types:
text/x-promela
For the Promela language used with SPIN.
Added in version 2.18.
- class pygments.lexers.c_like.SwigLexer¶
- Short names:
swig
- Filenames:
*.swg, *.i
- MIME types:
text/swig
For SWIG source code.
Added 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.
Added in version 1.1.
Lexers for the Cap’n Proto schema language¶
- class pygments.lexers.capnproto.CapnProtoLexer¶
- Short names:
capnp
- Filenames:
*.capnp
- MIME types:
None
For Cap’n Proto source.
Added in version 2.2.
Lexers for the Carbon programming language¶
- class pygments.lexers.carbon.CarbonLexer¶
- Short names:
carbon
- Filenames:
*.carbon
- MIME types:
text/x-carbon
For Carbon source.
Added in version 2.15.
Lexer for the Concise data definition language (CDDL), a notational¶
- class pygments.lexers.cddl.CddlLexer¶
- Short names:
cddl
- Filenames:
*.cddl
- MIME types:
text/x-cddl
Lexer for CDDL definitions.
Added in version 2.8.
Lexer for the Chapel language¶
- class pygments.lexers.chapel.ChapelLexer¶
- Short names:
chapel, chpl
- Filenames:
*.chpl
- MIME types:
None
For Chapel source.
Added in version 2.0.
Lexer for the Clean language¶
- class pygments.lexers.clean.CleanLexer¶
- Short names:
clean
- Filenames:
*.icl, *.dcl
- MIME types:
None
Lexer for the general purpose, state-of-the-art, pure and lazy functional programming language Clean.
Lexer for COMAL-80¶
- class pygments.lexers.comal.Comal80Lexer¶
- Short names:
comal, comal80
- Filenames:
*.cml, *.comal
- MIME types:
None
For COMAL-80 source code.
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.
Added in version 0.6.
- class pygments.lexers.configs.AugeasLexer¶
- Short names:
augeas
- Filenames:
*.aug
- MIME types:
None
Lexer for Augeas.
Added in version 2.4.
- class pygments.lexers.configs.Cfengine3Lexer¶
- Short names:
cfengine3, cf3
- Filenames:
*.cf
- MIME types:
None
Lexer for CFEngine3 policy files.
Added in version 1.5.
- class pygments.lexers.configs.DesktopLexer¶
- Short names:
desktop
- Filenames:
*.desktop
- MIME types:
application/x-desktop
Lexer for .desktop files.
Added in version 2.16.
- class pygments.lexers.configs.DockerLexer¶
- Short names:
docker, dockerfile
- Filenames:
Dockerfile, *.docker
- MIME types:
text/x-dockerfile-config
Lexer for Docker configuration files.
Added in version 2.0.
- class pygments.lexers.configs.IniLexer¶
- Short names:
ini, cfg, dosini
- Filenames:
*.ini, *.cfg, *.inf, .editorconfig
- 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.
Added in version 1.6.
- class pygments.lexers.configs.LighttpdConfLexer¶
- Short names:
lighttpd, lighty
- Filenames:
lighttpd.conf
- MIME types:
text/x-lighttpd-conf
Lexer for Lighttpd configuration files.
Added in version 0.11.
- class pygments.lexers.configs.NestedTextLexer¶
- Short names:
nestedtext, nt
- Filenames:
*.nt
- MIME types:
None
Lexer for NextedText, a human-friendly data format.
Changed in version 2.16: Added support for NextedText v3.0.
Added in version 2.9.
- class pygments.lexers.configs.NginxConfLexer¶
- Short names:
nginx
- Filenames:
nginx.conf
- MIME types:
text/x-nginx-conf
Lexer for Nginx configuration files.
Added 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.
Added 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).
Added 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.
Note: trailing whitespace counts as part of the value as per spec
Added 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.
Added in version 1.6.
- class pygments.lexers.configs.SingularityLexer¶
- Short names:
singularity
- Filenames:
*.def, Singularity
- MIME types:
None
Lexer for Singularity definition files.
Added in version 2.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.
Added in version 0.9.
- class pygments.lexers.configs.SystemdLexer¶
- Short names:
systemd
- Filenames:
*.service, *.socket, *.device, *.mount, *.automount, *.swap, *.target, *.path, *.timer, *.slice, *.scope
- MIME types:
None
Lexer for systemd unit files.
Added in version 2.16.
- class pygments.lexers.configs.TOMLLexer¶
- Short names:
toml
- Filenames:
*.toml, Pipfile, poetry.lock
- MIME types:
application/toml
Lexer for TOML, a simple language for config files.
Added in version 2.4.
- 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.
Added 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.
Added in version 2.1.
- class pygments.lexers.configs.TerraformLexer¶
- Short names:
terraform, tf, hcl
- Filenames:
*.tf, *.hcl
- MIME types:
application/x-tf, application/x-terraform
Lexer for terraformi
.tf
files.Added in version 2.1.
- class pygments.lexers.configs.UnixConfigLexer¶
- Short names:
unixconfig, linuxconfig
- Filenames:
None
- MIME types:
None
Lexer for Unix/Linux config files using colon-separated values, e.g.
/etc/group
/etc/passwd
/etc/shadow
Added in version 2.12.
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.
Added 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”.
Added in version 2.0.
Lexer for the cplint language¶
- class pygments.lexers.cplint.CplintLexer¶
- Short names:
cplint
- Filenames:
*.ecl, *.prolog, *.pro, *.pl, *.P, *.lpad, *.cpl
- MIME types:
text/x-cplint
Lexer for cplint files, including CP-logic, Logic Programs with Annotated Disjunctions, Distributional Clauses syntax, ProbLog, DTProbLog.
Added in version 2.12.
Lexer for Crystal¶
- class pygments.lexers.crystal.CrystalLexer¶
- Short names:
cr, crystal
- Filenames:
*.cr
- MIME types:
text/x-crystal
For Crystal source code.
Added in version 2.2.
Lexers for Csound languages¶
- class pygments.lexers.csound.CsoundDocumentLexer¶
- Short names:
csound-document, csound-csd
- Filenames:
*.csd
- MIME types:
None
For Csound documents.
Added 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.
Added 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.JsonBareObjectLexer¶
- Short names:
None
- Filenames:
None
- MIME types:
None
For JSON data structures (with missing object curly braces).
Deprecated since version 2.8.0: Behaves the same as JsonLexer now.
Added in version 2.2.
- class pygments.lexers.data.JsonLdLexer¶
- Short names:
jsonld, json-ld
- Filenames:
*.jsonld
- MIME types:
application/ld+json
For JSON-LD linked data.
Added in version 2.0.
- class pygments.lexers.data.JsonLexer¶
- Short names:
json, json-object
- Filenames:
*.json, *.jsonl, *.ndjson, Pipfile.lock
- MIME types:
application/json, application/json-object, application/x-ndjson, application/jsonl, application/json-seq
For JSON data structures.
Javascript-style comments are supported (like
/* */
and//
), though comments are not part of the JSON specification. This allows users to highlight JSON as it is used in the wild.No validation is performed on the input JSON document.
Added 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.
Added in version 0.11.
Lexer for LilyPond¶
- class pygments.lexers.dax.DaxLexer¶
- Short names:
dax
- Filenames:
*.dax
- MIME types:
None
Lexer for Power BI DAX Referenced from: https://github.com/sql-bi/SyntaxHighlighterBrushDax
Added in version 2.15.
Lexers for Devicetree language¶
- class pygments.lexers.devicetree.DevicetreeLexer¶
- Short names:
devicetree, dts
- Filenames:
*.dts, *.dtsi
- MIME types:
text/x-c
Lexer for Devicetree files.
Added in version 2.7.
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
anddarcs send
.Added 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.
- class pygments.lexers.diff.WDiffLexer¶
- Short names:
wdiff
- Filenames:
*.wdiff
- MIME types:
None
A wdiff lexer.
Note that:
It only works with normal output (without options like
-l
).If the target files contain “[-”, “-]”, “{+”, or “+}”, especially they are unbalanced, the lexer will get confused.
Added in version 2.2.
Pygments lexers for DNS¶
- class pygments.lexers.dns.DnsZoneLexer¶
- Short names:
zone
- Filenames:
*.zone
- MIME types:
text/dns
Lexer for DNS zone file
Added in version 2.16.
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#, cs
- 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 categoryLo
are allowed.full
– all Unicode characters as specified in the C# specs are allowed. Note that this means a considerable slowdown since theLo
category has more than 40,000 characters in it!
The default value is
basic
.Added in version 0.8.
- class pygments.lexers.dotnet.FSharpLexer¶
- Short names:
fsharp, f#
- Filenames:
*.fs, *.fsi, *.fsx
- MIME types:
text/x-fsharp
For the F# language (version 3.0).
Added 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 categoryLo
are allowed.full
– all Unicode characters as specified in the C# specs are allowed. Note that this means a considerable slowdown since theLo
category has more than 40,000 characters in it!
The default value is
basic
.
Added 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, lobas, oobas, sobas, visual-basic, visualbasic
- Filenames:
*.vb, *.bas
- MIME types:
text/x-vbnet, text/x-vba
For Visual Basic.NET source code. Also LibreOffice Basic, OpenOffice Basic, and StarOffice Basic.
- class pygments.lexers.dotnet.XppLexer¶
- Short names:
xpp, x++
- Filenames:
*.xpp
- MIME types:
None
For X++ source code. This is based loosely on the CSharpLexer
Added in version 2.15.
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.
Added in version 2.0.
- class pygments.lexers.dsls.CrmshLexer¶
- Short names:
crmsh, pcmk
- Filenames:
*.crmsh, *.pcmk
- MIME types:
None
Lexer for crmsh configuration files for Pacemaker clusters.
Added in version 2.1.
- class pygments.lexers.dsls.FlatlineLexer¶
- Short names:
flatline
- Filenames:
None
- MIME types:
text/x-flatline
Lexer for Flatline expressions.
Added in version 2.2.
- class pygments.lexers.dsls.MscgenLexer¶
- Short names:
mscgen, msc
- Filenames:
*.msc
- MIME types:
None
For Mscgen files.
Added 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.
Added in version 2.0.
- class pygments.lexers.dsls.ProtoBufLexer¶
- Short names:
protobuf, proto
- Filenames:
*.proto
- MIME types:
None
Lexer for Protocol Buffer definition files.
Added in version 1.4.
- class pygments.lexers.dsls.PuppetLexer¶
- Short names:
puppet
- Filenames:
*.pp
- MIME types:
None
For Puppet configuration DSL.
Added 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.
Added in version 2.0.
- class pygments.lexers.dsls.SnowballLexer¶
- Short names:
snowball
- Filenames:
*.sbl
- MIME types:
None
Lexer for Snowball source code.
Added in version 2.2.
- class pygments.lexers.dsls.ThriftLexer¶
- Short names:
thrift
- Filenames:
*.thrift
- MIME types:
application/x-thrift
For Thrift interface definitions.
Added in version 2.1.
- class pygments.lexers.dsls.VGLLexer¶
- Short names:
vgl
- Filenames:
*.rpf
- MIME types:
None
For SampleManager VGL source code.
Added in version 1.6.
- class pygments.lexers.dsls.ZeekLexer¶
- Short names:
zeek, bro
- Filenames:
*.zeek, *.bro
- MIME types:
None
For Zeek scripts.
Added in version 2.5.
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.
This is based on a copy of the
RubyConsoleLexer
.Example
? let a = 1; => 1 ? a => 1
Added 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.
Added 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.
Added 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.
Added 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.
Added 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.
Added in version 2.1.
Lexer for the Elpi programming language¶
- class pygments.lexers.elpi.ElpiLexer¶
- Short names:
elpi
- Filenames:
*.elpi
- MIME types:
text/x-elpi
Lexer for the Elpi programming language.
Added in version 2.11.
Lexer for the raw E-mail¶
- class pygments.lexers.email.EmailLexer¶
- Short names:
email, eml
- Filenames:
*.eml
- MIME types:
message/rfc822
Lexer for raw E-mail.
Additional options accepted:
- highlight-X-header
Highlight the fields of
X-
user-defined email header. (default:False
).
Added in version 2.5.
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
Added in version 1.5.
- class pygments.lexers.erlang.ElixirLexer¶
- Short names:
elixir, ex, exs
- Filenames:
*.ex, *.eex, *.exs, *.leex
- MIME types:
text/x-elixir
For the Elixir language.
Added 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.
Added 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).
Added in version 1.1.
Lexers for esoteric languages¶
- class pygments.lexers.esoteric.AheuiLexer¶
- Short names:
aheui
- Filenames:
*.aheui
- MIME types:
None
Aheui is esoteric language based on Korean alphabets.
- class pygments.lexers.esoteric.BefungeLexer¶
- Short names:
befunge
- Filenames:
*.befunge
- MIME types:
application/x-befunge
Lexer for the esoteric Befunge language.
Added in version 0.7.
- 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.
Added in version 2.1.
- class pygments.lexers.esoteric.CapDLLexer¶
- Short names:
capdl
- Filenames:
*.cdl
- MIME types:
None
Basic lexer for CapDL.
The source of the primary tool that reads such specifications is available at https://github.com/seL4/capdl/tree/master/capDL-tool. Note that this lexer only supports a subset of the grammar. For example, identifiers can shadow type names, but these instances are currently incorrectly highlighted as types. Supporting this would need a stateful lexer that is considered unnecessarily complex for now.
Added in version 2.2.
- 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>.
Added 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.
Added 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.
Added 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.
Added 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.
Added in version 1.2.
Lexers for fift¶
- class pygments.lexers.fift.FiftLexer¶
- Short names:
fift, fif
- Filenames:
*.fif
- MIME types:
None
For Fift source code.
Lexer for FloScript¶
- class pygments.lexers.floscript.FloScriptLexer¶
- Short names:
floscript, flo
- Filenames:
*.flo
- MIME types:
None
For FloScript configuration language source code.
Added in version 2.4.
Lexer for the Forth language¶
- class pygments.lexers.forth.ForthLexer¶
- Short names:
forth
- Filenames:
*.frt, *.fs
- MIME types:
application/x-forth
Lexer for Forth files.
Added in version 2.2.
Lexers for Fortran languages¶
- class pygments.lexers.fortran.FortranFixedLexer¶
- Short names:
fortranfixed
- Filenames:
*.f, *.F
- MIME types:
None
Lexer for fixed format Fortran.
Added in version 2.1.
- class pygments.lexers.fortran.FortranLexer¶
- Short names:
fortran, f90
- Filenames:
*.f03, *.f90, *.F03, *.F90
- MIME types:
text/x-fortran
Lexer for FORTRAN 90 code.
Added 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.
Added in version 1.6.
Lexer for FreeFem++ language¶
- class pygments.lexers.freefem.FreeFemLexer¶
- Short names:
freefem
- Filenames:
*.edp
- MIME types:
text/x-freefem
For FreeFem++ source.
This is an extension of the CppLexer, as the FreeFem Language is a superset of C++.
Added in version 2.4.
Lexers for FunC¶
- class pygments.lexers.func.FuncLexer¶
- Short names:
func, fc
- Filenames:
*.fc, *.func
- MIME types:
None
For FunC source code.
Lexer for the Futhark language¶
- class pygments.lexers.futhark.FutharkLexer¶
- Short names:
futhark
- Filenames:
*.fut
- MIME types:
text/x-futhark
A Futhark lexer
Added in version 2.8.
Lexers for the G Code Language¶
- class pygments.lexers.gcodelexer.GcodeLexer¶
- Short names:
gcode
- Filenames:
*.gcode
- MIME types:
None
For gcode source code.
Added in version 2.9.
Lexer for GDScript¶
- class pygments.lexers.gdscript.GDScriptLexer¶
- Short names:
gdscript, gd
- Filenames:
*.gd
- MIME types:
text/x-gdscript, application/x-gdscript
For GDScript source code.
Lexer for the Gleam programming language¶
- class pygments.lexers.gleam.GleamLexer¶
- Short names:
gleam
- Filenames:
*.gleam
- MIME types:
text/x-gleam
Lexer for the Gleam programming language (version 1.0.0).
Added in version 2.18.
Lexers for the Google Go language¶
- class pygments.lexers.go.GoLexer¶
- Short names:
go, golang
- Filenames:
*.go
- MIME types:
text/x-gosrc
For Go source.
Added in version 1.2.
Lexers for grammar 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.
Added in version 2.1.
- class pygments.lexers.grammar_notation.BnfLexer¶
- Short names:
bnf
- Filenames:
*.bnf
- MIME types:
text/x-bnf
This lexer is for grammar 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 decision making might cause too minimal highlighting and you might be disappointed, but it is reasonable for us.
Added in version 2.1.
- class pygments.lexers.grammar_notation.JsgfLexer¶
- Short names:
jsgf
- Filenames:
*.jsgf
- MIME types:
application/jsgf, application/x-jsgf, text/jsgf
For JSpeech Grammar Format grammars.
Added in version 2.2.
- class pygments.lexers.grammar_notation.PegLexer¶
- Short names:
peg
- Filenames:
*.peg
- MIME types:
text/x-peg
This lexer is for Parsing Expression Grammars (PEG).
Various implementations of PEG have made different decisions regarding the syntax, so let’s try to be accommodating:
<-, ←, :, and = are all accepted as rule operators.
Both | and / are choice operators.
^, ↑, and ~ are cut operators.
A single a-z character immediately before a string, or multiple a-z characters following a string, are part of the string (e.g., r”…” or “…”ilmsuxa).
Added in version 2.6.
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 3.3
Added in version 2.0.
Lexer for GraphQL, an open-source data query and manipulation¶
- class pygments.lexers.graphql.GraphQLLexer¶
- Short names:
graphql
- Filenames:
*.graphql
- MIME types:
None
Lexer for GraphQL syntax
Added in version 2.16.
Lexer for the DOT language (graphviz)¶
- class pygments.lexers.graphviz.GraphvizLexer¶
- Short names:
graphviz, dot
- Filenames:
*.gv, *.dot
- MIME types:
text/x-graphviz, text/vnd.graphviz
For graphviz DOT graph description language.
Added in version 2.8.
Lexers for TigerGraph GSQL graph query language¶
- class pygments.lexers.gsql.GSQLLexer¶
- Short names:
gsql
- Filenames:
*.gsql
- MIME types:
None
For GSQL queries (version 3.x).
Added in version 2.10.
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.
Added 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.
Added in version 1.4.
- class pygments.lexers.hdl.VhdlLexer¶
- Short names:
vhdl
- Filenames:
*.vhdl, *.vhd
- MIME types:
text/x-vhdl
For VHDL source code.
Added 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
andxxd
, and the DOS toolDEBUG
. 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 ashexdump -C FILE
.hexcat FILE
od -t x1z FILE
xxd FILE
DEBUG.EXE FILE.COM
and enteringd
to the prompt.
Added 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).
Added 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).
Added in version 2.0.
Lexers for installer/packager DSLs and formats¶
- class pygments.lexers.installers.DebianControlLexer¶
- Short names:
debcontrol, control
- Filenames:
control
- MIME types:
None
Lexer for Debian
control
files andapt-cache show <pkg>
outputs.Added in version 0.9.
- class pygments.lexers.installers.DebianSourcesLexer¶
- Short names:
debian.sources
- Filenames:
*.sources
- MIME types:
None
Lexer that highlights debian.sources files.
Added in version 2.19.
- class pygments.lexers.installers.NSISLexer¶
- Short names:
nsis, nsi, nsh
- Filenames:
*.nsi, *.nsh
- MIME types:
text/x-nsis
For NSIS scripts.
Added in version 1.6.
- class pygments.lexers.installers.RPMSpecLexer¶
- Short names:
spec
- Filenames:
*.spec
- MIME types:
text/x-rpm-spec
For RPM
.spec
files.Added in version 1.6.
- class pygments.lexers.installers.SourcesListLexer¶
- Short names:
debsources, sourceslist, sources.list
- Filenames:
sources.list
- MIME types:
None
Lexer that highlights debian sources.list files.
Added 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.
Added in version 2.0.
- class pygments.lexers.int_fiction.Inform6TemplateLexer¶
- Short names:
i6t
- Filenames:
*.i6t
- MIME types:
None
For Inform 6 template code.
Added 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.
Added 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.
Added 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.
Added in version 2.1.
Lexers for the JMESPath language¶
- class pygments.lexers.jmespath.JMESPathLexer¶
- Short names:
jmespath, jp
- Filenames:
*.jp
- MIME types:
None
For JMESPath queries.
Lexers for the JSLT language¶
- class pygments.lexers.jslt.JSLTLexer¶
- Short names:
jslt
- Filenames:
*.jslt
- MIME types:
text/x-jslt
For JSLT source.
Added in version 2.10.
Lexer for Json5 file format¶
- class pygments.lexers.json5.Json5Lexer¶
- Short names:
json5
- Filenames:
*.json5
- MIME types:
None
Lexer for JSON5 data structures.
Added in version 2.19.
Lexer for Jsonnet data templating language¶
- class pygments.lexers.jsonnet.JsonnetLexer¶
- Short names:
jsonnet
- Filenames:
*.jsonnet, *.libsonnet
- MIME types:
None
Lexer for Jsonnet source code.
Lexers for JSX (React) and TSX (TypeScript flavor)¶
- class pygments.lexers.jsx.JsxLexer¶
- Short names:
jsx, react
- Filenames:
*.jsx, *.react
- MIME types:
text/jsx, text/typescript-jsx
For JavaScript Syntax Extension (JSX).
Added in version 2.17.
- class pygments.lexers.jsx.TsxLexer¶
- Short names:
tsx
- Filenames:
*.tsx
- MIME types:
text/typescript-tsx
For TypeScript with embedded JSX
Added in version 2.19.
Lexers for the Julia language¶
- class pygments.lexers.julia.JuliaConsoleLexer¶
- Short names:
jlcon, julia-repl
- Filenames:
None
- MIME types:
None
For Julia console sessions. Modeled after MatlabSessionLexer.
Example
julia> x = 2 2 julia> \"\"\" The factorial function. ```julia @assert fac(3) == 1 * 2 * 3 ``` \"\"\" function fac(n) if n < 2 return 1 else return n * fac(n - 1) # <-- recursive call end end # Lets try the function out... f(x + 1) 6
Added 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.
Added 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.
Added in version 1.6.
- class pygments.lexers.jvm.CeylonLexer¶
- Short names:
ceylon
- Filenames:
*.ceylon
- MIME types:
text/x-ceylon
For Ceylon source code.
Added in version 1.6.
- class pygments.lexers.jvm.ClojureLexer¶
- Short names:
clojure, clj
- Filenames:
*.clj, *.cljc
- MIME types:
text/x-clojure, application/x-clojure
Lexer for Clojure source code.
Added 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.
Added in version 2.0.
- class pygments.lexers.jvm.GoloLexer¶
- Short names:
golo
- Filenames:
*.golo
- MIME types:
None
For Golo source code.
Added 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.
Added in version 1.5.
- class pygments.lexers.jvm.GosuTemplateLexer¶
- Short names:
gst
- Filenames:
*.gst
- MIME types:
text/x-gosu-template
For Gosu templates.
Added in version 1.5.
- class pygments.lexers.jvm.GroovyLexer¶
- Short names:
groovy
- Filenames:
*.groovy, *.gradle
- MIME types:
text/x-groovy
For Groovy source code.
Added 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.
Added in version 1.4.
- class pygments.lexers.jvm.JasminLexer¶
- Short names:
jasmin, jasminxt
- Filenames:
*.j
- MIME types:
None
For Jasmin assembly code.
Added 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, *.kts
- MIME types:
text/x-kotlin
For Kotlin source code.
Added in version 1.5.
- class pygments.lexers.jvm.PigLexer¶
- Short names:
pig
- Filenames:
*.pig
- MIME types:
text/x-pig
For Pig Latin source code.
Added in version 2.0.
- class pygments.lexers.jvm.SarlLexer¶
- Short names:
sarl
- Filenames:
*.sarl
- MIME types:
text/x-sarl
For SARL source code.
Added in version 2.4.
- 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.
Added in version 1.6.
Lexers for the Kuin language¶
- class pygments.lexers.kuin.KuinLexer¶
- Short names:
kuin
- Filenames:
*.kn
- MIME types:
None
For Kuin source code.
Added in version 2.9.
Lexers for Kusto Query Language (KQL)¶
- class pygments.lexers.kusto.KustoLexer¶
- Short names:
kql, kusto
- Filenames:
*.kql, *.kusto, .csl
- MIME types:
None
For Kusto Query Language source code.
Added in version 2.17.
Pygments lexers for LDAP¶
- class pygments.lexers.ldap.LdaprcLexer¶
- Short names:
ldapconf, ldaprc
- Filenames:
.ldaprc, ldaprc, ldap.conf
- MIME types:
text/x-ldapconf
Lexer for OpenLDAP configuration files.
Added in version 2.17.
- class pygments.lexers.ldap.LdifLexer¶
- Short names:
ldif
- Filenames:
*.ldif
- MIME types:
text/x-ldif
Lexer for LDIF
Added in version 2.17.
Lexers for the Lean theorem prover¶
- class pygments.lexers.lean.Lean3Lexer¶
- Short names:
lean, lean3
- Filenames:
*.lean
- MIME types:
text/x-lean, text/x-lean3
For the Lean 3 theorem prover.
Added in version 2.0.
- class pygments.lexers.lean.Lean4Lexer¶
- Short names:
lean4
- Filenames:
*.lean
- MIME types:
text/x-lean4
For the Lean 4 theorem prover.
Added in version 2.18.
Lexer for LilyPond¶
- class pygments.lexers.lilypond.LilyPondLexer¶
- Short names:
lilypond
- Filenames:
*.ly
- MIME types:
None
Lexer for input to LilyPond, a text-based music typesetter.
Important
This lexer is meant to be used in conjunction with the
lilypond
style.Added in version 2.11.
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
Added 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.
Added in version 0.9.
- class pygments.lexers.lisp.EmacsLispLexer¶
- Short names:
emacs-lisp, elisp, emacs
- 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.
Added in version 2.1.
- class pygments.lexers.lisp.FennelLexer¶
- Short names:
fennel, fnl
- Filenames:
*.fnl
- MIME types:
None
A lexer for the Fennel programming language.
Fennel compiles to Lua, so all the Lua builtins are recognized as well as the special forms that are particular to the Fennel compiler.
Added in version 2.3.
- class pygments.lexers.lisp.HyLexer¶
- Short names:
hylang, hy
- Filenames:
*.hy
- MIME types:
text/x-hy, application/x-hy
Lexer for Hy source code.
Added in version 2.0.
- class pygments.lexers.lisp.JanetLexer¶
- Short names:
janet
- Filenames:
*.janet, *.jdn
- MIME types:
text/x-janet, application/x-janet
A lexer for the Janet programming language.
Added in version 2.18.
- class pygments.lexers.lisp.NewLispLexer¶
- Short names:
newlisp
- Filenames:
*.lsp, *.nl, *.kif
- MIME types:
text/x-newlisp, application/x-newlisp
For newLISP source code (version 10.3.0).
Added 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).
Added 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.
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.
Added 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.
Added in version 2.1.
- class pygments.lexers.lisp.XtlangLexer¶
- Short names:
extempore
- Filenames:
*.xtm
- MIME types:
None
An xtlang lexer for the Extempore programming environment.
This is a mixture of Scheme and xtlang, really. Keyword lists are taken from the Extempore Emacs mode (https://github.com/extemporelang/extempore-emacs-mode)
Added in version 2.2.
Lexer for Macaulay2¶
- class pygments.lexers.macaulay2.Macaulay2Lexer¶
- Short names:
macaulay2
- Filenames:
*.m2
- MIME types:
None
Lexer for Macaulay2, a software system for research in algebraic geometry.
Added in version 2.12.
Lexers for Makefiles and similar¶
- class pygments.lexers.make.BaseMakefileLexer¶
- Short names:
basemake
- Filenames:
None
- MIME types:
None
Lexer for simple Makefiles (no preprocessing).
Added 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.
Added 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.
Added in version 0.6.
- class pygments.lexers.markup.GroffLexer¶
- Short names:
groff, nroff, man
- Filenames:
*.[1-9], *.man, *.1p, *.3pm
- MIME types:
application/x-troff, text/troff
Lexer for the (g)roff typesetting language, supporting groff extensions. Mainly useful for highlighting manpage sources.
Added in version 0.6.
- class pygments.lexers.markup.MarkdownLexer¶
- Short names:
markdown, md
- Filenames:
*.md, *.markdown
- MIME types:
text/x-markdown
For Markdown markup.
Added in version 2.2.
- class pygments.lexers.markup.MoinWikiLexer¶
- Short names:
trac-wiki, moin
- Filenames:
None
- MIME types:
text/x-trac-wiki
For MoinMoin (and Trac) Wiki markup.
Added 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.
Added 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.
Added 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.
Added 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.
Added 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.
Added in version 2.0.
- class pygments.lexers.markup.OrgLexer¶
- Short names:
org, orgmode, org-mode
- Filenames:
*.org
- MIME types:
text/org
For Org Mode markup.
Added in version 2.18.
- class pygments.lexers.markup.RstLexer¶
- Short names:
restructuredtext, rst, rest
- Filenames:
*.rst, *.rest
- MIME types:
text/x-rst, text/prs.fallenstein.rst
For reStructuredText markup.
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
).Added in version 0.8.
Added in version 0.7.
- 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.
- class pygments.lexers.markup.TiddlyWiki5Lexer¶
- Short names:
tid
- Filenames:
*.tid
- MIME types:
text/vnd.tiddlywiki
For TiddlyWiki5 markup.
Added in version 2.7.
- class pygments.lexers.markup.WikitextLexer¶
- Short names:
wikitext, mediawiki
- Filenames:
None
- MIME types:
text/x-wiki
For MediaWiki Wikitext.
Parsing Wikitext is tricky, and results vary between different MediaWiki installations, so we only highlight common syntaxes (built-in or from popular extensions), and also assume templates produce no unbalanced syntaxes.
Added in version 2.15.
Lexer for the computer algebra system Maxima¶
- class pygments.lexers.maxima.MaximaLexer¶
- Short names:
maxima, macsyma
- Filenames:
*.mac, *.max
- MIME types:
None
A Maxima lexer. Derived from pygments.lexers.MuPADLexer.
Added in version 2.11.
Pygments lexer for the Meson build system¶
- class pygments.lexers.meson.MesonLexer¶
- Short names:
meson, meson.build
- Filenames:
meson.build, mesonoptions.txt
- MIME types:
text/x-meson
Meson language lexer.
The grammar definition use to transcribe the syntax was retrieved from https://mesonbuild.com/Syntax.html#grammar for version 0.58. Some of those definitions are improperly transcribed, so the Meson++ implementation was also checked: https://github.com/dcbaker/meson-plus-plus.
Added in version 2.10.
Lexer for Multipurpose Internet Mail Extensions (MIME) data¶
- class pygments.lexers.mime.MIMELexer¶
- Short names:
mime
- Filenames:
None
- MIME types:
multipart/mixed, multipart/related, multipart/alternative
Lexer for Multipurpose Internet Mail Extensions (MIME) data. This lexer is designed to process nested multipart data.
It assumes that the given data contains both header and body (and is split at an empty line). If no valid header is found, then the entire data will be treated as body.
Additional options accepted:
- MIME-max-level
Max recursion level for nested MIME structure. Any negative number would treated as unlimited. (default: -1)
- Content-Type
Treat the data as a specific content type. Useful when header is missing, or this lexer would try to parse from header. (default: text/plain)
- Multipart-Boundary
Set the default multipart boundary delimiter. This option is only used when Content-Type is multipart and header is missing. This lexer would try to parse from header by default. (default: None)
- Content-Transfer-Encoding
Treat the data as a specific encoding. Or this lexer would try to parse from header by default. (default: None)
Added in version 2.5.
Lexers for MIPS assembly¶
- class pygments.lexers.mips.MIPSLexer¶
- Short names:
mips
- Filenames:
*.mips, *.MIPS
- MIME types:
None
A MIPS Assembly Lexer.
Based on the Emacs major mode by hlissner: https://github.com/hlissner/emacs-mips-mode
Lexers for ML family languages¶
- class pygments.lexers.ml.FStarLexer¶
- Short names:
fstar
- Filenames:
*.fst, *.fsti
- MIME types:
text/x-fstar
For the F* language.
Added in version 2.7.
- class pygments.lexers.ml.OcamlLexer¶
- Short names:
ocaml
- Filenames:
*.ml, *.mli, *.mll, *.mly
- MIME types:
text/x-ocaml
For the OCaml language.
Added in version 0.7.
- class pygments.lexers.ml.OpaLexer¶
- Short names:
opa
- Filenames:
*.opa
- MIME types:
text/x-opa
Lexer for the Opa language.
Added in version 1.5.
- class pygments.lexers.ml.ReasonLexer¶
- Short names:
reasonml, reason
- Filenames:
*.re, *.rei
- MIME types:
text/x-reasonml
For the ReasonML language.
Added in version 2.6.
- 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.
Added 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.
Added in version 1.6.
- class pygments.lexers.modeling.JagsLexer¶
- Short names:
jags
- Filenames:
*.jag, *.bug
- MIME types:
None
Pygments Lexer for JAGS.
Added in version 1.6.
- class pygments.lexers.modeling.ModelicaLexer¶
- Short names:
modelica
- Filenames:
*.mo
- MIME types:
text/x-modelica
For Modelica source code.
Added in version 1.1.
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.
Changed in version 2.1: Added multi-dialect support.
Added in version 1.3.
Lexer for the Monte programming language¶
- class pygments.lexers.monte.MonteLexer¶
- Short names:
monte
- Filenames:
*.mt
- MIME types:
None
Lexer for the Monte programming language.
Added in version 2.2.
Lexers for the mosel language¶
- class pygments.lexers.mosel.MoselLexer¶
- Short names:
mosel
- Filenames:
*.mos
- MIME types:
None
For the Mosel optimization language.
Added in version 2.6.
Lexers for NCAR Command Language¶
- class pygments.lexers.ncl.NCLLexer¶
- Short names:
ncl
- Filenames:
*.ncl
- MIME types:
text/ncl
Lexer for NCL code.
Added in version 2.2.
Lexer for the Nim language (formerly known as Nimrod)¶
- class pygments.lexers.nimrod.NimrodLexer¶
- Short names:
nimrod, nim
- Filenames:
*.nim, *.nimrod
- MIME types:
text/x-nim
For Nim source code.
Added 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.
Added 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.
Added 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.
Added 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.
Added 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.
Added 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
Added in version 1.2.
Lexers for the OpenSCAD languages¶
- class pygments.lexers.openscad.OpenScadLexer¶
- Short names:
openscad
- Filenames:
*.scad
- MIME types:
application/x-openscad
For openSCAD code.
Added in version 2.16.
Lexer for ParaSail¶
- class pygments.lexers.parasail.ParaSailLexer¶
- Short names:
parasail
- Filenames:
*.psi, *.psl
- MIME types:
text/x-parasail
For ParaSail source code.
Added in version 2.1.
Lexers for parser generators¶
- class pygments.lexers.parsers.AntlrActionScriptLexer¶
- Short names:
antlr-actionscript, antlr-as
- Filenames:
*.G, *.g
- MIME types:
None
ANTLR with ActionScript Target
Added 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
Added in version 1.1.
- class pygments.lexers.parsers.AntlrCppLexer¶
- Short names:
antlr-cpp
- Filenames:
*.G, *.g
- MIME types:
None
ANTLR with C++ Target
Added in version 1.1.
- class pygments.lexers.parsers.AntlrJavaLexer¶
- Short names:
antlr-java
- Filenames:
*.G, *.g
- MIME types:
None
ANTLR with Java Target
Added in version 1.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.
Added in version 1.1.
- class pygments.lexers.parsers.AntlrObjectiveCLexer¶
- Short names:
antlr-objc
- Filenames:
*.G, *.g
- MIME types:
None
ANTLR with Objective-C Target
Added in version 1.1.
- class pygments.lexers.parsers.AntlrPerlLexer¶
- Short names:
antlr-perl
- Filenames:
*.G, *.g
- MIME types:
None
ANTLR with Perl Target
Added in version 1.1.
- class pygments.lexers.parsers.AntlrPythonLexer¶
- Short names:
antlr-python
- Filenames:
*.G, *.g
- MIME types:
None
ANTLR with Python Target
Added 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
Added 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.
Added 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.
Added in version 1.1.
- class pygments.lexers.parsers.RagelCppLexer¶
- Short names:
ragel-cpp
- Filenames:
*.rl
- MIME types:
None
A lexer for Ragel in a C++ host file.
Added 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.
Added 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.
Added 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.
Added 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, useRagelEmbeddedLexer
instead (or one of the language-specific subclasses).Added 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.
Added 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.
Added in version 1.1.
- class pygments.lexers.parsers.TreetopLexer¶
- Short names:
treetop
- Filenames:
*.treetop, *.tt
- MIME types:
None
A lexer for Treetop grammars.
Added in version 1.6.
Lexers for Pascal family languages¶
- class pygments.lexers.pascal.DelphiLexer¶
- Short names:
delphi, pas, pascal, objectpascal
- Filenames:
*.pas, *.dpr
- 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
andMath
. Default is to consider all of them builtin.
- class pygments.lexers.pascal.PortugolLexer¶
- Short names:
portugol
- Filenames:
*.alg, *.portugol
- MIME types:
None
For Portugol, a Pascal dialect with keywords in Portuguese.
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.
Added 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.
Added in version 1.6.
Lexers for Phix¶
- class pygments.lexers.phix.PhixLexer¶
- Short names:
phix
- Filenames:
*.exw
- MIME types:
text/x-phix
Pygments Lexer for Phix files (.exw). See http://phix.x10.mx
Added in version 2.14.
Lexers for Pointless¶
- class pygments.lexers.pointless.PointlessLexer¶
- Short names:
pointless
- Filenames:
*.ptls
- MIME types:
None
For Pointless source code.
Added in version 2.7.
Lexer for Praat¶
- class pygments.lexers.praat.PraatLexer¶
- Short names:
praat
- Filenames:
*.praat, *.proc, *.psc
- MIME types:
None
For Praat scripts.
Added in version 2.1.
Lexer for Procfile file format¶
- class pygments.lexers.procfile.ProcfileLexer¶
- Short names:
procfile
- Filenames:
Procfile
- MIME types:
None
Lexer for Procfile file format.
The format is used to run processes on Heroku or is used by Foreman or Honcho tools.
Added in version 2.10.
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.
Added 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 Prometheus Query Language¶
- class pygments.lexers.promql.PromQLLexer¶
- Short names:
promql
- Filenames:
*.promql
- MIME types:
None
For PromQL queries.
For details about the grammar see: https://github.com/prometheus/prometheus/tree/master/promql/parser
Lexer for the PRQL query language¶
- class pygments.lexers.prql.PrqlLexer¶
- Short names:
prql
- Filenames:
*.prql
- MIME types:
application/prql, application/x-prql
For PRQL source code.
grammar: https://github.com/PRQL/prql/tree/main/grammars
Added in version 2.17.
Lexer for other PTX language¶
Lexer for the Q programming language¶
- class pygments.lexers.q.KLexer¶
- Short names:
k
- Filenames:
*.k
- MIME types:
None
For K source code.
Added in version 2.12.
Lexer for the qlik scripting language¶
- class pygments.lexers.qlik.QlikLexer¶
- Short names:
qlik, qlikview, qliksense, qlikscript
- Filenames:
*.qvs, *.qvw
- MIME types:
None
Lexer for qlik code, including .qvs files
Added in version 2.12.
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 (https://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.
Example
R version 2.9.2 (2009-08-24) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. [R.app GUI 1.29 (5464) i386-apple-darwin8.11.1] > x <- function {} Error: syntax error > x <- function() {} > x <- function() { + cat("hello") + cat("world") + } > x function() { cat("hello") cat("world") } > x() helloworld > 2 + 2 [1] 4 >
- 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.
Added 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.
Added in version 0.10.
Lexers for semantic web and RDF query languages and markup¶
- class pygments.lexers.rdf.ShExCLexer¶
- Short names:
shexc, shex
- Filenames:
*.shex
- MIME types:
text/shex
Lexer for ShExC shape expressions language syntax.
- class pygments.lexers.rdf.SparqlLexer¶
- Short names:
sparql
- Filenames:
*.rq, *.sparql
- MIME types:
application/sparql-query
Lexer for SPARQL query language.
Added 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.
Added in version 2.1.
Lexer for resource definition files¶
- class pygments.lexers.resource.ResourceLexer¶
- Short names:
resourcebundle, resource
- Filenames:
None
- MIME types:
None
Lexer for ICU Resource bundles.
Added in version 2.0.
Lexer for the Ride programming language¶
- class pygments.lexers.ride.RideLexer¶
- Short names:
ride
- Filenames:
*.ride
- MIME types:
text/x-ride
For Ride source code.
Added in version 2.6.
Lexers for RITA language¶
- class pygments.lexers.rita.RitaLexer¶
- Short names:
rita
- Filenames:
*.rita
- MIME types:
text/rita
Lexer for RITA.
Added in version 2.11.
Lexer for Relax-NG Compact syntax¶
- class pygments.lexers.rnc.RNCCompactLexer¶
- Short names:
rng-compact, rnc
- Filenames:
*.rnc
- MIME types:
None
For RelaxNG-compact syntax.
Added in version 2.2.
Lexers for Roboconf DSL¶
- class pygments.lexers.roboconf.RoboconfGraphLexer¶
- Short names:
roboconf-graph
- Filenames:
*.graph
- MIME types:
None
Lexer for Roboconf graph files.
Added in version 2.1.
- class pygments.lexers.roboconf.RoboconfInstancesLexer¶
- Short names:
roboconf-instances
- Filenames:
*.instances
- MIME types:
None
Lexer for Roboconf instances files.
Added in version 2.1.
Lexer for Robot Framework¶
- class pygments.lexers.robotframework.RobotFrameworkLexer¶
- Short names:
robotframework
- Filenames:
*.robot, *.resource
- MIME types:
text/x-robotframework
For Robot Framework test data.
Supports both space and pipe separated plain text formats.
Added in version 1.6.
Lexers for the Rust language¶
- class pygments.lexers.rust.RustLexer¶
- Short names:
rust, rs
- Filenames:
*.rs, *.rs.in
- MIME types:
text/rust, text/x-rust
Lexer for the Rust programming language (version 1.47).
Added in version 1.6.
Lexer for SAS¶
- class pygments.lexers.sas.SASLexer¶
- Short names:
sas
- Filenames:
*.SAS, *.sas
- MIME types:
text/x-sas, text/sas, application/x-sas
For SAS files.
Added in version 2.2.
Lexer for Savi¶
- class pygments.lexers.savi.SaviLexer¶
- Short names:
savi
- Filenames:
*.savi
- MIME types:
None
For Savi source code.
Lexer for scdoc, a simple man page generator¶
- class pygments.lexers.scdoc.ScdocLexer¶
- Short names:
scdoc, scd
- Filenames:
*.scd, *.scdoc
- MIME types:
None
scdoc is a simple man page generator for POSIX systems written in C99.
Added in version 2.5.
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>.
Added in version 1.0.
- class pygments.lexers.scripting.ChaiscriptLexer¶
- Short names:
chaiscript, chai
- Filenames:
*.chai
- MIME types:
text/x-chaiscript, application/x-chaiscript
For ChaiScript source code.
Added 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.
Added in version 2.1.
- class pygments.lexers.scripting.HybrisLexer¶
- Short names:
hybris
- Filenames:
*.hyb
- MIME types:
text/x-hybris, application/x-hybris
For Hybris source code.
Added 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.
Added 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.
Added 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.LuauLexer¶
- Short names:
luau
- Filenames:
*.luau
- MIME types:
None
For Luau source code.
Additional options accepted:
- include_luau_builtins
If given and
True
, automatically highlight Luau builtins (default:True
).- include_roblox_builtins
If given and
True
, automatically highlight Roblox-specific builtins (default:False
).- additional_builtins
If given, must be a list of additional builtins to highlight.
- disabled_builtins
If given, must be a list of builtins that will not be highlighted.
Added in version 2.18.
- class pygments.lexers.scripting.MOOCodeLexer¶
- Short names:
moocode, moo
- Filenames:
*.moo
- MIME types:
text/x-moocode
For MOOCode (the MOO scripting language).
Added in version 0.9.
- class pygments.lexers.scripting.MiniScriptLexer¶
- Short names:
miniscript, ms
- Filenames:
*.ms
- MIME types:
text/x-minicript, application/x-miniscript
For MiniScript source code.
Added in version 2.6.
- class pygments.lexers.scripting.MoonScriptLexer¶
- Short names:
moonscript, moon
- Filenames:
*.moon
- MIME types:
text/x-moonscript, application/x-moonscript
For MoonScript source code.
Added 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.
Added in version 2.0.
Lexer for Smart Game Format (sgf) file format¶
- class pygments.lexers.sgf.SmartGameFormatLexer¶
- Short names:
sgf
- Filenames:
*.sgf
- MIME types:
None
Lexer for Smart Game Format (sgf) file format.
The format is used to store game records of board games for two players (mainly Go game).
Added in version 2.4.
Lexers for various shells¶
- class pygments.lexers.shell.BashLexer¶
- Short names:
bash, sh, ksh, zsh, shell, openrc
- Filenames:
*.sh, *.ksh, *.bash, *.ebuild, *.eclass, *.exheres-0, *.exlib, *.zsh, .bashrc, bashrc, .bash\*, bash\*, zshrc, .zshrc, .kshrc, kshrc, PKGBUILD
- MIME types:
application/x-sh, application/x-shellscript, text/x-shellscript
Lexer for (ba|k|z|)sh shell scripts.
Added 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 Bash shell sessions, i.e. command lines, including a prompt, interspersed with output.
Example
user@host:~/path$ ls -a . .. a b c user@host:~/path$ diff -u a b --- a 2008-07-26 17:10:07.000000000 -0700 +++ b 2008-07-26 17:10:10.000000000 -0700 @@ -1,3 +1,3 @@ a -b +x c user@host:~/path$ echo \ > a a user@host:~/path$ su root@host:~# sh-3.1$ # on hardy sh$ # on etch (virtualenv-name)user@host:~$ ls -a
Added in version 1.1.
- class pygments.lexers.shell.BatchLexer¶
- Short names:
batch, bat, dosbatch, winbatch
- Filenames:
*.bat, *.cmd
- MIME types:
application/x-dos-batch
Lexer for the DOS/Windows Batch file format.
Added in version 0.7.
- class pygments.lexers.shell.ExeclineLexer¶
- Short names:
execline
- Filenames:
*.exec
- MIME types:
None
Lexer for Laurent Bercot’s execline language.
Added in version 2.7.
- class pygments.lexers.shell.FishShellLexer¶
- Short names:
fish, fishshell
- Filenames:
*.fish, *.load
- MIME types:
application/x-fish
Lexer for Fish shell scripts.
Added in version 2.1.
- class pygments.lexers.shell.MSDOSSessionLexer¶
- Short names:
doscon
- Filenames:
None
- MIME types:
None
Lexer for MS DOS shell sessions, i.e. command lines, including a prompt, interspersed with output.
Example
[any]> dir > dir More? dir
Added in version 2.1.
- class pygments.lexers.shell.PowerShellLexer¶
- Short names:
powershell, pwsh, posh, ps1, psm1
- Filenames:
*.ps1, *.psm1
- MIME types:
text/x-powershell
For Windows PowerShell code.
Added in version 1.5.
- class pygments.lexers.shell.PowerShellSessionLexer¶
- Short names:
pwsh-session, ps1con
- Filenames:
None
- MIME types:
None
Lexer for PowerShell sessions, i.e. command lines, including a prompt, interspersed with output.
Example
PS[any]> Get-ChildItem PS> Get-ChildItem >> Get-ChildItem
Added in version 2.1.
- class pygments.lexers.shell.SlurmBashLexer¶
- Short names:
slurm, sbatch
- Filenames:
*.sl
- MIME types:
None
Lexer for (ba|k|z|)sh Slurm scripts.
Added in version 2.4.
- class pygments.lexers.shell.TcshLexer¶
- Short names:
tcsh, csh
- Filenames:
*.tcsh, *.csh
- MIME types:
application/x-csh
Lexer for tcsh scripts.
Added in version 0.10.
- class pygments.lexers.shell.TcshSessionLexer¶
- Short names:
tcshcon
- Filenames:
None
- MIME types:
None
Lexer for Tcsh sessions, i.e. command lines, including a prompt, interspersed with output.
Example
(any)> ls -lh ? ls -lh
Added in version 2.1.
Lexer for Sieve file format¶
- class pygments.lexers.sieve.SieveLexer¶
- Short names:
sieve
- Filenames:
*.siv, *.sieve
- MIME types:
None
Lexer for sieve format.
Added in version 2.6.
Lexer for the Slash programming language¶
- class pygments.lexers.slash.SlashLexer¶
- Short names:
slash
- Filenames:
*.sla
- MIME types:
None
Lexer for the Slash programming language.
Added in version 2.4.
Lexers for the Smithy IDL¶
- class pygments.lexers.smithy.SmithyLexer¶
- Short names:
smithy
- Filenames:
*.smithy
- MIME types:
None
For Smithy IDL
Added in version 2.10.
Lexers for the SMV languages¶
- class pygments.lexers.smv.NuSMVLexer¶
- Short names:
nusmv
- Filenames:
*.smv
- MIME types:
None
Lexer for the NuSMV language.
Added in version 2.2.
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.
Added in version 1.5.
Lexers for Solidity¶
- class pygments.lexers.solidity.SolidityLexer¶
- Short names:
solidity
- Filenames:
*.sol
- MIME types:
None
For Solidity source code.
Added in version 2.5.
Lexers for Soong (Android.bp Blueprint) files¶
- class pygments.lexers.soong.SoongLexer¶
- Short names:
androidbp, bp, soong
- Filenames:
Android.bp
- MIME types:
None
None
Added in version 2.18.
Lexer for Sophia¶
- class pygments.lexers.sophia.SophiaLexer¶
- Short names:
sophia
- Filenames:
*.aes
- MIME types:
None
A Sophia lexer.
Added in version 2.11.
Special lexers¶
- class pygments.lexers.special.OutputLexer¶
- Short names:
output
- Filenames:
None
- MIME types:
None
Simple lexer that highlights everything as
Token.Generic.Output
.Example
, \\`-._ __ \\\\ `-..____,.' `. :`. / \\`. : ) : : \\ ;' ' ; | : ).. .. .:.`.; : /::... .:::... ` ; ; _ ' __ /:\\ `:o> /\\o_> ;:. `. `-`.__ ; __..--- /:. \\ === \\_/ ;=====_.':. ; ,/'`--'...`--.... ; ; ; .' ; .' ; .' .. , . ; : ::.. / ;::. | / `.;::. | ;:.. ; : |:. : ;:. ; : :: ;:.. |. ; : :; :::....| | /\\ ,/ \\ ;:::::; ; .:. \\:..| : ; '.--| ; ::. :'' `-.,,; ;' ; ; .-'. _.'\\ / `; \\,__: \\ `---' `----' ; / \\,.,,,/ `----` fsc
Added in version 2.10.
- class pygments.lexers.special.RawTokenLexer¶
- Short names:
None
- Filenames:
None
- MIME types:
application/x-pygments-tokens
Recreate a token stream formatted with the RawTokenFormatter.
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.
Lexers for the Spice programming language¶
- class pygments.lexers.spice.SpiceLexer¶
- Short names:
spice, spicelang
- Filenames:
*.spice
- MIME types:
text/x-spice
For Spice source.
Added in version 2.11.
Lexers for .SRCINFO files used by Arch Linux Packages¶
- class pygments.lexers.srcinfo.SrcinfoLexer¶
- Short names:
srcinfo
- Filenames:
.SRCINFO
- MIME types:
None
Lexer for .SRCINFO files used by Arch Linux Packages.
Added in version 2.11.
Lexer for Stata¶
- class pygments.lexers.stata.StataLexer¶
- Short names:
stata, do
- Filenames:
*.do, *.ado
- MIME types:
text/x-stata, text/stata, application/x-stata
For Stata do files.
Added in version 2.2.
Lexer for SuperCollider¶
- class pygments.lexers.supercollider.SuperColliderLexer¶
- Short names:
supercollider, sc
- Filenames:
*.sc, *.scd
- MIME types:
application/supercollider, text/supercollider
For SuperCollider source code.
Added in version 2.1.
Lexer for LLVM’s TableGen DSL¶
- class pygments.lexers.tablegen.TableGenLexer¶
- Short names:
tablegen, td
- Filenames:
*.td
- MIME types:
None
Lexer for TableGen
Added in version 2.19.
Lexers for Tact¶
- class pygments.lexers.tact.TactLexer¶
- Short names:
tact
- Filenames:
*.tact
- MIME types:
None
For Tact source code.
Added in version 2.18.
Lexer for Uxntal¶
- class pygments.lexers.tal.TalLexer¶
- Short names:
tal, uxntal
- Filenames:
*.tal
- MIME types:
text/x-uxntal
For Uxntal source code.
Added in version 2.12.
Lexer for TEAL¶
- class pygments.lexers.teal.TealLexer¶
- Short names:
teal
- Filenames:
*.teal
- MIME types:
None
For the Transaction Execution Approval Language (TEAL)
For more information about the grammar, see: https://github.com/algorand/go-algorand/blob/master/data/transactions/logic/assembler.go
Added in version 2.9.
Lexers for various template engines’ markup¶
- class pygments.lexers.templates.Angular2HtmlLexer¶
- Short names:
html+ng2
- Filenames:
*.ng2
- MIME types:
None
Subclass of the Angular2Lexer that highlights unlexed data with the HtmlLexer.
Added in version 2.0.
- class pygments.lexers.templates.Angular2Lexer¶
- Short names:
ng2
- Filenames:
None
- MIME types:
None
Generic angular2 template lexer.
Highlights only the Angular template tags (stuff between {{ and }} and special attributes: ‘(event)=’, ‘[property]=’, ‘[(twoWayBinding)]=’). Everything else is left for a delegating lexer.
Added in version 2.1.
- 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:
javascript+cheetah, js+cheetah, javascript+spitfire, js+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
Added 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:
*.css.j2, *.css.jinja2
- 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+ruby, css+erb
- 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:
None
- MIME types:
text/html+evoque
Subclass of the EvoqueLexer that highlights unlexed data with the HtmlLexer.
Added 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.
Added in version 1.1.
- class pygments.lexers.templates.EvoqueXmlLexer¶
- Short names:
xml+evoque
- Filenames:
None
- MIME types:
application/xml+evoque
Subclass of the EvoqueLexer that highlights unlexed data with the XmlLexer.
Added 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
- 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.
Added in version 2.0.
- class pygments.lexers.templates.HandlebarsLexer¶
- Short names:
handlebars
- Filenames:
None
- MIME types:
None
Generic handlebars template lexer.
Highlights only the Handlebars template tags (stuff between {{ and }}). Everything else is left for a delegating lexer.
Added in version 2.0.
- class pygments.lexers.templates.HtmlDjangoLexer¶
- Short names:
html+django, html+jinja, htmldjango
- Filenames:
*.html.j2, *.htm.j2, *.xhtml.j2, *.html.jinja2, *.htm.jinja2, *.xhtml.jinja2
- 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
- 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:
javascript+django, js+django, javascript+jinja, js+jinja
- Filenames:
*.js.j2, *.js.jinja2
- 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:
javascript+ruby, js+ruby, javascript+erb, js+erb
- 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:
javascript+php, js+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:
javascript+smarty, js+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.
Added 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.
Added 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.
Added in version 1.6.
- class pygments.lexers.templates.LassoJavascriptLexer¶
- Short names:
javascript+lasso, js+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.
Added 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.
Added in version 1.6.
- class pygments.lexers.templates.LiquidLexer¶
- Short names:
liquid
- Filenames:
*.liquid
- MIME types:
None
Lexer for Liquid templates.
Added 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.
Added 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.
Added in version 0.7.
- class pygments.lexers.templates.MakoJavascriptLexer¶
- Short names:
javascript+mako, js+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.
Added 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.
Added 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.
Added 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.
Added 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.
Added 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.
Added in version 0.6.
- class pygments.lexers.templates.MyghtyJavascriptLexer¶
- Short names:
javascript+myghty, js+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.
Added 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.
Added 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.
Added 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.SqlJinjaLexer¶
- Short names:
sql+jinja
- Filenames:
*.sql, *.sql.j2, *.sql.jinja2
- MIME types:
None
Templated SQL lexer.
Added in version 2.13.
- class pygments.lexers.templates.SspLexer¶
- Short names:
ssp
- Filenames:
*.ssp
- MIME types:
application/x-ssp
Lexer for Scalate Server Pages.
Added in version 1.4.
- class pygments.lexers.templates.TeaTemplateLexer¶
- Short names:
tea
- Filenames:
*.tea
- MIME types:
text/x-tea
Lexer for Tea Templates.
Added 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.
Added 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.
Added 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:
*.xml.j2, *.xml.jinja2
- 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+ruby, xml+erb
- 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, *.yaml.j2, *.yml.j2, *.yaml.jinja2, *.yml.jinja2
- 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.
Added in version 2.0.
Lexer for Tera Term macro files¶
- class pygments.lexers.teraterm.TeraTermLexer¶
- Short names:
teratermmacro, teraterm, ttl
- Filenames:
*.ttl
- MIME types:
text/x-teratermmacro
For Tera Term macro source code.
Added in version 2.4.
Lexers for testing languages¶
- class pygments.lexers.testing.GherkinLexer¶
- Short names:
gherkin, cucumber
- Filenames:
*.feature
- MIME types:
text/x-gherkin
For Gherkin syntax.
Added in version 1.2.
- class pygments.lexers.testing.TAPLexer¶
- Short names:
tap
- Filenames:
*.tap
- MIME types:
None
For Test Anything Protocol (TAP) output.
Added 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.
Added in version 0.9.
- class pygments.lexers.textfmts.HttpLexer¶
- Short names:
http
- Filenames:
None
- MIME types:
None
Lexer for HTTP sessions.
Added 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.KernelLogLexer¶
- Short names:
kmsg, dmesg
- Filenames:
*.kmsg, *.dmesg
- MIME types:
None
For Linux Kernel log (“dmesg”) output.
Added in version 2.6.
- class pygments.lexers.textfmts.NotmuchLexer¶
- Short names:
notmuch
- Filenames:
None
- MIME types:
None
For Notmuch email text format.
Additional options accepted:
- body_lexer
If given, highlight the contents of the message body with the specified lexer, else guess it according to the body content (default:
None
).
Added in version 2.5.
- class pygments.lexers.textfmts.TodotxtLexer¶
- Short names:
todotxt
- Filenames:
todo.txt, *.todotxt
- MIME types:
text/x-todo
Lexer for Todo.txt todo list format.
Added 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.
Added in version 1.5.
- class pygments.lexers.theorem.IsabelleLexer¶
- Short names:
isabelle
- Filenames:
*.thy
- MIME types:
text/x-isabelle
For the Isabelle proof assistant.
Added in version 2.0.
Lexers for the ThingsDB language¶
- class pygments.lexers.thingsdb.ThingsDBLexer¶
- Short names:
ti, thingsdb
- Filenames:
*.ti
- MIME types:
None
Lexer for the ThingsDB programming language.
Added in version 2.9.
Lexers for TL-b¶
- class pygments.lexers.tlb.TlbLexer¶
- Short names:
tlb
- Filenames:
*.tlb
- MIME types:
None
For TL-b source code.
Lexers for the TLS presentation language¶
- class pygments.lexers.tls.TlsLexer¶
- Short names:
tls
- Filenames:
None
- MIME types:
None
The TLS presentation language, described in RFC 8446.
Added in version 2.16.
Lexer for Typographic Number Theory¶
- class pygments.lexers.tnt.TNTLexer¶
- Short names:
tnt
- Filenames:
*.tnt
- MIME types:
None
Lexer for Typographic Number Theory, as described in the book Gödel, Escher, Bach, by Douglas R. Hofstadter
Added in version 2.7.
Lexer for RiverBed’s TrafficScript (RTS) language¶
- class pygments.lexers.trafficscript.RtsLexer¶
- Short names:
trafficscript, rts
- Filenames:
*.rts
- MIME types:
None
For Riverbed Stingray Traffic Manager
Added in version 2.1.
Lexers for TypoScript¶
- class pygments.lexers.typoscript.TypoScriptCssDataLexer¶
- Short names:
typoscriptcssdata
- Filenames:
None
- MIME types:
None
Lexer that highlights markers, constants and registers within css blocks.
Added in version 2.2.
- class pygments.lexers.typoscript.TypoScriptHtmlDataLexer¶
- Short names:
typoscripthtmldata
- Filenames:
None
- MIME types:
None
Lexer that highlights markers, constants and registers within html tags.
Added in version 2.2.
- class pygments.lexers.typoscript.TypoScriptLexer¶
- Short names:
typoscript
- Filenames:
*.typoscript
- MIME types:
text/x-typoscript
Lexer for TypoScript code.
Added in version 2.2.
Lexers for Typst language¶
- class pygments.lexers.typst.TypstLexer¶
- Short names:
typst
- Filenames:
*.typ
- MIME types:
text/x-typst
For Typst code.
Additional options accepted:
- start
Specifies the starting state of the lexer (one of ‘markup’, ‘math’, ‘code’). The default is ‘markup’.
Added in version 2.18.
Lexer for the UL4 templating language¶
- class pygments.lexers.ul4.CSSUL4Lexer¶
- Short names:
css+ul4
- Filenames:
*.cssul4
- MIME types:
None
Lexer for UL4 embedded in CSS.
- class pygments.lexers.ul4.HTMLUL4Lexer¶
- Short names:
html+ul4
- Filenames:
*.htmlul4
- MIME types:
None
Lexer for UL4 embedded in HTML.
- class pygments.lexers.ul4.JavascriptUL4Lexer¶
- Short names:
js+ul4
- Filenames:
*.jsul4
- MIME types:
None
Lexer for UL4 embedded in Javascript.
- class pygments.lexers.ul4.PythonUL4Lexer¶
- Short names:
py+ul4
- Filenames:
*.pyul4
- MIME types:
None
Lexer for UL4 embedded in Python.
- class pygments.lexers.ul4.UL4Lexer¶
- Short names:
ul4
- Filenames:
*.ul4
- MIME types:
None
Generic lexer for UL4.
Added in version 2.12.
- class pygments.lexers.ul4.XMLUL4Lexer¶
- Short names:
xml+ul4
- Filenames:
*.xmlul4
- MIME types:
None
Lexer for UL4 embedded in XML.
Lexers for the Icon and Unicon languages, including ucode VM¶
- class pygments.lexers.unicon.IconLexer¶
- Short names:
icon
- Filenames:
*.icon, *.ICON
- MIME types:
None
Lexer for Icon.
Added in version 1.6.
- class pygments.lexers.unicon.UcodeLexer¶
- Short names:
ucode
- Filenames:
*.u, *.u1, *.u2
- MIME types:
None
Lexer for Icon ucode files.
Added in version 2.4.
- class pygments.lexers.unicon.UniconLexer¶
- Short names:
unicon
- Filenames:
*.icn
- MIME types:
text/unicon
For Unicon source code.
Added in version 2.4.
Lexers for UrbiScript language¶
- class pygments.lexers.urbi.UrbiscriptLexer¶
- Short names:
urbiscript
- Filenames:
*.u
- MIME types:
application/x-urbiscript
For UrbiScript source code.
Added in version 1.5.
The module that parses Pixar’s Universal Scene Description file format¶
- class pygments.lexers.usd.UsdLexer¶
- Short names:
usd, usda
- Filenames:
*.usd, *.usda
- MIME types:
None
A lexer that parses Pixar’s Universal Scene Description file format.
Added in version 2.6.
Lexers for Varnish configuration¶
- class pygments.lexers.varnish.VCLLexer¶
- Short names:
vcl
- Filenames:
*.vcl
- MIME types:
text/x-vclsrc
For Varnish Configuration Language (VCL).
Added in version 2.2.
- class pygments.lexers.varnish.VCLSnippetLexer¶
- Short names:
vclsnippets, vclsnippet
- Filenames:
None
- MIME types:
text/x-vclsnippet
For Varnish Configuration Language snippets.
Added in version 2.2.
Lexer for Intermediate Verification Languages (IVLs)¶
- class pygments.lexers.verification.BoogieLexer¶
- Short names:
boogie
- Filenames:
*.bpl
- MIME types:
None
For Boogie source code.
Added in version 2.1.
- class pygments.lexers.verification.SilverLexer¶
- Short names:
silver
- Filenames:
*.sil, *.vpr
- MIME types:
None
For Silver source code.
Added in version 2.2.
Lexers for Verifpal languages¶
- class pygments.lexers.verifpal.VerifpalLexer¶
- Short names:
verifpal
- Filenames:
*.vp
- MIME types:
text/x-verifpal
For Verifpal code.
Added in version 2.16.
Lexers for Visual Prolog & Grammar files¶
- class pygments.lexers.vip.VisualPrologGrammarLexer¶
- Short names:
visualprologgrammar
- Filenames:
*.vipgrm
- MIME types:
None
Lexer for VisualProlog grammar
Added in version 2.17.
- class pygments.lexers.vip.VisualPrologLexer¶
- Short names:
visualprolog
- Filenames:
*.pro, *.cl, *.i, *.pack, *.ph
- MIME types:
None
Lexer for VisualProlog
Added in version 2.17.
Lexer for the Vyper Smart Contract language¶
- class pygments.lexers.vyper.VyperLexer¶
- Short names:
vyper
- Filenames:
*.vy
- MIME types:
None
For the Vyper smart contract language.
Added in version 2.17.
Lexers for the WebAssembly text format¶
- class pygments.lexers.webassembly.WatLexer¶
- Short names:
wast, wat
- Filenames:
*.wat, *.wast
- MIME types:
None
Lexer for the WebAssembly text format.
Added in version 2.9.
Lexers for Web IDL, including some extensions¶
- class pygments.lexers.webidl.WebIDLLexer¶
- Short names:
webidl
- Filenames:
*.webidl
- MIME types:
None
For Web IDL.
Added in version 2.6.
Lexers for misc. web stuff¶
- class pygments.lexers.webmisc.CirruLexer¶
- Short names:
cirru
- Filenames:
*.cirru
- MIME types:
text/x-cirru
using
()
for expressions, but restricted in a same lineusing
""
for strings, with\
for escaping charsusing
$
as folding operatorusing
,
as unfolding operatorusing indentations for nested blocks
Added 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.
Added 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.
Added in version 1.6.
- class pygments.lexers.webmisc.SlimLexer¶
- Short names:
slim
- Filenames:
*.slim
- MIME types:
text/x-slim
For Slim markup.
Added 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.
Added in version 1.4.
Lexer for the WebGPU Shading Language¶
- class pygments.lexers.wgsl.WgslLexer¶
- Short names:
wgsl
- Filenames:
*.wgsl
- MIME types:
text/wgsl
Lexer for the WebGPU Shading Language.
Added in version 2.15.
Lexers for the Whiley language¶
- class pygments.lexers.whiley.WhileyLexer¶
- Short names:
whiley
- Filenames:
*.whiley
- MIME types:
text/x-whiley
Lexer for the Whiley programming language.
Added in version 2.2.
Lexer for World of Warcraft TOC files¶
- class pygments.lexers.wowtoc.WoWTocLexer¶
- Short names:
wowtoc
- Filenames:
*.toc
- MIME types:
None
Lexer for World of Warcraft TOC files.
Added in version 2.14.
Lexer for Wren¶
- class pygments.lexers.wren.WrenLexer¶
- Short names:
wren
- Filenames:
*.wren
- MIME types:
None
For Wren source code, version 0.4.0.
Added in version 2.14.
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.
Added in version 2.2.
Lexers for Xorg configs¶
- class pygments.lexers.xorg.XorgLexer¶
- Short names:
xorg.conf
- Filenames:
xorg.conf
- MIME types:
None
Lexer for xorg.conf files.
Lexer for the YANG 1.1 modeling language. See RFC 7950¶
- class pygments.lexers.yang.YangLexer¶
- Short names:
yang
- Filenames:
*.yang
- MIME types:
application/yang
Lexer for YANG, based on RFC7950.
Added in version 2.7.
Lexers for YARA¶
- class pygments.lexers.yara.YaraLexer¶
- Short names:
yara, yar
- Filenames:
*.yar
- MIME types:
text/x-yara
For YARA rules
Added in version 2.16.
Lexers for Zig¶
- class pygments.lexers.zig.ZigLexer¶
- Short names:
zig
- Filenames:
*.zig
- MIME types:
text/zig
Lexer for the Zig language.
Iterating over all lexers¶
Added 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+ruby', 'xml+erb'), (), ())
As you can see, the return value is an iterator which yields tuples
in the form (name, aliases, filetypes, mimetypes)
.