可用的词库

本页列出了所有可用的内置词库和它们的选项。

目前,所有的 lexer 都支持这些选项:

stripnl

从输入中去除前导和尾部的 newline(默认:True

stripall

从输入中去除所有前导和尾部的空白(默认: False)。

ensurenl

确保输入以换行结束(默认: True)。这对某些以行方式消耗输入的 lexer 来说是必需的。

1.3 新版功能.

tabsize

如果给定且大于 0,在输入中展开标签(默认: 0)。

encoding

如果给定,必须是一个编码名称(如 "utf-8")。这个编码将被用来将输入的字符串转换为 Unicode(如果它还不是 Unicode 字符串的话)。默认的是 "guess"

如果这个选项被设置为 "guess",则使用简单的 UTF-8 与 Latin-1 检测;如果被设置为 "chardet",则使用 chardet 库 来猜测输入的编码。

0.6 新版功能.

“短名称” 字段列出了可与 get_lexer_by_name() 函数一起使用的标识符。

这些 lexer 是内置的,可以从 pygments.lexers 中导入:

Lexers for ActionScript and MXML

class pygments.lexers.actionscript.ActionScript3Lexer
短名称

actionscript3, as3

文件名

*.as

MIME 类型

application/x-actionscript3, text/x-actionscript3, text/actionscript3

For ActionScript 3 source code.

0.11 新版功能.

class pygments.lexers.actionscript.ActionScriptLexer
短名称

actionscript, as

文件名

*.as

MIME 类型

application/x-actionscript, text/x-actionscript, text/actionscript

For ActionScript source code.

0.9 新版功能.

class pygments.lexers.actionscript.MxmlLexer
短名称

mxml

文件名

*.mxml

MIME 类型

None

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

1.1 新版功能.

Lexers for computer algebra systems

class pygments.lexers.algebra.BCLexer
短名称

bc

文件名

*.bc

MIME 类型

None

A BC lexer.

2.1 新版功能.

class pygments.lexers.algebra.GAPLexer
短名称

gap

文件名

*.g, *.gd, *.gi, *.gap

MIME 类型

None

For GAP source code.

2.0 新版功能.

class pygments.lexers.algebra.MathematicaLexer
短名称

mathematica, mma, nb

文件名

*.nb, *.cdf, *.nbp, *.ma

MIME 类型

application/mathematica, application/vnd.wolfram.mathematica, application/vnd.wolfram.mathematica.package, application/vnd.wolfram.cdf

Lexer for Mathematica source code.

2.0 新版功能.

class pygments.lexers.algebra.MuPADLexer
短名称

mupad

文件名

*.mu

MIME 类型

None

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

0.8 新版功能.

Lexers for AmbientTalk language

class pygments.lexers.ambient.AmbientTalkLexer
短名称

ambienttalk, ambienttalk/2, at

文件名

*.at

MIME 类型

text/x-ambienttalk

Lexer for AmbientTalk source code.

2.0 新版功能.

Lexers for the AMDGPU ISA assembly

class pygments.lexers.amdgpu.AMDGPULexer
短名称

amdgpu

文件名

*.isa

MIME 类型

None

For AMD GPU assembly.

2.8 新版功能.

Lexers for the AMPL language

class pygments.lexers.ampl.AmplLexer
短名称

ampl

文件名

*.run

MIME 类型

None

For AMPL source code.

2.2 新版功能.

Lexers for ANSYS Parametric Design Language

class pygments.lexers.apdlexer.apdlexer
短名称

ansys, apdl

文件名

*.ans

MIME 类型

None

For APDL source code.

2.9 新版功能.

Lexers for APL

class pygments.lexers.apl.APLLexer
短名称

apl

文件名

*.apl, *.aplf, *.aplo, *.apln, *.aplc, *.apli, *.dyalog

MIME 类型

None

A simple APL lexer.

2.0 新版功能.

Lexer for Arrow

class pygments.lexers.arrow.ArrowLexer
短名称

arrow

文件名

*.arw

MIME 类型

None

Lexer for Arrow: https://pypi.org/project/py-arrow-lang/

2.7 新版功能.

Lexer for various ASCII armored files

class pygments.lexers.asc.AscLexer
短名称

asc, pem

文件名

*.asc, *.pem, iddsa, idecdsa, idecdsask, ided25519, ided25519sk, idrsa

MIME 类型

application/pgp-keys, application/pgp-encrypted, application/pgp-signature

Lexer for ASCII armored files, containing —–BEGIN/END …—– wrapped base64 data.

2.10 新版功能.

Lexers for assembly languages

class pygments.lexers.asm.CObjdumpLexer
短名称

c-objdump

文件名

*.c-objdump

MIME 类型

text/x-c-objdump

For the output of objdump -Sr on compiled C files.

class pygments.lexers.asm.Ca65Lexer
短名称

ca65

文件名

*.s

MIME 类型

None

For ca65 assembler sources.

1.6 新版功能.

class pygments.lexers.asm.CppObjdumpLexer
短名称

cpp-objdump, c++-objdumb, cxx-objdump

文件名

*.cpp-objdump, *.c++-objdump, *.cxx-objdump

MIME 类型

text/x-cpp-objdump

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

class pygments.lexers.asm.DObjdumpLexer
短名称

d-objdump

文件名

*.d-objdump

MIME 类型

text/x-d-objdump

For the output of objdump -Sr on compiled D files.

class pygments.lexers.asm.Dasm16Lexer
短名称

dasm16

文件名

*.dasm16, *.dasm

MIME 类型

text/x-dasm16

For DCPU-16 Assembly.

Check http://0x10c.com/doc/dcpu-16.txt

2.4 新版功能.

class pygments.lexers.asm.GasLexer
短名称

gas, asm

文件名

*.s, *.S

MIME 类型

text/x-gas

For Gas (AT&T) assembly code.

class pygments.lexers.asm.HsailLexer
短名称

hsail, hsa

文件名

*.hsail

MIME 类型

text/x-hsail

For HSAIL assembly code.

2.2 新版功能.

class pygments.lexers.asm.LlvmLexer
短名称

llvm

文件名

*.ll

MIME 类型

text/x-llvm

For LLVM assembly code.

class pygments.lexers.asm.LlvmMirBodyLexer
短名称

llvm-mir-body

文件名

None

MIME 类型

None

For LLVM MIR examples without the YAML wrapper.

For more information on LLVM MIR see https://llvm.org/docs/MIRLangRef.html.

2.6 新版功能.

class pygments.lexers.asm.LlvmMirLexer
短名称

llvm-mir

文件名

*.mir

MIME 类型

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.

For more information on LLVM MIR see https://llvm.org/docs/MIRLangRef.html.

2.6 新版功能.

class pygments.lexers.asm.NasmLexer
短名称

nasm

文件名

*.asm, *.ASM

MIME 类型

text/x-nasm

For Nasm (Intel) assembly code.

class pygments.lexers.asm.NasmObjdumpLexer
短名称

objdump-nasm

文件名

*.objdump-intel

MIME 类型

text/x-nasm-objdump

For the output of objdump -d -M intel.

2.0 新版功能.

class pygments.lexers.asm.ObjdumpLexer
短名称

objdump

文件名

*.objdump

MIME 类型

text/x-objdump

For the output of objdump -dr.

class pygments.lexers.asm.TasmLexer
短名称

tasm

文件名

*.asm, *.ASM, *.tasm

MIME 类型

text/x-tasm

For Tasm (Turbo Assembler) assembly code.

Lexers for automation scripting languages

class pygments.lexers.automation.AutoItLexer
短名称

autoit

文件名

*.au3

MIME 类型

text/x-autoit

For AutoIt files.

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

1.6 新版功能.

class pygments.lexers.automation.AutohotkeyLexer
短名称

autohotkey, ahk

文件名

*.ahk, *.ahkl

MIME 类型

text/x-autohotkey

For autohotkey source code.

1.4 新版功能.

Lexer for the BARE schema

class pygments.lexers.bare.BareLexer
短名称

bare

文件名

*.bare

MIME 类型

None

For BARE schema schema source.

2.7 新版功能.

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

class pygments.lexers.basic.BBCBasicLexer
短名称

bbcbasic

文件名

*.bbc

MIME 类型

None

BBC Basic was supplied on the BBC Micro, and later Acorn RISC OS. It is also used by BBC Basic For Windows.

2.4 新版功能.

class pygments.lexers.basic.BlitzBasicLexer
短名称

blitzbasic, b3d, bplus

文件名

*.bb, *.decls

MIME 类型

text/x-bb

For BlitzBasic source code.

2.0 新版功能.

class pygments.lexers.basic.BlitzMaxLexer
短名称

blitzmax, bmax

文件名

*.bmx

MIME 类型

text/x-bmx

For BlitzMax source code.

1.4 新版功能.

class pygments.lexers.basic.CbmBasicV2Lexer
短名称

cbmbas

文件名

*.bas

MIME 类型

None

For CBM BASIC V2 sources.

1.6 新版功能.

class pygments.lexers.basic.MonkeyLexer
短名称

monkey

文件名

*.monkey

MIME 类型

text/x-monkey

For Monkey source code.

1.6 新版功能.

class pygments.lexers.basic.QBasicLexer
短名称

qbasic, basic

文件名

*.BAS, *.bas

MIME 类型

text/basic

For QBasic source code.

2.0 新版功能.

class pygments.lexers.basic.VBScriptLexer
短名称

vbscript

文件名

*.vbs, *.VBS

MIME 类型

None

VBScript is scripting language that is modeled on Visual Basic.

2.4 新版功能.

Lexer for BDD(Behavior-driven development)

class pygments.lexers.bdd.BddLexer
短名称

bdd

文件名

*.feature

MIME 类型

text/x-bdd

Lexer for BDD(Behavior-driven development), which highlights not only keywords, but also comments, punctuations, strings, numbers, and variables.

2.11 新版功能.

Lexers for BibTeX bibliography data and styles

class pygments.lexers.bibtex.BSTLexer
短名称

bst, bst-pybtex

文件名

*.bst

MIME 类型

None

A lexer for BibTeX bibliography styles.

2.2 新版功能.

class pygments.lexers.bibtex.BibTeXLexer
短名称

bibtex, bib

文件名

*.bib

MIME 类型

text/x-bibtex

A lexer for BibTeX bibliography data format.

2.2 新版功能.

Lexers for the Boa language

class pygments.lexers.boa.BoaLexer
短名称

boa

文件名

*.boa

MIME 类型

None

Lexer for the Boa language.

2.4 新版功能.

Lexers for “business-oriented” languages

class pygments.lexers.business.ABAPLexer
短名称

abap

文件名

*.abap, *.ABAP

MIME 类型

text/x-abap

Lexer for ABAP, SAP’s integrated language.

1.1 新版功能.

class pygments.lexers.business.CobolFreeformatLexer
短名称

cobolfree

文件名

*.cbl, *.CBL

MIME 类型

None

Lexer for Free format OpenCOBOL code.

1.6 新版功能.

class pygments.lexers.business.CobolLexer
短名称

cobol

文件名

*.cob, *.COB, *.cpy, *.CPY

MIME 类型

text/x-cobol

Lexer for OpenCOBOL code.

1.6 新版功能.

class pygments.lexers.business.GoodDataCLLexer
短名称

gooddata-cl

文件名

*.gdc

MIME 类型

text/x-gooddata-cl

Lexer for GoodData-CL script files.

1.4 新版功能.

class pygments.lexers.business.MaqlLexer
短名称

maql

文件名

*.maql

MIME 类型

text/x-gooddata-maql, application/x-gooddata-maql

Lexer for GoodData MAQL scripts.

1.4 新版功能.

class pygments.lexers.business.OpenEdgeLexer
短名称

openedge, abl, progress

文件名

*.p, *.cls

MIME 类型

text/x-openedge, application/x-openedge

Lexer for OpenEdge ABL (formerly Progress) source code.

1.5 新版功能.

Lexers for C/C++ languages

class pygments.lexers.c_cpp.CLexer
短名称

c

文件名

*.c, *.h, *.idc

MIME 类型

text/x-chdr, text/x-csrc

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
短名称

cpp, c++

文件名

*.cpp, *.hpp, *.c++, *.h++, *.cc, *.hh, *.cxx, *.hxx, *.C, *.H, *.cp, *.CPP

MIME 类型

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
短名称

arduino

文件名

*.ino

MIME 类型

text/x-arduino

For Arduino(tm) source.

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

2.1 新版功能.

class pygments.lexers.c_like.CharmciLexer
短名称

charmci

文件名

*.ci

MIME 类型

None

For Charm++ interface files (.ci).

2.4 新版功能.

class pygments.lexers.c_like.ClayLexer
短名称

clay

文件名

*.clay

MIME 类型

text/x-clay

For Clay source.

2.0 新版功能.

class pygments.lexers.c_like.CudaLexer
短名称

cuda, cu

文件名

*.cu, *.cuh

MIME 类型

text/x-cuda

For NVIDIA CUDA™ source.

1.6 新版功能.

class pygments.lexers.c_like.ECLexer
短名称

ec

文件名

*.ec, *.eh

MIME 类型

text/x-echdr, text/x-ecsrc

For eC source code with preprocessor directives.

1.5 新版功能.

class pygments.lexers.c_like.MqlLexer
短名称

mql, mq4, mq5, mql4, mql5

文件名

*.mq4, *.mq5, *.mqh

MIME 类型

text/x-mql

For MQL4 and MQL5 source code.

2.0 新版功能.

class pygments.lexers.c_like.NesCLexer
短名称

nesc

文件名

*.nc

MIME 类型

text/x-nescsrc

For nesC source code with preprocessor directives.

2.0 新版功能.

class pygments.lexers.c_like.OmgIdlLexer
短名称

omg-idl

文件名

*.idl, *.pidl

MIME 类型

None

Lexer for Object Management Group Interface Definition Language.

2.9 新版功能.

class pygments.lexers.c_like.PikeLexer
短名称

pike

文件名

*.pike, *.pmod

MIME 类型

text/x-pike

For Pike source code.

2.0 新版功能.

class pygments.lexers.c_like.SwigLexer
短名称

swig

文件名

*.swg, *.i

MIME 类型

text/swig

For SWIG source code.

2.0 新版功能.

class pygments.lexers.c_like.ValaLexer
短名称

vala, vapi

文件名

*.vala, *.vapi

MIME 类型

text/x-vala

For Vala source code with preprocessor directives.

1.1 新版功能.

Lexers for the Cap’n Proto schema language

class pygments.lexers.capnproto.CapnProtoLexer
短名称

capnp

文件名

*.capnp

MIME 类型

None

For Cap’n Proto source.

2.2 新版功能.

Lexer for the Concise data definition language (CDDL), a notational

class pygments.lexers.cddl.CddlLexer
短名称

cddl

文件名

*.cddl

MIME 类型

text/x-cddl

Lexer for CDDL definitions.

2.8 新版功能.

Lexer for the Chapel language

class pygments.lexers.chapel.ChapelLexer
短名称

chapel, chpl

文件名

*.chpl

MIME 类型

None

For Chapel source.

2.0 新版功能.

Lexer for the Clean language

class pygments.lexers.clean.CleanLexer
短名称

clean

文件名

*.icl, *.dcl

MIME 类型

None

Lexer for the general purpose, state-of-the-art, pure and lazy functional programming language Clean (http://clean.cs.ru.nl/Clean).

Lexers for configuration file formats

class pygments.lexers.configs.ApacheConfLexer
短名称

apacheconf, aconf, apache

文件名

.htaccess, apache.conf, apache2.conf

MIME 类型

text/x-apacheconf

Lexer for configuration files following the Apache config file format.

0.6 新版功能.

class pygments.lexers.configs.AugeasLexer
短名称

augeas

文件名

*.aug

MIME 类型

None

Lexer for Augeas.

2.4 新版功能.

class pygments.lexers.configs.Cfengine3Lexer
短名称

cfengine3, cf3

文件名

*.cf

MIME 类型

None

Lexer for CFEngine3 policy files.

1.5 新版功能.

class pygments.lexers.configs.DockerLexer
短名称

docker, dockerfile

文件名

Dockerfile, *.docker

MIME 类型

text/x-dockerfile-config

Lexer for Docker configuration files.

2.0 新版功能.

class pygments.lexers.configs.IniLexer
短名称

ini, cfg, dosini

文件名

*.ini, *.cfg, *.inf, .editorconfig, *.service, *.socket, *.device, *.mount, *.automount, *.swap, *.target, *.path, *.timer, *.slice, *.scope

MIME 类型

text/x-ini, text/inf

Lexer for configuration files in INI style.

class pygments.lexers.configs.KconfigLexer
短名称

kconfig, menuconfig, linux-config, kernel-config

文件名

Kconfig*, *Config.in*, external.in*, standard-modules.in

MIME 类型

text/x-kconfig

For Linux-style Kconfig files.

1.6 新版功能.

class pygments.lexers.configs.LighttpdConfLexer
短名称

lighttpd, lighty

文件名

lighttpd.conf

MIME 类型

text/x-lighttpd-conf

Lexer for Lighttpd configuration files.

0.11 新版功能.

class pygments.lexers.configs.NestedTextLexer
短名称

nestedtext, nt

文件名

*.nt

MIME 类型

None

Lexer for NextedText, a human-friendly data format.

2.9 新版功能.

class pygments.lexers.configs.NginxConfLexer
短名称

nginx

文件名

nginx.conf

MIME 类型

text/x-nginx-conf

Lexer for Nginx configuration files.

0.11 新版功能.

class pygments.lexers.configs.PacmanConfLexer
短名称

pacmanconf

文件名

pacman.conf

MIME 类型

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.

2.1 新版功能.

class pygments.lexers.configs.PkgConfigLexer
短名称

pkgconfig

文件名

*.pc

MIME 类型

None

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

2.1 新版功能.

class pygments.lexers.configs.PropertiesLexer
短名称

properties, jproperties

文件名

*.properties

MIME 类型

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

1.4 新版功能.

class pygments.lexers.configs.RegeditLexer
短名称

registry

文件名

*.reg

MIME 类型

text/x-windows-registry

Lexer for Windows Registry files produced by regedit.

1.6 新版功能.

class pygments.lexers.configs.SingularityLexer
短名称

singularity

文件名

*.def, Singularity

MIME 类型

None

Lexer for Singularity definition files.

2.6 新版功能.

class pygments.lexers.configs.SquidConfLexer
短名称

squidconf, squid.conf, squid

文件名

squid.conf

MIME 类型

text/x-squidconf

Lexer for squid configuration files.

0.9 新版功能.

class pygments.lexers.configs.TOMLLexer
短名称

toml

文件名

*.toml, Pipfile, poetry.lock

MIME 类型

None

Lexer for TOML, a simple language for config files.

2.4 新版功能.

class pygments.lexers.configs.TermcapLexer
短名称

termcap

文件名

termcap, termcap.src

MIME 类型

None

Lexer for termcap database source.

This is very simple and minimal.

2.1 新版功能.

class pygments.lexers.configs.TerminfoLexer
短名称

terminfo

文件名

terminfo, terminfo.src

MIME 类型

None

Lexer for terminfo database source.

This is very simple and minimal.

2.1 新版功能.

class pygments.lexers.configs.TerraformLexer
短名称

terraform, tf

文件名

*.tf

MIME 类型

application/x-tf, application/x-terraform

Lexer for terraformi .tf files.

2.1 新版功能.

Lexers for misc console output

class pygments.lexers.console.PyPyLogLexer
短名称

pypylog, pypy

文件名

*.pypylog

MIME 类型

application/x-pypylog

Lexer for PyPy log files.

1.5 新版功能.

class pygments.lexers.console.VCTreeStatusLexer
短名称

vctreestatus

文件名

None

MIME 类型

None

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

2.0 新版功能.

Lexer for Crystal

class pygments.lexers.crystal.CrystalLexer
短名称

cr, crystal

文件名

*.cr

MIME 类型

text/x-crystal

For Crystal source code.

2.2 新版功能.

Lexers for Csound languages

class pygments.lexers.csound.CsoundDocumentLexer
短名称

csound-document, csound-csd

文件名

*.csd

MIME 类型

None

For Csound documents.

2.1 新版功能.

class pygments.lexers.csound.CsoundOrchestraLexer
短名称

csound, csound-orc

文件名

*.orc, *.udo

MIME 类型

None

For Csound orchestras.

2.1 新版功能.

class pygments.lexers.csound.CsoundScoreLexer
短名称

csound-score, csound-sco

文件名

*.sco

MIME 类型

None

For Csound scores.

2.1 新版功能.

Lexers for D languages

class pygments.lexers.d.CrocLexer
短名称

croc

文件名

*.croc

MIME 类型

text/x-crocsrc

For Croc source.

class pygments.lexers.d.DLexer
短名称

d

文件名

*.d, *.di

MIME 类型

text/x-dsrc

For D source.

1.2 新版功能.

class pygments.lexers.d.MiniDLexer
短名称

minid

文件名

None

MIME 类型

text/x-minidsrc

For MiniD source. MiniD is now known as Croc.

Lexers for data file format

class pygments.lexers.data.JsonBareObjectLexer
短名称

None

文件名

None

MIME 类型

None

For JSON data structures (with missing object curly braces).

2.2 新版功能.

2.8.0 版后已移除: Behaves the same as JsonLexer now.

class pygments.lexers.data.JsonLdLexer
短名称

jsonld, json-ld

文件名

*.jsonld

MIME 类型

application/ld+json

For JSON-LD linked data.

2.0 新版功能.

class pygments.lexers.data.JsonLexer
短名称

json, json-object

文件名

*.json, Pipfile.lock

MIME 类型

application/json, application/json-object

For JSON data structures.

1.5 新版功能.

class pygments.lexers.data.YamlLexer
短名称

yaml

文件名

*.yaml, *.yml

MIME 类型

text/x-yaml

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

0.11 新版功能.

Lexers for Devicetree language

class pygments.lexers.devicetree.DevicetreeLexer
短名称

devicetree, dts

文件名

*.dts, *.dtsi

MIME 类型

text/x-c

Lexer for Devicetree files.

2.7 新版功能.

Lexers for diff/patch formats

class pygments.lexers.diff.DarcsPatchLexer
短名称

dpatch

文件名

*.dpatch, *.darcspatch

MIME 类型

None

DarcsPatchLexer is a lexer for the various versions of the darcs patch format. Examples of this format are derived by commands such as darcs annotate --patch and darcs send.

0.10 新版功能.

class pygments.lexers.diff.DiffLexer
短名称

diff, udiff

文件名

*.diff, *.patch

MIME 类型

text/x-diff, text/x-patch

Lexer for unified or context-style diffs or patches.

class pygments.lexers.diff.WDiffLexer
短名称

wdiff

文件名

*.wdiff

MIME 类型

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.

2.2 新版功能.

Lexers for .net languages

class pygments.lexers.dotnet.BooLexer
短名称

boo

文件名

*.boo

MIME 类型

text/x-boo

For Boo source code.

class pygments.lexers.dotnet.CSharpAspxLexer
短名称

aspx-cs

文件名

*.aspx, *.asax, *.ascx, *.ashx, *.asmx, *.axd

MIME 类型

None

Lexer for highlighting C# within ASP.NET pages.

class pygments.lexers.dotnet.CSharpLexer
短名称

csharp, c#, cs

文件名

*.cs

MIME 类型

text/x-csharp

For C# source code.

Additional options accepted:

unicodelevel

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

  • none – only the ASCII letters and numbers are allowed. This is the fastest selection.

  • basic – all Unicode characters from the specification except category Lo are allowed.

  • full – all Unicode characters as specified in the C# specs are allowed. Note that this means a considerable slowdown since the Lo category has more than 40,000 characters in it!

The default value is basic.

0.8 新版功能.

class pygments.lexers.dotnet.FSharpLexer
短名称

fsharp, f#

文件名

*.fs, *.fsi

MIME 类型

text/x-fsharp

For the F# language (version 3.0).

1.5 新版功能.

class pygments.lexers.dotnet.NemerleLexer
短名称

nemerle

文件名

*.n

MIME 类型

text/x-nemerle

For Nemerle source code.

Additional options accepted:

unicodelevel

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

  • none – only the ASCII letters and numbers are allowed. This is the fastest selection.

  • basic – all Unicode characters from the specification except category Lo are allowed.

  • full – all Unicode characters as specified in the C# specs are allowed. Note that this means a considerable slowdown since the Lo category has more than 40,000 characters in it!

The default value is basic.

1.5 新版功能.

class pygments.lexers.dotnet.VbNetAspxLexer
短名称

aspx-vb

文件名

*.aspx, *.asax, *.ascx, *.ashx, *.asmx, *.axd

MIME 类型

None

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

class pygments.lexers.dotnet.VbNetLexer
短名称

vb.net, vbnet

文件名

*.vb, *.bas

MIME 类型

text/x-vbnet, text/x-vba

For Visual Basic.NET source code.

Lexers for various domain-specific languages

class pygments.lexers.dsls.AlloyLexer
短名称

alloy

文件名

*.als

MIME 类型

text/x-alloy

For Alloy source code.

2.0 新版功能.

class pygments.lexers.dsls.CrmshLexer
短名称

crmsh, pcmk

文件名

*.crmsh, *.pcmk

MIME 类型

None

Lexer for crmsh configuration files for Pacemaker clusters.

2.1 新版功能.

class pygments.lexers.dsls.FlatlineLexer
短名称

flatline

文件名

None

MIME 类型

text/x-flatline

Lexer for Flatline expressions.

2.2 新版功能.

class pygments.lexers.dsls.MscgenLexer
短名称

mscgen, msc

文件名

*.msc

MIME 类型

None

For Mscgen files.

1.6 新版功能.

class pygments.lexers.dsls.PanLexer
短名称

pan

文件名

*.pan

MIME 类型

None

Lexer for pan source files.

Based on tcsh lexer.

2.0 新版功能.

class pygments.lexers.dsls.ProtoBufLexer
短名称

protobuf, proto

文件名

*.proto

MIME 类型

None

Lexer for Protocol Buffer definition files.

1.4 新版功能.

class pygments.lexers.dsls.PuppetLexer
短名称

puppet

文件名

*.pp

MIME 类型

None

For Puppet configuration DSL.

1.6 新版功能.

class pygments.lexers.dsls.RslLexer
短名称

rsl

文件名

*.rsl

MIME 类型

text/rsl

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

2.0 新版功能.

class pygments.lexers.dsls.SnowballLexer
短名称

snowball

文件名

*.sbl

MIME 类型

None

Lexer for Snowball source code.

2.2 新版功能.

class pygments.lexers.dsls.ThriftLexer
短名称

thrift

文件名

*.thrift

MIME 类型

application/x-thrift

For Thrift interface definitions.

2.1 新版功能.

class pygments.lexers.dsls.VGLLexer
短名称

vgl

文件名

*.rpf

MIME 类型

None

For SampleManager VGL source code.

1.6 新版功能.

class pygments.lexers.dsls.ZeekLexer
短名称

zeek, bro

文件名

*.zeek, *.bro

MIME 类型

None

For Zeek scripts.

2.5 新版功能.

Lexers for the Dylan language

class pygments.lexers.dylan.DylanConsoleLexer
短名称

dylan-console, dylan-repl

文件名

*.dylan-console

MIME 类型

text/x-dylan-console

For Dylan interactive console output like:

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

This is based on a copy of the RubyConsoleLexer.

1.6 新版功能.

class pygments.lexers.dylan.DylanLexer
短名称

dylan

文件名

*.dylan, *.dyl, *.intr

MIME 类型

text/x-dylan

For the Dylan language.

0.7 新版功能.

class pygments.lexers.dylan.DylanLidLexer
短名称

dylan-lid, lid

文件名

*.lid, *.hdp

MIME 类型

text/x-dylan-lid

For Dylan LID (Library Interchange Definition) files.

1.6 新版功能.

Lexers for the ECL language

class pygments.lexers.ecl.ECLLexer
短名称

ecl

文件名

*.ecl

MIME 类型

application/x-ecl

Lexer for the declarative big-data ECL language.

1.5 新版功能.

Lexer for the Eiffel language

class pygments.lexers.eiffel.EiffelLexer
短名称

eiffel

文件名

*.e

MIME 类型

text/x-eiffel

For Eiffel source code.

2.0 新版功能.

Lexer for the Elm programming language

class pygments.lexers.elm.ElmLexer
短名称

elm

文件名

*.elm

MIME 类型

text/x-elm

For Elm source code.

2.1 新版功能.

Lexer for the raw E-mail

class pygments.lexers.email.EmailLexer
短名称

email, eml

文件名

*.eml

MIME 类型

message/rfc822

Lexer for raw E-mail.

Additional options accepted:

highlight-X-header

Highlight the fields of X- user-defined email header. (default: False).

2.5 新版功能.

Lexers for Erlang

class pygments.lexers.erlang.ElixirConsoleLexer
短名称

iex

文件名

None

MIME 类型

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

1.5 新版功能.

class pygments.lexers.erlang.ElixirLexer
短名称

elixir, ex, exs

文件名

*.ex, *.eex, *.exs, *.leex

MIME 类型

text/x-elixir

For the Elixir language.

1.5 新版功能.

class pygments.lexers.erlang.ErlangLexer
短名称

erlang

文件名

*.erl, *.hrl, *.es, *.escript

MIME 类型

text/x-erlang

For the Erlang functional programming language.

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

0.9 新版功能.

class pygments.lexers.erlang.ErlangShellLexer
短名称

erl

文件名

*.erl-sh

MIME 类型

text/x-erl-shellsession

Shell sessions in erl (for Erlang code).

1.1 新版功能.

Lexers for esoteric languages

class pygments.lexers.esoteric.AheuiLexer
短名称

aheui

文件名

*.aheui

MIME 类型

None

Aheui Lexer.

Aheui is esoteric language based on Korean alphabets.

class pygments.lexers.esoteric.BefungeLexer
短名称

befunge

文件名

*.befunge

MIME 类型

application/x-befunge

Lexer for the esoteric Befunge language.

0.7 新版功能.

class pygments.lexers.esoteric.BrainfuckLexer
短名称

brainfuck, bf

文件名

*.bf, *.b

MIME 类型

application/x-brainfuck

Lexer for the esoteric BrainFuck language.

class pygments.lexers.esoteric.CAmkESLexer
短名称

camkes, idl4

文件名

*.camkes, *.idl4

MIME 类型

None

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

2.1 新版功能.

class pygments.lexers.esoteric.CapDLLexer
短名称

capdl

文件名

*.cdl

MIME 类型

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.

2.2 新版功能.

class pygments.lexers.esoteric.RedcodeLexer
短名称

redcode

文件名

*.cw

MIME 类型

None

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

0.8 新版功能.

Pygments lexers for Ezhil language

class pygments.lexers.ezhil.EzhilLexer
短名称

ezhil

文件名

*.n

MIME 类型

text/x-ezhil

Lexer for Ezhil, a Tamil script-based programming language

2.1 新版功能.

Lexers for the Factor language

class pygments.lexers.factor.FactorLexer
短名称

factor

文件名

*.factor

MIME 类型

text/x-factor

Lexer for the Factor language.

1.4 新版功能.

Lexer for the Fantom language

class pygments.lexers.fantom.FantomLexer
短名称

fan

文件名

*.fan

MIME 类型

application/x-fantom

For Fantom source code.

1.5 新版功能.

Lexer for the Felix language

class pygments.lexers.felix.FelixLexer
短名称

felix, flx

文件名

*.flx, *.flxh

MIME 类型

text/x-felix

For Felix source code.

1.2 新版功能.

Lexer for FloScript

class pygments.lexers.floscript.FloScriptLexer
短名称

floscript, flo

文件名

*.flo

MIME 类型

None

For FloScript configuration language source code.

2.4 新版功能.

Lexer for the Forth language

class pygments.lexers.forth.ForthLexer
短名称

forth

文件名

*.frt, *.fs

MIME 类型

application/x-forth

Lexer for Forth files.

2.2 新版功能.

Lexers for Fortran languages

class pygments.lexers.fortran.FortranFixedLexer
短名称

fortranfixed

文件名

*.f, *.F

MIME 类型

None

Lexer for fixed format Fortran.

2.1 新版功能.

class pygments.lexers.fortran.FortranLexer
短名称

fortran

文件名

*.f03, *.f90, *.F03, *.F90

MIME 类型

text/x-fortran

Lexer for FORTRAN 90 code.

0.10 新版功能.

Simple lexer for Microsoft Visual FoxPro source code

class pygments.lexers.foxpro.FoxProLexer
短名称

foxpro, vfp, clipper, xbase

文件名

*.PRG, *.prg

MIME 类型

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.

1.6 新版功能.

Lexer for FreeFem++ language

class pygments.lexers.freefem.FreeFemLexer
短名称

freefem

文件名

*.edp

MIME 类型

text/x-freefem

For FreeFem++ source.

This is an extension of the CppLexer, as the FreeFem Language is a superset of C++.

2.4 新版功能.

Lexer for the Futhark language

class pygments.lexers.futhark.FutharkLexer
短名称

futhark

文件名

*.fut

MIME 类型

text/x-futhark

A Futhark lexer

2.8 新版功能.

Lexers for the G Code Language

class pygments.lexers.gcodelexer.GcodeLexer
短名称

gcode

文件名

*.gcode

MIME 类型

None

For gcode source code.

2.9 新版功能.

Lexer for GDScript

class pygments.lexers.gdscript.GDScriptLexer
短名称

gdscript, gd

文件名

*.gd

MIME 类型

text/x-gdscript, application/x-gdscript

For GDScript source code.

Lexers for the Google Go language

class pygments.lexers.go.GoLexer
短名称

go, golang

文件名

*.go

MIME 类型

text/x-gosrc

For Go source.

1.2 新版功能.

Lexers for grammar notations like BNF

class pygments.lexers.grammar_notation.AbnfLexer
短名称

abnf

文件名

*.abnf

MIME 类型

text/x-abnf

Lexer for IETF 7405 ABNF (Updates 5234) grammars.

2.1 新版功能.

class pygments.lexers.grammar_notation.BnfLexer
短名称

bnf

文件名

*.bnf

MIME 类型

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 desision making might cause too minimal highlighting and you might be disappointed, but it is reasonable for us.

2.1 新版功能.

class pygments.lexers.grammar_notation.JsgfLexer
短名称

jsgf

文件名

*.jsgf

MIME 类型

application/jsgf, application/x-jsgf, text/jsgf

For JSpeech Grammar Format grammars.

2.2 新版功能.

class pygments.lexers.grammar_notation.PegLexer
短名称

peg

文件名

*.peg

MIME 类型

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).

2.6 新版功能.

Lexers for graph query languages

class pygments.lexers.graph.CypherLexer
短名称

cypher

文件名

*.cyp, *.cypher

MIME 类型

None

For Cypher Query Language

For the Cypher version in Neo4j 3.3

2.0 新版功能.

Lexer for the DOT language (graphviz)

class pygments.lexers.graphviz.GraphvizLexer
短名称

graphviz, dot

文件名

*.gv, *.dot

MIME 类型

text/x-graphviz, text/vnd.graphviz

For graphviz DOT graph description language.

2.8 新版功能.

Lexers for TigerGraph GSQL graph query language

class pygments.lexers.gsql.GSQLLexer
短名称

gsql

文件名

*.gsql

MIME 类型

None

For GSQL queries (version 3.x). .. versionadded:: 2.10

Lexers for hardware descriptor languages

class pygments.lexers.hdl.SystemVerilogLexer
短名称

systemverilog, sv

文件名

*.sv, *.svh

MIME 类型

text/x-systemverilog

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

1.5 新版功能.

class pygments.lexers.hdl.VerilogLexer
短名称

verilog, v

文件名

*.v

MIME 类型

text/x-verilog

For verilog source code with preprocessor directives.

1.4 新版功能.

class pygments.lexers.hdl.VhdlLexer
短名称

vhdl

文件名

*.vhdl, *.vhd

MIME 类型

text/x-vhdl

For VHDL source code.

1.5 新版功能.

Lexers for hexadecimal dumps

class pygments.lexers.hexdump.HexdumpLexer
短名称

hexdump

文件名

None

MIME 类型

None

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

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

The specific supported formats are the outputs of:

  • hexdump FILE

  • hexdump -C FILE – the canonical format used in the example.

  • hd FILE – same as hexdump -C FILE.

  • hexcat FILE

  • od -t x1z FILE

  • xxd FILE

  • DEBUG.EXE FILE.COM and entering d to the prompt.

2.1 新版功能.

Lexers for IDL

class pygments.lexers.idl.IDLLexer
短名称

idl

文件名

*.pro

MIME 类型

text/idl

Pygments Lexer for IDL (Interactive Data Language).

1.6 新版功能.

Lexers for Igor Pro

class pygments.lexers.igor.IgorLexer
短名称

igor, igorpro

文件名

*.ipf

MIME 类型

text/ipf

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

2.0 新版功能.

Lexers for installer/packager DSLs and formats

class pygments.lexers.installers.DebianControlLexer
短名称

debcontrol, control

文件名

control

MIME 类型

None

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

Specification of control` files is available at https://www.debian.org/doc/debian-policy/ch-controlfields.html

0.9 新版功能.

class pygments.lexers.installers.NSISLexer
短名称

nsis, nsi, nsh

文件名

*.nsi, *.nsh

MIME 类型

text/x-nsis

For NSIS scripts.

1.6 新版功能.

class pygments.lexers.installers.RPMSpecLexer
短名称

spec

文件名

*.spec

MIME 类型

text/x-rpm-spec

For RPM .spec files.

1.6 新版功能.

class pygments.lexers.installers.SourcesListLexer
短名称

debsources, sourceslist, sources.list

文件名

sources.list

MIME 类型

None

Lexer that highlights debian sources.list files.

0.7 新版功能.

Lexers for interactive fiction languages

class pygments.lexers.int_fiction.Inform6Lexer
短名称

inform6, i6

文件名

*.inf

MIME 类型

None

For Inform 6 source code.

2.0 新版功能.

class pygments.lexers.int_fiction.Inform6TemplateLexer
短名称

i6t

文件名

*.i6t

MIME 类型

None

For Inform 6 template code.

2.0 新版功能.

class pygments.lexers.int_fiction.Inform7Lexer
短名称

inform7, i7

文件名

*.ni, *.i7x

MIME 类型

None

For Inform 7 source code.

2.0 新版功能.

class pygments.lexers.int_fiction.Tads3Lexer
短名称

tads3

文件名

*.t

MIME 类型

None

For TADS 3 source code.

Lexers for the Io language

class pygments.lexers.iolang.IoLexer
短名称

io

文件名

*.io

MIME 类型

text/x-iosrc

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

0.10 新版功能.

Lexer for the J programming language

class pygments.lexers.j.JLexer
短名称

j

文件名

*.ijs

MIME 类型

text/x-j

For J source code.

2.1 新版功能.

Lexers for the JSLT language

class pygments.lexers.jslt.JSLTLexer
短名称

jslt

文件名

*.jslt

MIME 类型

text/x-jslt

For JSLT source.

2.10 新版功能.

Lexers for the Julia language

class pygments.lexers.julia.JuliaConsoleLexer
短名称

jlcon, julia-repl

文件名

None

MIME 类型

None

For Julia console sessions. Modeled after MatlabSessionLexer.

1.6 新版功能.

class pygments.lexers.julia.JuliaLexer
短名称

julia, jl

文件名

*.jl

MIME 类型

text/x-julia, application/x-julia

For Julia source code.

1.6 新版功能.

Pygments lexers for JVM languages

class pygments.lexers.jvm.AspectJLexer
短名称

aspectj

文件名

*.aj

MIME 类型

text/x-aspectj

For AspectJ source code.

1.6 新版功能.

class pygments.lexers.jvm.CeylonLexer
短名称

ceylon

文件名

*.ceylon

MIME 类型

text/x-ceylon

For Ceylon source code.

1.6 新版功能.

class pygments.lexers.jvm.ClojureLexer
短名称

clojure, clj

文件名

*.clj

MIME 类型

text/x-clojure, application/x-clojure

Lexer for Clojure source code.

0.11 新版功能.

class pygments.lexers.jvm.ClojureScriptLexer
短名称

clojurescript, cljs

文件名

*.cljs

MIME 类型

text/x-clojurescript, application/x-clojurescript

Lexer for ClojureScript source code.

2.0 新版功能.

class pygments.lexers.jvm.GoloLexer
短名称

golo

文件名

*.golo

MIME 类型

None

For Golo source code.

2.0 新版功能.

class pygments.lexers.jvm.GosuLexer
短名称

gosu

文件名

*.gs, *.gsx, *.gsp, *.vark

MIME 类型

text/x-gosu

For Gosu source code.

1.5 新版功能.

class pygments.lexers.jvm.GosuTemplateLexer
短名称

gst

文件名

*.gst

MIME 类型

text/x-gosu-template

For Gosu templates.

1.5 新版功能.

class pygments.lexers.jvm.GroovyLexer
短名称

groovy

文件名

*.groovy, *.gradle

MIME 类型

text/x-groovy

For Groovy source code.

1.5 新版功能.

class pygments.lexers.jvm.IokeLexer
短名称

ioke, ik

文件名

*.ik

MIME 类型

text/x-iokesrc

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

1.4 新版功能.

class pygments.lexers.jvm.JasminLexer
短名称

jasmin, jasminxt

文件名

*.j

MIME 类型

None

For Jasmin assembly code.

2.0 新版功能.

class pygments.lexers.jvm.JavaLexer
短名称

java

文件名

*.java

MIME 类型

text/x-java

For Java source code.

class pygments.lexers.jvm.KotlinLexer
短名称

kotlin

文件名

*.kt, *.kts

MIME 类型

text/x-kotlin

For Kotlin source code.

1.5 新版功能.

class pygments.lexers.jvm.PigLexer
短名称

pig

文件名

*.pig

MIME 类型

text/x-pig

For Pig Latin source code.

2.0 新版功能.

class pygments.lexers.jvm.SarlLexer
短名称

sarl

文件名

*.sarl

MIME 类型

text/x-sarl

For SARL source code.

2.4 新版功能.

class pygments.lexers.jvm.ScalaLexer
短名称

scala

文件名

*.scala

MIME 类型

text/x-scala

For Scala source code.

class pygments.lexers.jvm.XtendLexer
短名称

xtend

文件名

*.xtend

MIME 类型

text/x-xtend

For Xtend source code.

1.6 新版功能.

Lexers for the Kuin language

class pygments.lexers.kuin.KuinLexer
短名称

kuin

文件名

*.kn

MIME 类型

None

For Kuin source code

2.9 新版功能.

Lexer for LilyPond

class pygments.lexers.lilypond.LilyPondLexer
短名称

lilypond

文件名

*.ly

MIME 类型

None

Lexer for input to LilyPond, a text-based music typesetter.

重要

This lexer is meant to be used in conjunction with the lilypond style.

2.11 新版功能.

Lexers for Lispy languages

class pygments.lexers.lisp.CPSALexer
短名称

cpsa

文件名

*.cpsa

MIME 类型

None

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

2.1 新版功能.

class pygments.lexers.lisp.CommonLispLexer
短名称

common-lisp, cl, lisp

文件名

*.cl, *.lisp

MIME 类型

text/x-common-lisp

A Common Lisp lexer.

0.9 新版功能.

class pygments.lexers.lisp.EmacsLispLexer
短名称

emacs-lisp, elisp, emacs

文件名

*.el

MIME 类型

text/x-elisp, application/x-elisp

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

2.1 新版功能.

class pygments.lexers.lisp.FennelLexer
短名称

fennel, fnl

文件名

*.fnl

MIME 类型

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.

2.3 新版功能.

class pygments.lexers.lisp.HyLexer
短名称

hylang

文件名

*.hy

MIME 类型

text/x-hy, application/x-hy

Lexer for Hy source code.

2.0 新版功能.

class pygments.lexers.lisp.NewLispLexer
短名称

newlisp

文件名

*.lsp, *.nl, *.kif

MIME 类型

text/x-newlisp, application/x-newlisp

For newLISP. source code (version 10.3.0).

1.5 新版功能.

class pygments.lexers.lisp.RacketLexer
短名称

racket, rkt

文件名

*.rkt, *.rktd, *.rktl

MIME 类型

text/x-racket, application/x-racket

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

1.6 新版功能.

class pygments.lexers.lisp.SchemeLexer
短名称

scheme, scm

文件名

*.scm, *.ss

MIME 类型

text/x-scheme, application/x-scheme

A Scheme lexer, parsing a stream and outputting the tokens needed to highlight scheme code. This lexer could be most probably easily subclassed to parse other LISP-Dialects like Common Lisp, Emacs Lisp or AutoLisp.

This parser is checked with pastes from the LISP pastebin at http://paste.lisp.org/ to cover as much syntax as possible.

It supports the full Scheme syntax as defined in R5RS.

0.6 新版功能.

class pygments.lexers.lisp.ShenLexer
短名称

shen

文件名

*.shen

MIME 类型

text/x-shen, application/x-shen

Lexer for Shen source code.

2.1 新版功能.

class pygments.lexers.lisp.XtlangLexer
短名称

extempore

文件名

*.xtm

MIME 类型

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)

2.2 新版功能.

Lexers for Makefiles and similar

class pygments.lexers.make.BaseMakefileLexer
短名称

basemake

文件名

None

MIME 类型

None

Lexer for simple Makefiles (no preprocessing).

0.10 新版功能.

class pygments.lexers.make.CMakeLexer
短名称

cmake

文件名

*.cmake, CMakeLists.txt

MIME 类型

text/x-cmake

Lexer for CMake files.

1.2 新版功能.

class pygments.lexers.make.MakefileLexer
短名称

make, makefile, mf, bsdmake

文件名

*.mak, *.mk, Makefile, makefile, Makefile.*, GNUmakefile

MIME 类型

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
短名称

bbcode

文件名

None

MIME 类型

text/x-bbcode

A lexer that highlights BBCode(-like) syntax.

0.6 新版功能.

class pygments.lexers.markup.GroffLexer
短名称

groff, nroff, man

文件名

*.[1234567], *.man

MIME 类型

application/x-troff, text/troff

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

0.6 新版功能.

class pygments.lexers.markup.MarkdownLexer
短名称

markdown, md

文件名

*.md, *.markdown

MIME 类型

text/x-markdown

For Markdown markup.

2.2 新版功能.

class pygments.lexers.markup.MoinWikiLexer
短名称

trac-wiki, moin

文件名

None

MIME 类型

text/x-trac-wiki

For MoinMoin (and Trac) Wiki markup.

0.7 新版功能.

class pygments.lexers.markup.MozPreprocCssLexer
短名称

css+mozpreproc

文件名

*.css.in

MIME 类型

None

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

2.0 新版功能.

class pygments.lexers.markup.MozPreprocHashLexer
短名称

mozhashpreproc

文件名

None

MIME 类型

None

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

Other data is left untouched.

2.0 新版功能.

class pygments.lexers.markup.MozPreprocJavascriptLexer
短名称

javascript+mozpreproc

文件名

*.js.in

MIME 类型

None

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

2.0 新版功能.

class pygments.lexers.markup.MozPreprocPercentLexer
短名称

mozpercentpreproc

文件名

None

MIME 类型

None

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

Other data is left untouched.

2.0 新版功能.

class pygments.lexers.markup.MozPreprocXulLexer
短名称

xul+mozpreproc

文件名

*.xul.in

MIME 类型

None

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

2.0 新版功能.

class pygments.lexers.markup.RstLexer
短名称

restructuredtext, rst, rest

文件名

*.rst, *.rest

MIME 类型

text/x-rst, text/prs.fallenstein.rst

For reStructuredText markup.

0.7 新版功能.

Additional options accepted:

handlecodeblocks

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

0.8 新版功能.

class pygments.lexers.markup.TexLexer
短名称

tex, latex

文件名

*.tex, *.aux, *.toc

MIME 类型

text/x-tex, text/x-latex

Lexer for the TeX and LaTeX typesetting languages.

class pygments.lexers.markup.TiddlyWiki5Lexer
短名称

tid

文件名

*.tid

MIME 类型

text/vnd.tiddlywiki

For TiddlyWiki5 markup.

2.7 新版功能.

Lexer for the computer algebra system Maxima

class pygments.lexers.maxima.MaximaLexer
短名称

maxima, macsyma

文件名

*.mac, *.max

MIME 类型

None

A Maxima lexer. Derived from pygments.lexers.MuPADLexer.

2.11 新版功能.

Pygments lexer for the Meson build system

class pygments.lexers.meson.MesonLexer
短名称

meson, meson.build

文件名

meson.build, mesonoptions.txt

MIME 类型

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

2.10 新版功能.

Lexer for Multipurpose Internet Mail Extensions (MIME) data

class pygments.lexers.mime.MIMELexer
短名称

mime

文件名

None

MIME 类型

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)

2.5 新版功能.

Lexers for ML family languages

class pygments.lexers.ml.FStarLexer
短名称

fstar

文件名

*.fst, *.fsti

MIME 类型

text/x-fstar

For the F* language (https://www.fstar-lang.org/). .. versionadded:: 2.7

class pygments.lexers.ml.OcamlLexer
短名称

ocaml

文件名

*.ml, *.mli, *.mll, *.mly

MIME 类型

text/x-ocaml

For the OCaml language.

0.7 新版功能.

class pygments.lexers.ml.OpaLexer
短名称

opa

文件名

*.opa

MIME 类型

text/x-opa

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

1.5 新版功能.

class pygments.lexers.ml.ReasonLexer
短名称

reasonml, reason

文件名

*.re, *.rei

MIME 类型

text/x-reasonml

For the ReasonML language (https://reasonml.github.io/).

2.6 新版功能.

class pygments.lexers.ml.SMLLexer
短名称

sml

文件名

*.sml, *.sig, *.fun

MIME 类型

text/x-standardml, application/x-standardml

For the Standard ML language.

1.5 新版功能.

Lexers for modeling languages

class pygments.lexers.modeling.BugsLexer
短名称

bugs, winbugs, openbugs

文件名

*.bug

MIME 类型

None

Pygments Lexer for OpenBugs and WinBugs models.

1.6 新版功能.

class pygments.lexers.modeling.JagsLexer
短名称

jags

文件名

*.jag, *.bug

MIME 类型

None

Pygments Lexer for JAGS.

1.6 新版功能.

class pygments.lexers.modeling.ModelicaLexer
短名称

modelica

文件名

*.mo

MIME 类型

text/x-modelica

For Modelica source code.

1.1 新版功能.

class pygments.lexers.modeling.StanLexer
短名称

stan

文件名

*.stan

MIME 类型

None

Pygments Lexer for Stan models.

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

1.6 新版功能.

Multi-Dialect Lexer for Modula-2

class pygments.lexers.modula2.Modula2Lexer
短名称

modula2, m2

文件名

*.def, *.mod

MIME 类型

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.

1.3 新版功能.

在 2.1 版更改: Added multi-dialect support.

Lexer for the Monte programming language

class pygments.lexers.monte.MonteLexer
短名称

monte

文件名

*.mt

MIME 类型

None

Lexer for the Monte programming language.

2.2 新版功能.

Lexers for the mosel language

class pygments.lexers.mosel.MoselLexer
短名称

mosel

文件名

*.mos

MIME 类型

None

For the Mosel optimization language.

2.6 新版功能.

Lexers for NCAR Command Language

class pygments.lexers.ncl.NCLLexer
短名称

ncl

文件名

*.ncl

MIME 类型

text/ncl

Lexer for NCL code.

2.2 新版功能.

Lexer for the Nim language (formerly known as Nimrod)

class pygments.lexers.nimrod.NimrodLexer
短名称

nimrod, nim

文件名

*.nim, *.nimrod

MIME 类型

text/x-nim

For Nim source code.

1.5 新版功能.

Lexer for the Nit language

class pygments.lexers.nit.NitLexer
短名称

nit

文件名

*.nit

MIME 类型

None

For nit source.

2.0 新版功能.

Lexers for the NixOS Nix language

class pygments.lexers.nix.NixLexer
短名称

nixos, nix

文件名

*.nix

MIME 类型

text/x-nix

For the Nix language.

2.0 新版功能.

Lexers for Oberon family languages

class pygments.lexers.oberon.ComponentPascalLexer
短名称

componentpascal, cp

文件名

*.cp, *.cps

MIME 类型

text/x-component-pascal

For Component Pascal source code.

2.1 新版功能.

Lexers for Objective-C family languages

class pygments.lexers.objective.LogosLexer
短名称

logos

文件名

*.x, *.xi, *.xm, *.xmi

MIME 类型

text/x-logos

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

1.6 新版功能.

class pygments.lexers.objective.ObjectiveCLexer
短名称

objective-c, objectivec, obj-c, objc

文件名

*.m, *.h

MIME 类型

text/x-objective-c

For Objective-C source code with preprocessor directives.

class pygments.lexers.objective.ObjectiveCppLexer
短名称

objective-c++, objectivec++, obj-c++, objc++

文件名

*.mm, *.hh

MIME 类型

text/x-objective-c++

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

class pygments.lexers.objective.SwiftLexer
短名称

swift

文件名

*.swift

MIME 类型

text/x-swift

For Swift source.

2.0 新版功能.

Lexers for the Ooc language

class pygments.lexers.ooc.OocLexer
短名称

ooc

文件名

*.ooc

MIME 类型

text/x-ooc

For Ooc source code

1.2 新版功能.

Lexer for ParaSail

class pygments.lexers.parasail.ParaSailLexer
短名称

parasail

文件名

*.psi, *.psl

MIME 类型

text/x-parasail

For ParaSail source code.

2.1 新版功能.

Lexers for parser generators

class pygments.lexers.parsers.AntlrActionScriptLexer
短名称

antlr-actionscript, antlr-as

文件名

*.G, *.g

MIME 类型

None

ANTLR with ActionScript Target

1.1 新版功能.

class pygments.lexers.parsers.AntlrCSharpLexer
短名称

antlr-csharp, antlr-c#

文件名

*.G, *.g

MIME 类型

None

ANTLR with C# Target

1.1 新版功能.

class pygments.lexers.parsers.AntlrCppLexer
短名称

antlr-cpp

文件名

*.G, *.g

MIME 类型

None

ANTLR with CPP Target

1.1 新版功能.

class pygments.lexers.parsers.AntlrJavaLexer
短名称

antlr-java

文件名

*.G, *.g

MIME 类型

None

ANTLR with Java Target

1. 新版功能.

class pygments.lexers.parsers.AntlrLexer
短名称

antlr

文件名

None

MIME 类型

None

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

1.1 新版功能.

class pygments.lexers.parsers.AntlrObjectiveCLexer
短名称

antlr-objc

文件名

*.G, *.g

MIME 类型

None

ANTLR with Objective-C Target

1.1 新版功能.

class pygments.lexers.parsers.AntlrPerlLexer
短名称

antlr-perl

文件名

*.G, *.g

MIME 类型

None

ANTLR with Perl Target

1.1 新版功能.

class pygments.lexers.parsers.AntlrPythonLexer
短名称

antlr-python

文件名

*.G, *.g

MIME 类型

None

ANTLR with Python Target

1.1 新版功能.

class pygments.lexers.parsers.AntlrRubyLexer
短名称

antlr-ruby, antlr-rb

文件名

*.G, *.g

MIME 类型

None

ANTLR with Ruby Target

1.1 新版功能.

class pygments.lexers.parsers.EbnfLexer
短名称

ebnf

文件名

*.ebnf

MIME 类型

text/x-ebnf

Lexer for ISO/IEC 14977 EBNF grammars.

2.0 新版功能.

class pygments.lexers.parsers.RagelCLexer
短名称

ragel-c

文件名

*.rl

MIME 类型

None

A lexer for Ragel in a C host file.

1.1 新版功能.

class pygments.lexers.parsers.RagelCppLexer
短名称

ragel-cpp

文件名

*.rl

MIME 类型

None

A lexer for Ragel in a CPP host file.

1.1 新版功能.

class pygments.lexers.parsers.RagelDLexer
短名称

ragel-d

文件名

*.rl

MIME 类型

None

A lexer for Ragel in a D host file.

1.1 新版功能.

class pygments.lexers.parsers.RagelEmbeddedLexer
短名称

ragel-em

文件名

*.rl

MIME 类型

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.

1.1 新版功能.

class pygments.lexers.parsers.RagelJavaLexer
短名称

ragel-java

文件名

*.rl

MIME 类型

None

A lexer for Ragel in a Java host file.

1.1 新版功能.

class pygments.lexers.parsers.RagelLexer
短名称

ragel

文件名

None

MIME 类型

None

A pure Ragel lexer. Use this for fragments of Ragel. For .rl files, use RagelEmbeddedLexer instead (or one of the language-specific subclasses).

1.1 新版功能.

class pygments.lexers.parsers.RagelObjectiveCLexer
短名称

ragel-objc

文件名

*.rl

MIME 类型

None

A lexer for Ragel in an Objective C host file.

1.1 新版功能.

class pygments.lexers.parsers.RagelRubyLexer
短名称

ragel-ruby, ragel-rb

文件名

*.rl

MIME 类型

None

A lexer for Ragel in a Ruby host file.

1.1 新版功能.

class pygments.lexers.parsers.TreetopLexer
短名称

treetop

文件名

*.treetop, *.tt

MIME 类型

None

A lexer for Treetop grammars.

1.6 新版功能.

Lexers for Pascal family languages

class pygments.lexers.pascal.AdaLexer
短名称

ada, ada95, ada2005

文件名

*.adb, *.ads, *.ada

MIME 类型

text/x-ada

For Ada source code.

1.3 新版功能.

class pygments.lexers.pascal.DelphiLexer
短名称

delphi, pas, pascal, objectpascal

文件名

*.pas, *.dpr

MIME 类型

text/x-pascal

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

Additional options accepted:

turbopascal

Highlight Turbo Pascal specific keywords (default: True).

delphi

Highlight Borland Delphi specific keywords (default: True).

freepascal

Highlight Free Pascal specific keywords (default: True).

units

A list of units that should be considered builtin, supported are System, SysUtils, Classes and Math. Default is to consider all of them builtin.

Lexers for the Pawn languages

class pygments.lexers.pawn.PawnLexer
短名称

pawn

文件名

*.p, *.pwn, *.inc

MIME 类型

text/x-pawn

For Pawn source code.

2.0 新版功能.

class pygments.lexers.pawn.SourcePawnLexer
短名称

sp

文件名

*.sp

MIME 类型

text/x-sourcepawn

For SourcePawn source code with preprocessor directives.

1.6 新版功能.

Lexers for Pointless

class pygments.lexers.pointless.PointlessLexer
短名称

pointless

文件名

*.ptls

MIME 类型

None

For Pointless source code.

2.7 新版功能.

Lexer for Praat

class pygments.lexers.praat.PraatLexer
短名称

praat

文件名

*.praat, *.proc, *.psc

MIME 类型

None

For Praat scripts.

2.1 新版功能.

Lexer for Procfile file format

class pygments.lexers.procfile.ProcfileLexer
短名称

procfile

文件名

Procfile

MIME 类型

None

Lexer for Procfile file format.

The format is used to run processes on Heroku or is used by Foreman or Honcho tools. For more information about the definition of the format, see: https://devcenter.heroku.com/articles/procfile#procfile-format

2.10 新版功能.

Lexers for Prolog and Prolog-like languages

class pygments.lexers.prolog.LogtalkLexer
短名称

logtalk

文件名

*.lgt, *.logtalk

MIME 类型

text/x-logtalk

For Logtalk source code.

0.10 新版功能.

class pygments.lexers.prolog.PrologLexer
短名称

prolog

文件名

*.ecl, *.prolog, *.pro, *.pl

MIME 类型

text/x-prolog

Lexer for Prolog files.

Lexer for Prometheus Query Language

class pygments.lexers.promql.PromQLLexer
短名称

promql

文件名

*.promql

MIME 类型

None

For PromQL queries.

For details about the grammar see: https://github.com/prometheus/prometheus/tree/master/promql/parser

Lexer for QVT Operational language

class pygments.lexers.qvt.QVToLexer
短名称

qvto, qvt

文件名

*.qvto

MIME 类型

None

For the QVT Operational Mapping language.

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

Notable tokens assignments:

  • Name.Class is assigned to the identifier following any of the following keywords: metamodel, class, exception, primitive, enum, transformation or library

  • Name.Function is assigned to the names of mappings and queries

  • Name.Builtin.Pseudo is assigned to the pre-defined variables ‘this’, ‘self’ and ‘result’.

Lexers for the R/S languages

class pygments.lexers.r.RConsoleLexer
短名称

rconsole, rout

文件名

*.Rout

MIME 类型

None

For R console transcripts or R CMD BATCH output files.

class pygments.lexers.r.RdLexer
短名称

rd

文件名

*.Rd

MIME 类型

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.

1.6 新版功能.

class pygments.lexers.r.SLexer
短名称

splus, s, r

文件名

*.S, *.R, .Rhistory, .Rprofile, .Renviron

MIME 类型

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.

0.10 新版功能.

Lexers for semantic web and RDF query languages and markup

class pygments.lexers.rdf.ShExCLexer
短名称

shexc, shex

文件名

*.shex

MIME 类型

text/shex

Lexer for ShExC shape expressions language syntax.

class pygments.lexers.rdf.SparqlLexer
短名称

sparql

文件名

*.rq, *.sparql

MIME 类型

application/sparql-query

Lexer for SPARQL query language.

2.0 新版功能.

class pygments.lexers.rdf.TurtleLexer
短名称

turtle

文件名

*.ttl

MIME 类型

text/turtle, application/x-turtle

Lexer for Turtle data language.

2.1 新版功能.

Lexer for resource definition files

class pygments.lexers.resource.ResourceLexer
短名称

resourcebundle, resource

文件名

None

MIME 类型

None

Lexer for ICU Resource bundles.

2.0 新版功能.

Lexer for the Ride programming language

class pygments.lexers.ride.RideLexer
短名称

ride

文件名

*.ride

MIME 类型

text/x-ride

For Ride source code.

2.6 新版功能.

Lexer for Relax-NG Compact syntax

class pygments.lexers.rnc.RNCCompactLexer
短名称

rng-compact, rnc

文件名

*.rnc

MIME 类型

None

For RelaxNG-compact syntax.

2.2 新版功能.

Lexers for Roboconf DSL

class pygments.lexers.roboconf.RoboconfGraphLexer
短名称

roboconf-graph

文件名

*.graph

MIME 类型

None

Lexer for Roboconf graph files.

2.1 新版功能.

class pygments.lexers.roboconf.RoboconfInstancesLexer
短名称

roboconf-instances

文件名

*.instances

MIME 类型

None

Lexer for Roboconf instances files.

2.1 新版功能.

Lexer for Robot Framework

class pygments.lexers.robotframework.RobotFrameworkLexer
短名称

robotframework

文件名

*.robot

MIME 类型

text/x-robotframework

For Robot Framework test data.

Supports both space and pipe separated plain text formats.

1.6 新版功能.

Lexers for the Rust language

class pygments.lexers.rust.RustLexer
短名称

rust, rs

文件名

*.rs, *.rs.in

MIME 类型

text/rust, text/x-rust

Lexer for the Rust programming language (version 1.47).

1.6 新版功能.

Lexer for SAS

class pygments.lexers.sas.SASLexer
短名称

sas

文件名

*.SAS, *.sas

MIME 类型

text/x-sas, text/sas, application/x-sas

For SAS files.

2.2 新版功能.

Lexer for Savi

class pygments.lexers.savi.SaviLexer
短名称

savi

文件名

*.savi

MIME 类型

None

For Savi source code.

Lexer for scdoc, a simple man page generator

class pygments.lexers.scdoc.ScdocLexer
短名称

scdoc, scd

文件名

*.scd, *.scdoc

MIME 类型

None

scdoc is a simple man page generator for POSIX systems written in C99. https://git.sr.ht/~sircmpwn/scdoc

2.5 新版功能.

Lexer for scripting and embedded languages

class pygments.lexers.scripting.AppleScriptLexer
短名称

applescript

文件名

*.applescript

MIME 类型

None

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

1.0 新版功能.

class pygments.lexers.scripting.ChaiscriptLexer
短名称

chaiscript, chai

文件名

*.chai

MIME 类型

text/x-chaiscript, application/x-chaiscript

For ChaiScript source code.

2.0 新版功能.

class pygments.lexers.scripting.EasytrieveLexer
短名称

easytrieve

文件名

*.ezt, *.mac

MIME 类型

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.

2.1 新版功能.

class pygments.lexers.scripting.HybrisLexer
短名称

hybris, hy

文件名

*.hy, *.hyb

MIME 类型

text/x-hybris, application/x-hybris

For Hybris source code.

1.4 新版功能.

class pygments.lexers.scripting.JclLexer
短名称

jcl

文件名

*.jcl

MIME 类型

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.

2.1 新版功能.

class pygments.lexers.scripting.LSLLexer
短名称

lsl

文件名

*.lsl

MIME 类型

text/x-lsl

For Second Life’s Linden Scripting Language source code.

2.0 新版功能.

class pygments.lexers.scripting.LuaLexer
短名称

lua

文件名

*.lua, *.wlua

MIME 类型

text/x-lua, application/x-lua

For Lua source code.

Additional options accepted:

func_name_highlighting

If given and True, highlight builtin function names (default: True).

disabled_modules

If given, must be a list of module names whose function names should not be highlighted. By default all modules are highlighted.

To get a list of allowed modules have a look into the _lua_builtins module:

>>> from pygments.lexers._lua_builtins import MODULES
>>> MODULES.keys()
['string', 'coroutine', 'modules', 'io', 'basic', ...]
class pygments.lexers.scripting.MOOCodeLexer
短名称

moocode, moo

文件名

*.moo

MIME 类型

text/x-moocode

For MOOCode (the MOO scripting language).

0.9 新版功能.

class pygments.lexers.scripting.MiniScriptLexer
短名称

miniscript, ms

文件名

*.ms

MIME 类型

text/x-minicript, application/x-miniscript

For MiniScript source code.

2.6 新版功能.

class pygments.lexers.scripting.MoonScriptLexer
短名称

moonscript, moon

文件名

*.moon

MIME 类型

text/x-moonscript, application/x-moonscript

For MoonScript source code.

1.5 新版功能.

class pygments.lexers.scripting.RexxLexer
短名称

rexx, arexx

文件名

*.rexx, *.rex, *.rx, *.arexx

MIME 类型

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.

2.0 新版功能.

Lexer for Smart Game Format (sgf) file format

class pygments.lexers.sgf.SmartGameFormatLexer
短名称

sgf

文件名

*.sgf

MIME 类型

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). For more information about the definition of the format, see: https://www.red-bean.com/sgf/

2.4 新版功能.

Lexers for various shells

class pygments.lexers.shell.BashLexer
短名称

bash, sh, ksh, zsh, shell

文件名

*.sh, *.ksh, *.bash, *.ebuild, *.eclass, *.exheres-0, *.exlib, *.zsh, .bashrc, bashrc, .bash\*, bash\*, zshrc, .zshrc, .kshrc, kshrc, PKGBUILD

MIME 类型

application/x-sh, application/x-shellscript, text/x-shellscript

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

0.6 新版功能.

class pygments.lexers.shell.BashSessionLexer
短名称

console, shell-session

文件名

*.sh-session, *.shell-session

MIME 类型

application/x-shell-session, application/x-sh-session

Lexer for Bash shell sessions, i.e. command lines, including a prompt, interspersed with output.

1.1 新版功能.

class pygments.lexers.shell.BatchLexer
短名称

batch, bat, dosbatch, winbatch

文件名

*.bat, *.cmd

MIME 类型

application/x-dos-batch

Lexer for the DOS/Windows Batch file format.

0.7 新版功能.

class pygments.lexers.shell.ExeclineLexer
短名称

execline

文件名

*.exec

MIME 类型

None

Lexer for Laurent Bercot’s execline language (https://skarnet.org/software/execline).

2.7 新版功能.

class pygments.lexers.shell.FishShellLexer
短名称

fish, fishshell

文件名

*.fish, *.load

MIME 类型

application/x-fish

Lexer for Fish shell scripts.

2.1 新版功能.

class pygments.lexers.shell.MSDOSSessionLexer
短名称

doscon

文件名

None

MIME 类型

None

Lexer for MS DOS shell sessions, i.e. command lines, including a prompt, interspersed with output.

2.1 新版功能.

class pygments.lexers.shell.PowerShellLexer
短名称

powershell, pwsh, posh, ps1, psm1

文件名

*.ps1, *.psm1

MIME 类型

text/x-powershell

For Windows PowerShell code.

1.5 新版功能.

class pygments.lexers.shell.PowerShellSessionLexer
短名称

pwsh-session, ps1con

文件名

None

MIME 类型

None

Lexer for PowerShell sessions, i.e. command lines, including a prompt, interspersed with output.

2.1 新版功能.

class pygments.lexers.shell.SlurmBashLexer
短名称

slurm, sbatch

文件名

*.sl

MIME 类型

None

Lexer for (ba|k|z|)sh Slurm scripts.

2.4 新版功能.

class pygments.lexers.shell.TcshLexer
短名称

tcsh, csh

文件名

*.tcsh, *.csh

MIME 类型

application/x-csh

Lexer for tcsh scripts.

0.10 新版功能.

class pygments.lexers.shell.TcshSessionLexer
短名称

tcshcon

文件名

None

MIME 类型

None

Lexer for Tcsh sessions, i.e. command lines, including a prompt, interspersed with output.

2.1 新版功能.

Lexer for Sieve file format

class pygments.lexers.sieve.SieveLexer
短名称

sieve

文件名

*.siv, *.sieve

MIME 类型

None

Lexer for sieve format.

Lexer for the Slash programming

class pygments.lexers.slash.SlashLexer
短名称

slash

文件名

*.sla

MIME 类型

None

Lexer for the Slash programming language.

2.4 新版功能.

Lexers for the Smithy IDL

class pygments.lexers.smithy.SmithyLexer
短名称

smithy

文件名

*.smithy

MIME 类型

None

For Smithy IDL

2.10 新版功能.

Lexers for the SMV languages

class pygments.lexers.smv.NuSMVLexer
短名称

nusmv

文件名

*.smv

MIME 类型

None

Lexer for the NuSMV language.

2.2 新版功能.

Lexers for the SNOBOL language

class pygments.lexers.snobol.SnobolLexer
短名称

snobol

文件名

*.snobol

MIME 类型

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.

1.5 新版功能.

Lexers for Solidity

class pygments.lexers.solidity.SolidityLexer
短名称

solidity

文件名

*.sol

MIME 类型

None

For Solidity source code.

2.5 新版功能.

Lexer for Sophia

class pygments.lexers.sophia.SophiaLexer
短名称

sophia

文件名

*.aes

MIME 类型

None

A Sophia lexer.

2.11 新版功能.

Special lexers

class pygments.lexers.special.OutputLexer
短名称

output

文件名

None

MIME 类型

None

Simple lexer that highlights everything as Token.Generic.Output.

2.10 新版功能.

class pygments.lexers.special.RawTokenLexer
短名称

None

文件名

None

MIME 类型

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
短名称

text

文件名

*.txt

MIME 类型

text/plain

“Null” lexer, doesn’t highlight anything.

Lexers for the Spice programming language

class pygments.lexers.spice.SpiceLexer
短名称

spice, spicelang

文件名

*.spice

MIME 类型

text/x-spice

For Spice source.

2.11 新版功能.

Lexers for .SRCINFO files used by Arch Linux Packages

class pygments.lexers.srcinfo.SrcinfoLexer
短名称

srcinfo

文件名

.SRCINFO

MIME 类型

None

Lexer for .SRCINFO files used by Arch Linux Packages.

2.11 新版功能.

Lexer for Stata

class pygments.lexers.stata.StataLexer
短名称

stata, do

文件名

*.do, *.ado

MIME 类型

text/x-stata, text/stata, application/x-stata

For Stata do files.

2.2 新版功能.

Lexer for SuperCollider

class pygments.lexers.supercollider.SuperColliderLexer
短名称

supercollider, sc

文件名

*.sc, *.scd

MIME 类型

application/supercollider, text/supercollider

For SuperCollider source code.

2.1 新版功能.

Lexer for TEAL

class pygments.lexers.teal.TealLexer
短名称

teal

文件名

*.teal

MIME 类型

None

For the Transaction Execution Approval Language (TEAL) <https://developer.algorand.org/docs/reference/teal/specification/>

For more information about the grammar, see: https://github.com/algorand/go-algorand/blob/master/data/transactions/logic/assembler.go

2.9 新版功能.

Lexers for various template engines’ markup

class pygments.lexers.templates.Angular2HtmlLexer
短名称

html+ng2

文件名

*.ng2

MIME 类型

None

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

2.0 新版功能.

class pygments.lexers.templates.Angular2Lexer
短名称

ng2

文件名

None

MIME 类型

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.

2.1 新版功能.

class pygments.lexers.templates.CheetahHtmlLexer
短名称

html+cheetah, html+spitfire, htmlcheetah

文件名

None

MIME 类型

text/html+cheetah, text/html+spitfire

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

class pygments.lexers.templates.CheetahJavascriptLexer
短名称

javascript+cheetah, js+cheetah, javascript+spitfire, js+spitfire

文件名

None

MIME 类型

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
短名称

cheetah, spitfire

文件名

*.tmpl, *.spt

MIME 类型

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
短名称

xml+cheetah, xml+spitfire

文件名

None

MIME 类型

application/xml+cheetah, application/xml+spitfire

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

class pygments.lexers.templates.ColdfusionCFCLexer
短名称

cfc

文件名

*.cfc

MIME 类型

None

Coldfusion markup/script components

2.0 新版功能.

class pygments.lexers.templates.ColdfusionHtmlLexer
短名称

cfm

文件名

*.cfm, *.cfml

MIME 类型

application/x-coldfusion

Coldfusion markup in html

class pygments.lexers.templates.ColdfusionLexer
短名称

cfs

文件名

None

MIME 类型

None

Coldfusion statements

class pygments.lexers.templates.CssDjangoLexer
短名称

css+django, css+jinja

文件名

None

MIME 类型

text/css+django, text/css+jinja

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

class pygments.lexers.templates.CssErbLexer
短名称

css+ruby, css+erb

文件名

None

MIME 类型

text/css+ruby

Subclass of ErbLexer which highlights unlexed data with the CssLexer.

class pygments.lexers.templates.CssGenshiLexer
短名称

css+genshitext, css+genshi

文件名

None

MIME 类型

text/css+genshi

A lexer that highlights CSS definitions in genshi text templates.

class pygments.lexers.templates.CssPhpLexer
短名称

css+php

文件名

None

MIME 类型

text/css+php

Subclass of PhpLexer which highlights unmatched data with the CssLexer.

class pygments.lexers.templates.CssSmartyLexer
短名称

css+smarty

文件名

None

MIME 类型

text/css+smarty

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

class pygments.lexers.templates.DjangoLexer
短名称

django, jinja

文件名

None

MIME 类型

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
短名称

erb

文件名

None

MIME 类型

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
短名称

html+evoque

文件名

*.html

MIME 类型

text/html+evoque

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

1.1 新版功能.

class pygments.lexers.templates.EvoqueLexer
短名称

evoque

文件名

*.evoque

MIME 类型

application/x-evoque

For files using the Evoque templating system.

1.1 新版功能.

class pygments.lexers.templates.EvoqueXmlLexer
短名称

xml+evoque

文件名

*.xml

MIME 类型

application/xml+evoque

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

1.1 新版功能.

class pygments.lexers.templates.GenshiLexer
短名称

genshi, kid, xml+genshi, xml+kid

文件名

*.kid

MIME 类型

application/x-genshi, application/x-kid

A lexer that highlights genshi and kid kid XML templates.

class pygments.lexers.templates.GenshiTextLexer
短名称

genshitext

文件名

None

MIME 类型

application/x-genshi-text, text/x-genshi

A lexer that highlights genshi text templates.

class pygments.lexers.templates.HandlebarsHtmlLexer
短名称

html+handlebars

文件名

*.handlebars, *.hbs

MIME 类型

text/html+handlebars, text/x-handlebars-template

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

2.0 新版功能.

class pygments.lexers.templates.HandlebarsLexer
短名称

handlebars

文件名

None

MIME 类型

None

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

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

2.0 新版功能.

class pygments.lexers.templates.HtmlDjangoLexer
短名称

html+django, html+jinja, htmldjango

文件名

None

MIME 类型

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
短名称

html+genshi, html+kid

文件名

None

MIME 类型

text/html+genshi

A lexer that highlights genshi and kid kid HTML templates.

class pygments.lexers.templates.HtmlPhpLexer
短名称

html+php

文件名

*.phtml

MIME 类型

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
短名称

html+smarty

文件名

None

MIME 类型

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
短名称

javascript+django, js+django, javascript+jinja, js+jinja

文件名

None

MIME 类型

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
短名称

javascript+ruby, js+ruby, javascript+erb, js+erb

文件名

None

MIME 类型

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
短名称

js+genshitext, js+genshi, javascript+genshitext, javascript+genshi

文件名

None

MIME 类型

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
短名称

javascript+php, js+php

文件名

None

MIME 类型

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
短名称

javascript+smarty, js+smarty

文件名

None

MIME 类型

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
短名称

jsp

文件名

*.jsp

MIME 类型

application/x-jsp

Lexer for Java Server Pages.

0.7 新版功能.

class pygments.lexers.templates.LassoCssLexer
短名称

css+lasso

文件名

None

MIME 类型

text/css+lasso

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

1.6 新版功能.

class pygments.lexers.templates.LassoHtmlLexer
短名称

html+lasso

文件名

None

MIME 类型

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.

1.6 新版功能.

class pygments.lexers.templates.LassoJavascriptLexer
短名称

javascript+lasso, js+lasso

文件名

None

MIME 类型

application/x-javascript+lasso, text/x-javascript+lasso, text/javascript+lasso

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

1.6 新版功能.

class pygments.lexers.templates.LassoXmlLexer
短名称

xml+lasso

文件名

None

MIME 类型

application/xml+lasso

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

1.6 新版功能.

class pygments.lexers.templates.LiquidLexer
短名称

liquid

文件名

*.liquid

MIME 类型

None

Lexer for Liquid templates.

2.0 新版功能.

class pygments.lexers.templates.MakoCssLexer
短名称

css+mako

文件名

None

MIME 类型

text/css+mako

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

0.7 新版功能.

class pygments.lexers.templates.MakoHtmlLexer
短名称

html+mako

文件名

None

MIME 类型

text/html+mako

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

0.7 新版功能.

class pygments.lexers.templates.MakoJavascriptLexer
短名称

javascript+mako, js+mako

文件名

None

MIME 类型

application/x-javascript+mako, text/x-javascript+mako, text/javascript+mako

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

0.7 新版功能.

class pygments.lexers.templates.MakoLexer
短名称

mako

文件名

*.mao

MIME 类型

application/x-mako

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

0.7 新版功能.

class pygments.lexers.templates.MakoXmlLexer
短名称

xml+mako

文件名

None

MIME 类型

application/xml+mako

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

0.7 新版功能.

class pygments.lexers.templates.MasonLexer
短名称

mason

文件名

*.m, *.mhtml, *.mc, *.mi, autohandler, dhandler

MIME 类型

application/x-mason

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

1.4 新版功能.

class pygments.lexers.templates.MyghtyCssLexer
短名称

css+myghty

文件名

None

MIME 类型

text/css+myghty

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

0.6 新版功能.

class pygments.lexers.templates.MyghtyHtmlLexer
短名称

html+myghty

文件名

None

MIME 类型

text/html+myghty

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

0.6 新版功能.

class pygments.lexers.templates.MyghtyJavascriptLexer
短名称

javascript+myghty, js+myghty

文件名

None

MIME 类型

application/x-javascript+myghty, text/x-javascript+myghty, text/javascript+mygthy

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

0.6 新版功能.

class pygments.lexers.templates.MyghtyLexer
短名称

myghty

文件名

*.myt, autodelegate

MIME 类型

application/x-myghty

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

0.6 新版功能.

class pygments.lexers.templates.MyghtyXmlLexer
短名称

xml+myghty

文件名

None

MIME 类型

application/xml+myghty

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

0.6 新版功能.

class pygments.lexers.templates.RhtmlLexer
短名称

rhtml, html+erb, html+ruby

文件名

*.rhtml

MIME 类型

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
短名称

smarty

文件名

*.tpl

MIME 类型

application/x-smarty

Generic Smarty template lexer.

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

class pygments.lexers.templates.SspLexer
短名称

ssp

文件名

*.ssp

MIME 类型

application/x-ssp

Lexer for Scalate Server Pages.

1.4 新版功能.

class pygments.lexers.templates.TeaTemplateLexer
短名称

tea

文件名

*.tea

MIME 类型

text/x-tea

Lexer for Tea Templates.

1.5 新版功能.

class pygments.lexers.templates.TwigHtmlLexer
短名称

html+twig

文件名

*.twig

MIME 类型

text/html+twig

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

2.0 新版功能.

class pygments.lexers.templates.TwigLexer
短名称

twig

文件名

None

MIME 类型

application/x-twig

Twig template lexer.

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

2.0 新版功能.

class pygments.lexers.templates.VelocityHtmlLexer
短名称

html+velocity

文件名

None

MIME 类型

text/html+velocity

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

class pygments.lexers.templates.VelocityLexer
短名称

velocity

文件名

*.vm, *.fhtml

MIME 类型

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
短名称

xml+velocity

文件名

None

MIME 类型

application/xml+velocity

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

class pygments.lexers.templates.XmlDjangoLexer
短名称

xml+django, xml+jinja

文件名

None

MIME 类型

application/xml+django, application/xml+jinja

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

class pygments.lexers.templates.XmlErbLexer
短名称

xml+ruby, xml+erb

文件名

None

MIME 类型

application/xml+ruby

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

class pygments.lexers.templates.XmlPhpLexer
短名称

xml+php

文件名

None

MIME 类型

application/xml+php

Subclass of PhpLexer that highlights unhandled data with the XmlLexer.

class pygments.lexers.templates.XmlSmartyLexer
短名称

xml+smarty

文件名

None

MIME 类型

application/xml+smarty

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

class pygments.lexers.templates.YamlJinjaLexer
短名称

yaml+jinja, salt, sls

文件名

*.sls

MIME 类型

text/x-yaml+jinja, text/x-sls

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

Commonly used in Saltstack salt states.

2.0 新版功能.

Lexer for Tera Term macro files

class pygments.lexers.teraterm.TeraTermLexer
短名称

teratermmacro, teraterm, ttl

文件名

*.ttl

MIME 类型

text/x-teratermmacro

For Tera Term macro source code.

2.4 新版功能.

Lexers for testing languages

class pygments.lexers.testing.GherkinLexer
短名称

gherkin, cucumber

文件名

*.feature

MIME 类型

text/x-gherkin

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

1.2 新版功能.

class pygments.lexers.testing.TAPLexer
短名称

tap

文件名

*.tap

MIME 类型

None

For Test Anything Protocol (TAP) output.

2.1 新版功能.

Lexers for various text formats

class pygments.lexers.textfmts.GettextLexer
短名称

pot, po

文件名

*.pot, *.po

MIME 类型

application/x-gettext, text/x-gettext, text/gettext

Lexer for Gettext catalog files.

0.9 新版功能.

class pygments.lexers.textfmts.HttpLexer
短名称

http

文件名

None

MIME 类型

None

Lexer for HTTP sessions.

1.5 新版功能.

class pygments.lexers.textfmts.IrcLogsLexer
短名称

irc

文件名

*.weechatlog

MIME 类型

text/x-irclog

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

class pygments.lexers.textfmts.KernelLogLexer
短名称

kmsg, dmesg

文件名

*.kmsg, *.dmesg

MIME 类型

None

For Linux Kernel log (“dmesg”) output.

2.6 新版功能.

class pygments.lexers.textfmts.NotmuchLexer
短名称

notmuch

文件名

None

MIME 类型

None

For Notmuch email text format.

2.5 新版功能.

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).

class pygments.lexers.textfmts.TodotxtLexer
短名称

todotxt

文件名

todo.txt, *.todotxt

MIME 类型

text/x-todo

Lexer for Todo.txt todo list format.

2.0 新版功能.

Lexers for theorem-proving languages

class pygments.lexers.theorem.CoqLexer
短名称

coq

文件名

*.v

MIME 类型

text/x-coq

For the Coq theorem prover.

1.5 新版功能.

class pygments.lexers.theorem.IsabelleLexer
短名称

isabelle

文件名

*.thy

MIME 类型

text/x-isabelle

For the Isabelle proof assistant.

2.0 新版功能.

class pygments.lexers.theorem.LeanLexer
短名称

lean

文件名

*.lean

MIME 类型

text/x-lean

For the Lean theorem prover.

2.0 新版功能.

Lexers for the ThingsDB language

class pygments.lexers.thingsdb.ThingsDBLexer
短名称

ti, thingsdb

文件名

*.ti

MIME 类型

None

Lexer for the ThingsDB programming language.

2.9 新版功能.

Lexer for Typographic Number Theory

class pygments.lexers.tnt.TNTLexer
短名称

tnt

文件名

*.tnt

MIME 类型

None

Lexer for Typographic Number Theory, as described in the book Gödel, Escher, Bach, by Douglas R. Hofstadter, or as summarized here: https://github.com/Kenny2github/language-tnt/blob/master/README.md#summary-of-tnt

2.7 新版功能.

Lexer for RiverBed’s TrafficScript (RTS) language

class pygments.lexers.trafficscript.RtsLexer
短名称

trafficscript, rts

文件名

*.rts

MIME 类型

None

For Riverbed Stingray Traffic Manager

2.1 新版功能.

Lexers for TypoScript

class pygments.lexers.typoscript.TypoScriptCssDataLexer
短名称

typoscriptcssdata

文件名

None

MIME 类型

None

Lexer that highlights markers, constants and registers within css blocks.

2.2 新版功能.

class pygments.lexers.typoscript.TypoScriptHtmlDataLexer
短名称

typoscripthtmldata

文件名

None

MIME 类型

None

Lexer that highlights markers, constants and registers within html tags.

2.2 新版功能.

class pygments.lexers.typoscript.TypoScriptLexer
短名称

typoscript

文件名

*.typoscript

MIME 类型

text/x-typoscript

Lexer for TypoScript code.

http://docs.typo3.org/typo3cms/TyposcriptReference/

2.2 新版功能.

Lexers for the Icon and Unicon languages, including ucode VM

class pygments.lexers.unicon.IconLexer
短名称

icon

文件名

*.icon, *.ICON

MIME 类型

None

Lexer for Icon.

1.6 新版功能.

class pygments.lexers.unicon.UcodeLexer
短名称

ucode

文件名

*.u, *.u1, *.u2

MIME 类型

None

Lexer for Icon ucode files.

2.4 新版功能.

class pygments.lexers.unicon.UniconLexer
短名称

unicon

文件名

*.icn

MIME 类型

text/unicon

For Unicon source code.

2.4 新版功能.

Lexers for UrbiScript language

class pygments.lexers.urbi.UrbiscriptLexer
短名称

urbiscript

文件名

*.u

MIME 类型

application/x-urbiscript

For UrbiScript source code.

1.5 新版功能.

The module that parses Pixar’s Universal Scene Description file format

class pygments.lexers.usd.UsdLexer
短名称

usd, usda

文件名

*.usd, *.usda

MIME 类型

None

A lexer that parses Pixar’s Universal Scene Description file format.

2.6 新版功能.

Lexers for Varnish configuration

class pygments.lexers.varnish.VCLLexer
短名称

vcl

文件名

*.vcl

MIME 类型

text/x-vclsrc

For Varnish Configuration Language (VCL).

2.2 新版功能.

class pygments.lexers.varnish.VCLSnippetLexer
短名称

vclsnippets, vclsnippet

文件名

None

MIME 类型

text/x-vclsnippet

For Varnish Configuration Language snippets.

2.2 新版功能.

Lexer for Intermediate Verification Languages (IVLs)

class pygments.lexers.verification.BoogieLexer
短名称

boogie

文件名

*.bpl

MIME 类型

None

For Boogie source code.

2.1 新版功能.

class pygments.lexers.verification.SilverLexer
短名称

silver

文件名

*.sil, *.vpr

MIME 类型

None

For Silver source code.

2.2 新版功能.

Lexers for the WebAssembly text format

class pygments.lexers.webassembly.WatLexer
短名称

wast, wat

文件名

*.wat, *.wast

MIME 类型

None

Lexer for the WebAssembly text format.

2.9 新版功能.

Lexers for Web IDL, including some extensions

class pygments.lexers.webidl.WebIDLLexer
短名称

webidl

文件名

*.webidl

MIME 类型

None

For Web IDL.

2.6 新版功能.

Lexers for misc. web stuff

class pygments.lexers.webmisc.CirruLexer
短名称

cirru

文件名

*.cirru

MIME 类型

text/x-cirru

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

  • using () for expressions, but restricted in a same line

  • using "" for strings, with \ for escaping chars

  • using $ as folding operator

  • using , as unfolding operator

  • using indentations for nested blocks

2.0 新版功能.

class pygments.lexers.webmisc.DuelLexer
短名称

duel, jbst, jsonml+bst

文件名

*.duel, *.jbst

MIME 类型

text/x-duel, text/x-jbst

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

1.4 新版功能.

class pygments.lexers.webmisc.QmlLexer
短名称

qml, qbs

文件名

*.qml, *.qbs

MIME 类型

application/x-qml, application/x-qt.qbs+qml

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

1.6 新版功能.

class pygments.lexers.webmisc.SlimLexer
短名称

slim

文件名

*.slim

MIME 类型

text/x-slim

For Slim markup.

2.0 新版功能.

class pygments.lexers.webmisc.XQueryLexer
短名称

xquery, xqy, xq, xql, xqm

文件名

*.xqy, *.xquery, *.xq, *.xql, *.xqm

MIME 类型

text/xquery, application/xquery

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

1.4 新版功能.

Lexers for the Whiley language

class pygments.lexers.whiley.WhileyLexer
短名称

whiley

文件名

*.whiley

MIME 类型

text/x-whiley

Lexer for the Whiley programming language.

2.2 新版功能.

Lexers for the X10 programming language

class pygments.lexers.x10.X10Lexer
短名称

x10, xten

文件名

*.x10

MIME 类型

text/x-x10

For the X10 language.

0.1 新版功能.

Lexers for Xorg configs

class pygments.lexers.xorg.XorgLexer
短名称

xorg.conf

文件名

xorg.conf

MIME 类型

None

Lexer for xorg.conf file.

Lexer for the YANG 1.1 modeling language. See RFC 7950

class pygments.lexers.yang.YangLexer
短名称

yang

文件名

*.yang

MIME 类型

application/yang

Lexer for YANG, based on RFC7950

2.7 新版功能.

Lexers for Zig

class pygments.lexers.zig.ZigLexer
短名称

zig

文件名

*.zig

MIME 类型

text/zig

For Zig source code.

grammar: https://ziglang.org/documentation/master/#Grammar

迭代所有 lexer

0.6 新版功能.

要获得所有的 lexer(包括内置的和插件的),你可以使用 pygments.lexers 模块中的 get_all_lexers() 函数:

>>> 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'), (), ())

正如你所看到的,返回值是一个迭代器,它产生了 (name, aliases, filetypes, mimetypes) 形式的元组。