Skip to content

Instantly share code, notes, and snippets.

@mislav
Created December 4, 2012 14:23
Show Gist options
  • Save mislav/4204428 to your computer and use it in GitHub Desktop.
Save mislav/4204428 to your computer and use it in GitHub Desktop.
Differences between languages and aliases supported by Pygments.rb vs Linguist

There is Pygments.rb and there is Linguist, which wraps the former.

Pygments::Lexer['ruby']
Linguist::Language['ruby']

However not all languages and their aliases are supported between the two; Linguist won't find "yml" instead of "yaml", and Pygments doesn't recognize aliases such as "zsh" or "node".

Linguist no Pygments
====================
C2hs Haskell
DCPU-16 ASM
Ecere Projects
Emacs Lisp
Gentoo Ebuild
Gentoo Eclass
Groovy Server Pages
IRC log
Java Server Pages
Parrot Assembly
Parrot Internal Representation
Pure Data
Visual Basic
apex
arc
arduino
asp
assembly
c2hs
c2hs-haskell
ceylon
chuck
coldfusion
darcs-patch
dcpu-16-asm
ecere-projects
eiffel
elisp
emacs
emacs-lisp
f#
gentoo-ebuild
gentoo-eclass
gettext-catalog
groovy-server-pages
irc-log
java-server-pages
jruby
lilypond
macruby
markdown
max
max/msp
maxmsp
mirah
node
nu
nush
opencl
openedge-abl
osascript
parrot
parrot-assembly
parrot-internal-representation
pasm
pir
pure-data
python-traceback
racket
raw-token-data
rust
sage
self
standard-ml
supercollider
textile
turing
twig
visual-basic
xs
zsh
Pygments no Linguist
====================
abap
aconf
actionscript 3
actionscript3
ada95ada2005
adb
ads
ahkl
antlr
antlr with actionscript target
antlr with c# target
antlr with cpp target
antlr with java target
antlr with objectivec target
antlr with perl target
antlr with python target
antlr with ruby target
antlr-actionscript
antlr-as
antlr-c#
antlr-cpp
antlr-csharp
antlr-java
antlr-objc
antlr-perl
antlr-python
antlr-rb
antlr-ruby
apache
apacheconf
as
asax
ascx
ashx
asm
asmx
aspx-cs
asy
asymptote
aug
aux
awk
axd
b
bas
base makefile
basemake
bash session
bbcode
bf
bmax
bmx
bsdmake
c++-objdumb
c++-objdump
cc
cf
cf3
cfc
cfengine3
cfg
cfml
cfs
cfstatement
cheetah
cl
clj
cls
cmd
coffee-script
coldfusion html
conf
console
control
cs
csh
css+django
css+django/jinja
css+erb
css+genshi
css+genshi text
css+genshitext
css+jinja
css+mako
css+myghty
css+php
css+ruby
css+smarty
cw
cxx
cxx-objdump
darcspatch
dasm
debian control file
debian sourcelist
def
di
django
django/jinja
dtd
duby
duel
duel engine
duel view
dyl
ebuild
eclass
eh
el
elixir iex session
embedded ragel
eps
erb
erl
erl-sh
erlang erl session
es
escript
evoque
ex
exs
f
f90
fan
fancypack
feature
felix
fhtml
flx
flxh
frag
fs
fsharp
fsi
fun
fy
g
gawk
gdc
gemspec
genshi text
genshitext
geo
gherkin
glsl
gnuplot
gooddata-cl
gosu template
gs
gst
gsx
h
h++
hh
hpp
hrl
hs
htm
html+cheetah
html+django/jinja
html+evoque
html+genshi
html+jinja
html+kid
html+mako
html+myghty
html+ruby
html+smarty
html+spitfire
html+velocity
http
hx
hxx
hy
hyb
hybris
idc
iex
ik
inc
irb
irc logs
j
jade
java server page
javascript+cheetah
javascript+django
javascript+django/jinja
javascript+erb
javascript+genshi
javascript+genshi text
javascript+genshitext
javascript+jinja
javascript+mako
javascript+myghty
javascript+php
javascript+ruby
javascript+smarty
javascript+spitfire
jbst
jinja
jl
jlcon
js+cheetah
js+django
js+erb
js+genshi
js+genshitext
js+jinja
js+mako
js+myghty
js+php
js+ruby
js+smarty
js+spitfire
jsonml+bst
julia console
kid
ksh
kt
latex
lgt
lighttpd
lighttpd configuration file
lighty
list
ll
lsp
m
m2
mak
make
man
mao
maql
mason
matlab session
matlabsession
mawk
mc
md
mf
mhtml
mi
ml
mli
mll
mly
mo
mod
modelica
modula-2
modula2
moin
moinmoin/trac wiki markup
moo
moon
moonscript
mu
mxml
mysql
myt
n
nawk
newlisp
newspeak
nginx
nginx configuration file
nim
nl
nroff
ns2
obj-c
obj-j
objc
objectivec
objectivej
objectpascal
objj
octave
p
pas
pascal
patch
php3
php4
php5
phtml
pl
pl/pgsql
plot
plpgsql
plt
pm
po
postgres
postgres-console
postgresql
postgresql console (psql)
postgresql sql dialect
postgresql-console
postscript
pov
povray
pp
pro
properties
proto
protobuf
protocol buffer
ps
ps1
psql
pxd
pxi
py
py3
py3tb
pycon
pypy
pypy log
pypylog
pytb
python 3
python 3.0 traceback
python console session
python3
pyw
pyx
r3
ragel
ragel in c host
ragel in cpp host
ragel in d host
ragel in java host
ragel in objective c host
ragel in ruby host
ragel-c
ragel-cpp
ragel-d
ragel-em
ragel-java
ragel-objc
ragel-rb
ragel-ruby
rbcon
rbw
rconsole
rest
rkt
rl
rout
rss
ruby irb session
s
sc
scalate server page
scaml
sce
sci
scm
sh-session
sig
snobol
sources.list
sourceslist
spitfire
splus
spt
sqlite3
sqlite3-console
sqlite3con
squeak
squid
squid.conf
squidconf
ss
ssp
st
sv
svh
systemverilog
tac
text
text only
tmpl
toc
tpl
trac-wiki
tst
txt
u
udiff
urbiscript
v
vapi
vark
vb
vb.net
vbnet
velocity
vert
vhd
vm
weechatlog
wlua
wsdl
xhtml
xml+cheetah
xml+django
xml+django/jinja
xml+erb
xml+evoque
xml+genshi
xml+jinja
xml+kid
xml+mako
xml+php
xml+ruby
xml+smarty
xml+spitfire
xml+velocity
xqy
xsd
xsl
yml
require 'linguist'
chew = lambda { |list|
list.flatten.uniq.sort
}
py = chew.call Pygments::Lexer.instance_variable_get('@index').keys.map(&:downcase)
li = chew.call Linguist::Language.instance_variable_get('@index').keys
li_no_py = li - py
li_no_py.reject! {|lang| py.include? lang.downcase }
li_no_py.reject! {|lang| lang =~ /[A-Z]/ and li.include? lang.downcase }
py_no_li = py - li.map(&:downcase)
if false
puts li_no_py
else
puts py_no_li
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment