Pygments を使うもの、たとえば Sphinx なんかでは、「language=」をまぁ手書きするわけなんだけれど。
しょっちゅう使うものは忘れないんだけど、たまにしか使わないのは結構出てこない。ので。
ほとんどのアプリケーションでは、以下表の「names」を指定します。つまり「language=”pycon”」てな具合。WEBアプリケーションの場合は fullname をプルダウンから選ばせることが多いかね。
fullname | names | exts |
---|---|---|
ABAP | abap | *.abap |
ANTLR | antlr | |
ANTLR With ActionScript Target | antlr-as antlr-actionscript |
*.G *.g |
ANTLR With C# Target | antlr-csharp antlr-c# |
*.G *.g |
ANTLR With CPP Target | antlr-cpp | *.G *.g |
ANTLR With Java Target | antlr-java | *.G *.g |
ANTLR With ObjectiveC Target | antlr-objc | *.G *.g |
ANTLR With Perl Target | antlr-perl | *.G *.g |
ANTLR With Python Target | antlr-python | *.G *.g |
ANTLR With Ruby Target | antlr-ruby antlr-rb |
*.G *.g |
APL | apl | *.apl |
ActionScript | as actionscript |
*.as |
ActionScript 3 | as3 actionscript3 |
*.as |
Ada | ada ada95 ada2005 |
*.adb *.ads *.ada |
Agda | agda | *.agda |
Alloy | alloy | *.als |
AmbientTalk | at ambienttalk ambienttalk/2 |
*.at |
ApacheConf | apacheconf aconf apache |
.htaccess apache.conf apache2.conf |
AppleScript | applescript | *.applescript |
AspectJ | aspectj | *.aj |
Asymptote | asy asymptote |
*.asy |
AutoIt | autoit | *.au3 |
Awk | awk gawk mawk nawk |
*.awk |
BBCode | bbcode | |
BUGS | bugs winbugs openbugs |
*.bug |
Base Makefile | basemake | |
Bash | bash sh ksh shell |
*.sh *.ksh *.bash *.ebuild *.eclass .bashrc bashrc .bash_* bash_* PKGBUILD |
Bash Session | console | *.sh-session |
Batchfile | bat batch dosbatch winbatch |
*.bat *.cmd |
Befunge | befunge | *.befunge |
BlitzBasic | blitzbasic b3d bplus |
*.bb *.decls |
BlitzMax | blitzmax bmax |
*.bmx |
Boo | boo | *.boo |
Brainfuck | brainfuck bf |
*.bf *.b |
Bro | bro | *.bro |
C | c | *.c *.h *.idc |
C# | csharp c# |
*.cs |
C++ | cpp c++ |
*.cpp *.hpp *.c++ *.h++ *.cc *.hh *.cxx *.hxx *.C *.H *.cp *.CPP |
CBM BASIC V2 | cbmbas | *.bas |
CFEngine3 | cfengine3 cf3 |
*.cf |
CMake | cmake | *.cmake CMakeLists.txt |
COBOL | cobol | *.cob *.COB *.cpy *.CPY |
COBOLFree | cobolfree | *.cbl *.CBL |
CSS | css | *.css |
CSS+Django/Jinja | css+django css+jinja |
|
CSS+Genshi Text | css+genshitext css+genshi |
|
CSS+Lasso | css+lasso | |
CSS+Mako | css+mako | |
CSS+Myghty | css+myghty | |
CSS+PHP | css+php | |
CSS+Ruby | css+erb css+ruby |
|
CSS+Smarty | css+smarty | |
CSS+mozpreproc | css+mozpreproc | *.css.in |
CUDA | cuda cu |
*.cu *.cuh |
Ceylon | ceylon | *.ceylon |
ChaiScript | chai chaiscript |
*.chai |
Chapel | chapel chpl |
*.chpl |
Cheetah | cheetah spitfire |
*.tmpl *.spt |
Cirru | cirru | *.cirru |
Clay | clay | *.clay |
Clojure | clojure clj |
*.clj |
ClojureScript | clojurescript cljs |
*.cljs |
CoffeeScript | coffee-script coffeescript coffee |
*.coffee |
Coldfusion CFC | cfc | *.cfc |
Coldfusion HTML | cfm | *.cfm *.cfml |
Common Lisp | common-lisp cl lisp elisp emacs emacs-lisp |
*.cl *.lisp *.el |
Coq | coq | *.v |
Croc | croc | *.croc |
Cryptol | cryptol cry |
*.cry |
Cypher | cypher | *.cyp *.cypher |
Cython | cython pyx pyrex |
*.pyx *.pxd *.pxi |
D | d | *.d *.di |
DTD | dtd | *.dtd |
Darcs Patch | dpatch | *.dpatch *.darcspatch |
Dart | dart | *.dart |
Debian Control file | control debcontrol |
control |
Debian Sourcelist | sourceslist sources.list debsources |
sources.list |
Delphi | delphi pas pascal objectpascal |
*.pas |
Diff | diff udiff |
*.diff *.patch |
Django/Jinja | django jinja |
|
Docker | docker dockerfile |
Dockerfile *.docker |
Duel | duel jbst jsonml+bst |
*.duel *.jbst |
Dylan | dylan | *.dylan *.dyl *.intr |
Dylan session | dylan-console dylan-repl |
*.dylan-console |
DylanLID | dylan-lid lid |
*.lid *.hdp |
EBNF | ebnf | *.ebnf |
ECL | ecl | *.ecl |
ERB | erb | |
Eiffel | eiffel | *.e |
Elixir | elixir ex exs |
*.ex *.exs |
Elixir iex session | iex | |
Embedded Ragel | ragel-em | *.rl |
Erlang | erlang | *.erl *.hrl *.es *.escript |
Erlang erl session | erl | *.erl-sh |
Evoque | evoque | *.evoque |
FSharp | fsharp | *.fs *.fsi |
Factor | factor | *.factor |
Fancy | fancy fy |
*.fy *.fancypack |
Fantom | fan | *.fan |
Felix | felix flx |
*.flx *.flxh |
Fortran | fortran | *.f *.f90 *.F *.F90 |
FoxPro | foxpro vfp clipper xbase |
*.PRG *.prg |
GAP | gap | *.g *.gd *.gi *.gap |
GAS | gas asm |
*.s *.S |
GLSL | glsl | *.vert *.frag *.geo |
Genshi | genshi kid xml+genshi xml+kid |
*.kid |
Genshi Text | genshitext | |
Gettext Catalog | pot po |
*.pot *.po |
Gherkin | cucumber gherkin |
*.feature |
Gnuplot | gnuplot | *.plot *.plt |
Go | go | *.go |
Golo | golo | *.golo |
GoodData-CL | gooddata-cl | *.gdc |
Gosu | gosu | *.gs *.gsx *.gsp *.vark |
Gosu Template | gst | *.gst |
Groff | groff nroff man |
*.[1234567] *.man |
Groovy | groovy | *.groovy |
HTML | html | *.html *.htm *.xhtml *.xslt |
HTML+Cheetah | html+cheetah html+spitfire htmlcheetah |
|
HTML+Django/Jinja | html+django html+jinja htmldjango |
|
HTML+Evoque | html+evoque | *.html |
HTML+Genshi | html+genshi html+kid |
|
HTML+Handlebars | html+handlebars | *.handlebars *.hbs |
HTML+Lasso | html+lasso | |
HTML+Mako | html+mako | |
HTML+Myghty | html+myghty | |
HTML+PHP | html+php | *.phtml |
HTML+Smarty | html+smarty | |
HTML+Twig | html+twig | *.twig |
HTML+Velocity | html+velocity | |
HTTP | http | |
Haml | haml | *.haml |
Handlebars | handlebars | |
Haskell | haskell hs |
*.hs |
Haxe | hx haxe hxsl |
*.hx *.hxsl |
Hxml | haxeml hxml |
*.hxml |
Hy | hylang | *.hy |
Hybris | hybris hy |
*.hy *.hyb |
IDL | idl | *.pro |
INI | ini cfg dosini |
*.ini *.cfg |
IRC logs | irc | *.weechatlog |
Idris | idris idr |
*.idr |
Igor | igor igorpro |
*.ipf |
Inform 6 | inform6 i6 |
*.inf |
Inform 6 template | i6t | *.i6t |
Inform 7 | inform7 i7 |
*.ni *.i7x |
Io | io | *.io |
Ioke | ioke ik |
*.ik |
Isabelle | isabelle | *.thy |
JAGS | jags | *.jag *.bug |
JSON | json | *.json |
JSON-LD | jsonld json-ld |
*.jsonld |
Jade | jade | *.jade |
Jasmin | jasmin jasminxt |
*.j |
Java | java | *.java |
Java Server Page | jsp | *.jsp |
JavaScript | js javascript |
*.js |
JavaScript+Cheetah | js+cheetah javascript+cheetah js+spitfire javascript+spitfire |
|
JavaScript+Django/Jinja | js+django javascript+django js+jinja javascript+jinja |
|
JavaScript+Genshi Text | js+genshitext js+genshi javascript+genshitext javascript+genshi |
|
JavaScript+Lasso | js+lasso javascript+lasso |
|
JavaScript+Mako | js+mako javascript+mako |
|
JavaScript+Myghty | js+myghty javascript+myghty |
|
JavaScript+PHP | js+php javascript+php |
|
JavaScript+Ruby | js+erb javascript+erb js+ruby javascript+ruby |
|
JavaScript+Smarty | js+smarty javascript+smarty |
|
Javascript+mozpreproc | javascript+mozpreproc | *.js.in |
Julia | julia jl |
*.jl |
Julia console | jlcon | |
Kal | kal | *.kal |
Kconfig | kconfig menuconfig linux-config kernel-config |
Kconfig *Config.in* external.in* standard-modules.in |
Koka | koka | *.kk *.kki |
Kotlin | kotlin | *.kt |
LLVM | llvm | *.ll |
LSL | lsl | *.lsl |
Lasso | lasso lassoscript |
*.lasso *.lasso[89] |
Lean | lean | *.lean |
Lighttpd configuration file | lighty lighttpd |
|
Limbo | limbo | *.b |
Literate Agda | lagda literate-agda |
*.lagda |
Literate Cryptol | lcry literate-cryptol lcryptol |
*.lcry |
Literate Haskell | lhs literate-haskell lhaskell |
*.lhs |
Literate Idris | lidr literate-idris lidris |
*.lidr |
LiveScript | live-script livescript |
*.ls |
Logos | logos | *.x *.xi *.xm *.xmi |
Logtalk | logtalk | *.lgt *.logtalk |
Lua | lua | *.lua *.wlua |
MAQL | maql | *.maql |
MOOCode | moocode moo |
*.moo |
MQL | mql mq4 mq5 mql4 mql5 |
*.mq4 *.mq5 *.mqh |
MXML | mxml | *.mxml |
Makefile | make makefile mf bsdmake |
*.mak *.mk Makefile makefile Makefile.* GNUmakefile |
Mako | mako | *.mao |
Mask | mask | *.mask |
Mason | mason | *.m *.mhtml *.mc *.mi autohandler dhandler |
Mathematica | mathematica mma nb |
*.nb *.cdf *.nbp *.ma |
Matlab | matlab | *.m |
Matlab session | matlabsession | |
MiniD | minid | |
Modelica | modelica | *.mo |
Modula-2 | modula2 m2 |
*.def *.mod |
MoinMoin/Trac Wiki markup | trac-wiki moin |
|
Monkey | monkey | *.monkey |
MoonScript | moon moonscript |
*.moon |
Mscgen | mscgen msc |
*.msc |
MuPAD | mupad | *.mu |
MySQL | mysql | |
Myghty | myghty | *.myt autodelegate |
NASM | nasm | *.asm *.ASM |
NSIS | nsis nsi nsh |
*.nsi *.nsh |
Nemerle | nemerle | *.n |
NewLisp | newlisp | *.lsp *.nl |
Newspeak | newspeak | *.ns2 |
Nginx configuration file | nginx | |
Nimrod | nimrod nim |
*.nim *.nimrod |
Nit | nit | *.nit |
Nix | nixos nix |
*.nix |
NumPy | numpy | |
OCaml | ocaml | *.ml *.mli *.mll *.mly |
Objective-C | objective-c objectivec obj-c objc |
*.m *.h |
Objective-C++ | objective-c++ objectivec++ obj-c++ objc++ |
*.mm *.hh |
Objective-J | objective-j objectivej obj-j objj |
*.j |
Octave | octave | *.m |
Ooc | ooc | *.ooc |
Opa | opa | *.opa |
OpenEdge ABL | openedge abl progress |
*.p *.cls |
PHP | php php3 php4 php5 |
*.php *.php[345] *.inc |
PL/pgSQL | plpgsql | |
POVRay | pov | *.pov *.inc |
Pan | pan | *.pan |
Pawn | pawn | *.p *.pwn *.inc |
Perl | perl pl |
*.pl *.pm *.t |
Perl6 | perl6 pl6 |
*.pl *.pm *.nqp *.p6 *.6pl *.p6l *.pl6 *.6pm *.p6m *.pm6 *.t |
Pig | pig | *.pig |
Pike | pike | *.pike *.pmod |
PostScript | postscript postscr |
*.ps *.eps |
PostgreSQL SQL dialect | postgresql postgres |
|
PostgreSQL console (psql) | psql postgresql-console postgres-console |
|
PowerShell | powershell posh ps1 psm1 |
*.ps1 *.psm1 |
Prolog | prolog | *.ecl *.prolog *.pro *.pl |
Properties | properties jproperties |
*.properties |
Protocol Buffer | protobuf proto |
*.proto |
Puppet | puppet | *.pp |
PyPy Log | pypylog pypy |
*.pypylog |
Python | python py sage |
*.py *.pyw *.sc SConstruct SConscript *.tac *.sage |
Python 3 | python3 py3 |
|
Python 3.0 Traceback | py3tb | *.py3tb |
Python Traceback | pytb | *.pytb |
Python console session | pycon | |
QBasic | qbasic basic |
*.BAS *.bas |
QML | qml | *.qml |
RConsole | rconsole rout |
*.Rout |
REBOL | rebol | *.r *.r3 *.reb |
RHTML | rhtml html+erb html+ruby |
*.rhtml |
RPMSpec | spec | *.spec |
RQL | rql | *.rql |
RSL | rsl | *.rsl |
Racket | racket rkt |
*.rkt *.rktd *.rktl |
Ragel | ragel | |
Ragel in C Host | ragel-c | *.rl |
Ragel in CPP Host | ragel-cpp | *.rl |
Ragel in D Host | ragel-d | *.rl |
Ragel in Java Host | ragel-java | *.rl |
Ragel in Objective C Host | ragel-objc | *.rl |
Ragel in Ruby Host | ragel-ruby ragel-rb |
*.rl |
Raw token data | raw | |
Rd | rd | *.Rd |
Red | red red/system |
*.red *.reds |
Redcode | redcode | *.cw |
ResourceBundle | resource resourcebundle |
*.txt |
Rexx | rexx arexx |
*.rexx *.rex *.rx *.arexx |
RobotFramework | robotframework | *.txt *.robot |
Ruby | rb ruby duby |
*.rb *.rbw Rakefile *.rake *.gemspec *.rbx *.duby |
Ruby irb session | rbcon irb |
|
Rust | rust | *.rs |
S | splus s r |
*.S *.R .Rhistory .Rprofile .Renviron |
SCSS | scss | *.scss |
SPARQL | sparql | *.rq *.sparql |
SQL | sql | *.sql |
SWIG | swig | *.swg *.i |
Sass | sass | *.sass |
Scala | scala | *.scala |
Scalate Server Page | ssp | *.ssp |
Scaml | scaml | *.scaml |
Scheme | scheme scm |
*.scm *.ss |
Scilab | scilab | *.sci *.sce *.tst |
Shell Session | shell-session | *.shell-session |
Slim | slim | *.slim |
Smali | smali | *.smali |
Smalltalk | smalltalk squeak st |
*.st |
Smarty | smarty | *.tpl |
Snobol | snobol | *.snobol |
SourcePawn | sp | *.sp |
SquidConf | squidconf squid.conf squid |
squid.conf |
Stan | stan | *.stan |
Standard ML | sml | *.sml *.sig *.fun |
Swift | swift | *.swift |
TADS 3 | tads3 | *.t |
Tcl | tcl | *.tcl *.rvt |
Tcsh | tcsh csh |
*.tcsh *.csh |
TeX | tex latex |
*.tex *.aux *.toc |
Tea | tea | *.tea |
Text only | text | *.txt |
Todotxt | todotxt | todo.txt *.todotxt |
Treetop | treetop | *.treetop *.tt |
Twig | twig | |
TypeScript | ts | *.ts |
UrbiScript | urbiscript | *.u |
VB.net | vb.net vbnet |
*.vb *.bas |
VCTreeStatus | vctreestatus | |
VGL | vgl | *.rpf |
Vala | vala vapi |
*.vala *.vapi |
Velocity | velocity | *.vm *.fhtml |
VimL | vim | *.vim .vimrc .exrc .gvimrc _vimrc _exrc _gvimrc vimrc gvimrc |
XML | xml | *.xml *.xsl *.rss *.xslt *.xsd *.wsdl *.wsf |
XML+Cheetah | xml+cheetah xml+spitfire |
|
XML+Django/Jinja | xml+django xml+jinja |
|
XML+Evoque | xml+evoque | *.xml |
XML+Lasso | xml+lasso | |
XML+Mako | xml+mako | |
XML+Myghty | xml+myghty | |
XML+PHP | xml+php | |
XML+Ruby | xml+erb xml+ruby |
|
XML+Smarty | xml+smarty | |
XML+Velocity | xml+velocity | |
XQuery | xquery xqy xq xql xqm |
*.xqy *.xquery *.xq *.xql *.xqm |
XSLT | xslt | *.xsl *.xslt *.xpl |
XUL+mozpreproc | xul+mozpreproc | *.xul.in |
Xtend | xtend | *.xtend |
YAML | yaml | *.yaml *.yml |
YAML+Jinja | yaml+jinja salt sls |
*.sls |
Zephir | zephir | *.zep |
aspx-cs | aspx-cs | *.aspx *.asax *.ascx *.ashx *.asmx *.axd |
aspx-vb | aspx-vb | *.aspx *.asax *.ascx *.ashx *.asmx *.axd |
autohotkey | ahk autohotkey |
*.ahk *.ahkl |
c-objdump | c-objdump | *.c-objdump |
ca65 assembler | ca65 | *.s |
cfstatement | cfs | |
cpp-objdump | cpp-objdump c++-objdumb cxx-objdump |
*.cpp-objdump *.c++-objdump *.cxx-objdump |
d-objdump | d-objdump | *.d-objdump |
dg | dg | *.dg |
eC | ec | *.ec *.eh |
liquid | liquid | *.liquid |
mozhashpreproc | mozhashpreproc | |
mozpercentpreproc | mozpercentpreproc | |
nesC | nesc | *.nc |
objdump | objdump | *.objdump |
objdump-nasm | objdump-nasm | *.objdump-intel |
reStructuredText | rst rest restructuredtext |
*.rst *.rest |
reg | registry | *.reg |
sqlite3con | sqlite3 | *.sqlite3-console |
systemverilog | systemverilog sv |
*.sv *.svh |
verilog | verilog v |
*.v |
vhdl | vhdl | *.vhdl *.vhd |
なお、この一覧を作るのは簡単です。上に貼り付けた表の場合:
1 import pygments
2 from pygments.lexers import get_all_lexers
3 print("<table class='wikitable'>")
4 print("<caption>(pygments version %s)</caption>" % pygments.__version__)
5 print("""\
6 <tbody>
7 <tr><th>fullname</th><th>names</th><th>exts</th></tr>""")
8 for fullname, names, exts, _ in sorted(get_all_lexers()):
9 print("<tr><td>%s</td><td>%s</td><td>%s</td></tr>" % (
10 fullname,
11 "<br/>".join(names),
12 "<br/>".join(exts)))
13 print("</tbody>")
14 print("</table>")