gitlab-pygments.rb 0.3.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +71 -0
- data/Gemfile +1 -1
- data/LICENSE +17 -0
- data/README.md +28 -1
- data/Rakefile +2 -5
- data/lexers +0 -0
- data/lib/pygments/mentos.py +19 -12
- data/lib/pygments/popen.rb +21 -4
- data/lib/pygments/version.rb +1 -1
- data/pygments.rb.gemspec +2 -0
- data/test/test_pygments.rb +13 -2
- data/vendor/custom_lexers/github.py +206 -3
- data/vendor/pygments-main/AUTHORS +41 -3
- data/vendor/pygments-main/CHANGES +132 -5
- data/vendor/pygments-main/LICENSE +1 -1
- data/vendor/pygments-main/Makefile +1 -1
- data/vendor/pygments-main/REVISION +1 -1
- data/vendor/pygments-main/docs/generate.py +1 -1
- data/vendor/pygments-main/docs/src/api.txt +1 -1
- data/vendor/pygments-main/docs/src/index.txt +1 -1
- data/vendor/pygments-main/docs/src/integrate.txt +5 -0
- data/vendor/pygments-main/docs/src/java.txt +70 -0
- data/vendor/pygments-main/docs/src/lexerdevelopment.txt +52 -0
- data/vendor/pygments-main/external/autopygmentize +64 -0
- data/vendor/pygments-main/external/lasso-builtins-generator-9.lasso +144 -0
- data/vendor/pygments-main/external/markdown-processor.py +2 -2
- data/vendor/pygments-main/external/moin-parser.py +1 -1
- data/vendor/pygments-main/external/rst-directive-old.py +1 -1
- data/vendor/pygments-main/external/rst-directive.py +1 -1
- data/vendor/pygments-main/pygmentize +1 -1
- data/vendor/pygments-main/pygments/__init__.py +2 -2
- data/vendor/pygments-main/pygments/cmdline.py +14 -6
- data/vendor/pygments-main/pygments/console.py +1 -1
- data/vendor/pygments-main/pygments/filter.py +1 -1
- data/vendor/pygments-main/pygments/filters/__init__.py +3 -4
- data/vendor/pygments-main/pygments/formatter.py +4 -1
- data/vendor/pygments-main/pygments/formatters/__init__.py +1 -1
- data/vendor/pygments-main/pygments/formatters/_mapping.py +3 -3
- data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
- data/vendor/pygments-main/pygments/formatters/html.py +73 -2
- data/vendor/pygments-main/pygments/formatters/img.py +2 -2
- data/vendor/pygments-main/pygments/formatters/latex.py +9 -9
- data/vendor/pygments-main/pygments/formatters/other.py +1 -3
- data/vendor/pygments-main/pygments/formatters/rtf.py +1 -1
- data/vendor/pygments-main/pygments/formatters/svg.py +1 -1
- data/vendor/pygments-main/pygments/formatters/terminal.py +1 -1
- data/vendor/pygments-main/pygments/formatters/terminal256.py +1 -1
- data/vendor/pygments-main/pygments/lexer.py +78 -10
- data/vendor/pygments-main/pygments/lexers/__init__.py +13 -2
- data/vendor/pygments-main/pygments/lexers/_asybuiltins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_clbuiltins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_lassobuiltins.py +5172 -0
- data/vendor/pygments-main/pygments/lexers/_luabuiltins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_mapping.py +92 -36
- data/vendor/pygments-main/pygments/lexers/_openedgebuiltins.py +562 -0
- data/vendor/pygments-main/pygments/lexers/_phpbuiltins.py +2 -2
- data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +4 -3
- data/vendor/pygments-main/pygments/lexers/_robotframeworklexer.py +557 -0
- data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +11 -0
- data/vendor/pygments-main/pygments/lexers/_sourcemodbuiltins.py +1072 -0
- data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +360 -0
- data/vendor/pygments-main/pygments/lexers/_vimbuiltins.py +13 -3
- data/vendor/pygments-main/pygments/lexers/agile.py +525 -38
- data/vendor/pygments-main/pygments/lexers/asm.py +45 -7
- data/vendor/pygments-main/pygments/lexers/compiled.py +1257 -425
- data/vendor/pygments-main/pygments/lexers/dalvik.py +104 -0
- data/vendor/pygments-main/pygments/lexers/dotnet.py +97 -62
- data/vendor/pygments-main/pygments/lexers/foxpro.py +428 -0
- data/vendor/pygments-main/pygments/lexers/functional.py +931 -32
- data/vendor/pygments-main/pygments/lexers/github.py +206 -3
- data/vendor/pygments-main/pygments/lexers/hdl.py +3 -3
- data/vendor/pygments-main/pygments/lexers/jvm.py +309 -44
- data/vendor/pygments-main/pygments/lexers/math.py +876 -30
- data/vendor/pygments-main/pygments/lexers/other.py +956 -517
- data/vendor/pygments-main/pygments/lexers/parsers.py +85 -2
- data/vendor/pygments-main/pygments/lexers/shell.py +81 -18
- data/vendor/pygments-main/pygments/lexers/special.py +1 -1
- data/vendor/pygments-main/pygments/lexers/sql.py +2 -2
- data/vendor/pygments-main/pygments/lexers/templates.py +119 -8
- data/vendor/pygments-main/pygments/lexers/text.py +155 -15
- data/vendor/pygments-main/pygments/lexers/web.py +1578 -397
- data/vendor/pygments-main/pygments/modeline.py +40 -0
- data/vendor/pygments-main/pygments/plugin.py +1 -1
- data/vendor/pygments-main/pygments/scanner.py +1 -1
- data/vendor/pygments-main/pygments/style.py +1 -1
- data/vendor/pygments-main/pygments/styles/__init__.py +1 -1
- data/vendor/pygments-main/pygments/styles/autumn.py +1 -1
- data/vendor/pygments-main/pygments/styles/borland.py +1 -1
- data/vendor/pygments-main/pygments/styles/bw.py +1 -1
- data/vendor/pygments-main/pygments/styles/colorful.py +1 -1
- data/vendor/pygments-main/pygments/styles/default.py +1 -1
- data/vendor/pygments-main/pygments/styles/emacs.py +1 -1
- data/vendor/pygments-main/pygments/styles/friendly.py +1 -1
- data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
- data/vendor/pygments-main/pygments/styles/manni.py +1 -1
- data/vendor/pygments-main/pygments/styles/monokai.py +1 -1
- data/vendor/pygments-main/pygments/styles/murphy.py +1 -1
- data/vendor/pygments-main/pygments/styles/native.py +1 -1
- data/vendor/pygments-main/pygments/styles/pastie.py +1 -1
- data/vendor/pygments-main/pygments/styles/perldoc.py +1 -1
- data/vendor/pygments-main/pygments/styles/rrt.py +1 -1
- data/vendor/pygments-main/pygments/styles/tango.py +1 -1
- data/vendor/pygments-main/pygments/styles/trac.py +1 -1
- data/vendor/pygments-main/pygments/styles/vim.py +1 -1
- data/vendor/pygments-main/pygments/styles/vs.py +1 -1
- data/vendor/pygments-main/pygments/token.py +1 -1
- data/vendor/pygments-main/pygments/unistring.py +36 -26
- data/vendor/pygments-main/pygments/util.py +46 -1
- data/vendor/pygments-main/scripts/check_sources.py +2 -2
- data/vendor/pygments-main/scripts/detect_missing_analyse_text.py +2 -0
- data/vendor/pygments-main/scripts/find_codetags.py +1 -1
- data/vendor/pygments-main/scripts/find_error.py +5 -6
- data/vendor/pygments-main/setup.cfg +1 -0
- data/vendor/pygments-main/setup.py +6 -4
- data/vendor/pygments-main/tests/examplefiles/BOM.js +1 -0
- data/vendor/pygments-main/tests/examplefiles/Config.in.cache +1973 -0
- data/vendor/pygments-main/tests/examplefiles/Deflate.fs +578 -0
- data/vendor/pygments-main/tests/examplefiles/Get-CommandDefinitionHtml.ps1 +66 -0
- data/vendor/pygments-main/tests/examplefiles/IPDispatchC.nc +104 -0
- data/vendor/pygments-main/tests/examplefiles/IPDispatchP.nc +671 -0
- data/vendor/pygments-main/tests/examplefiles/RoleQ.pm6 +23 -0
- data/vendor/pygments-main/tests/examplefiles/autoit_submit.au3 +25 -0
- data/vendor/pygments-main/tests/examplefiles/bigtest.nsi +308 -0
- data/vendor/pygments-main/tests/examplefiles/ca65_example +284 -0
- data/vendor/pygments-main/tests/examplefiles/cbmbas_example +9 -0
- data/vendor/pygments-main/tests/examplefiles/classes.dylan +89 -4
- data/vendor/pygments-main/tests/examplefiles/example.Rd +78 -0
- data/vendor/pygments-main/tests/examplefiles/example.bug +54 -0
- data/vendor/pygments-main/tests/examplefiles/example.ceylon +52 -0
- data/vendor/pygments-main/tests/examplefiles/example.clay +33 -0
- data/vendor/pygments-main/tests/examplefiles/example.cob +3556 -0
- data/vendor/pygments-main/tests/examplefiles/example.hx +142 -0
- data/vendor/pygments-main/tests/examplefiles/example.jag +48 -0
- data/vendor/pygments-main/tests/examplefiles/example.lagda +19 -0
- data/vendor/pygments-main/tests/examplefiles/example.monkey +152 -0
- data/vendor/pygments-main/tests/examplefiles/example.msc +43 -0
- data/vendor/pygments-main/tests/examplefiles/example.prg +161 -0
- data/vendor/pygments-main/tests/examplefiles/example.reg +19 -0
- data/vendor/pygments-main/tests/examplefiles/example.rexx +50 -0
- data/vendor/pygments-main/tests/examplefiles/example.rkt +95 -0
- data/vendor/pygments-main/tests/examplefiles/example.rpf +4 -0
- data/vendor/pygments-main/tests/examplefiles/example.shell-session +45 -0
- data/vendor/pygments-main/tests/examplefiles/example.stan +108 -0
- data/vendor/pygments-main/tests/examplefiles/example.ts +28 -0
- data/vendor/pygments-main/tests/examplefiles/example.xtend +34 -0
- data/vendor/pygments-main/tests/examplefiles/example2.msc +79 -0
- data/vendor/pygments-main/tests/examplefiles/garcia-wachs.kk +133 -0
- data/vendor/pygments-main/tests/examplefiles/grammar-test.p6 +22 -0
- data/vendor/pygments-main/tests/examplefiles/hello.smali +40 -0
- data/vendor/pygments-main/tests/examplefiles/hello.sp +9 -0
- data/vendor/pygments-main/tests/examplefiles/http_request_example +2 -1
- data/vendor/pygments-main/tests/examplefiles/http_response_example +4 -2
- data/vendor/pygments-main/tests/examplefiles/inet_pton6.dg +71 -0
- data/vendor/pygments-main/tests/examplefiles/json.lasso +301 -0
- data/vendor/pygments-main/tests/examplefiles/json.lasso9 +213 -0
- data/vendor/pygments-main/tests/examplefiles/livescript-demo.ls +41 -0
- data/vendor/pygments-main/tests/examplefiles/logos_example.xm +28 -0
- data/vendor/pygments-main/tests/examplefiles/matlab_sample +5 -2
- data/vendor/pygments-main/tests/examplefiles/metagrammar.treetop +455 -0
- data/vendor/pygments-main/tests/examplefiles/mg_sample.pro +73 -0
- data/vendor/pygments-main/tests/examplefiles/minehunt.qml +112 -0
- data/vendor/pygments-main/tests/examplefiles/nanomsg.intr +95 -0
- data/vendor/pygments-main/tests/examplefiles/objc_example.m +7 -0
- data/vendor/pygments-main/tests/examplefiles/phpMyAdmin.spec +163 -0
- data/vendor/pygments-main/tests/examplefiles/py3tb_test.py3tb +4 -0
- data/vendor/pygments-main/tests/examplefiles/pytb_test3.pytb +4 -0
- data/vendor/pygments-main/tests/examplefiles/robotframework.txt +39 -0
- data/vendor/pygments-main/tests/examplefiles/rust_example.rs +233 -0
- data/vendor/pygments-main/tests/examplefiles/session.dylan-console +9 -0
- data/vendor/pygments-main/tests/examplefiles/swig_java.swg +1329 -0
- data/vendor/pygments-main/tests/examplefiles/swig_std_vector.i +225 -0
- data/vendor/pygments-main/tests/examplefiles/test.R +149 -115
- data/vendor/pygments-main/tests/examplefiles/test.agda +102 -0
- data/vendor/pygments-main/tests/examplefiles/test.bb +95 -0
- data/vendor/pygments-main/tests/examplefiles/test.cu +36 -0
- data/vendor/pygments-main/tests/examplefiles/test.ebnf +31 -0
- data/vendor/pygments-main/tests/examplefiles/test.opa +10 -0
- data/vendor/pygments-main/tests/examplefiles/test.p6 +252 -0
- data/vendor/pygments-main/tests/examplefiles/test2.pypylog +120 -0
- data/vendor/pygments-main/tests/examplefiles/type.lisp +16 -0
- data/vendor/pygments-main/tests/examplefiles/unix-io.lid +37 -0
- data/vendor/pygments-main/tests/old_run.py +1 -1
- data/vendor/pygments-main/tests/run.py +3 -2
- data/vendor/pygments-main/tests/support/tags +36 -0
- data/vendor/pygments-main/tests/test_basic_api.py +4 -3
- data/vendor/pygments-main/tests/test_clexer.py +1 -1
- data/vendor/pygments-main/tests/test_cmdline.py +1 -1
- data/vendor/pygments-main/tests/test_examplefiles.py +3 -1
- data/vendor/pygments-main/tests/test_html_formatter.py +17 -1
- data/vendor/pygments-main/tests/test_latex_formatter.py +1 -1
- data/vendor/pygments-main/tests/test_lexers_other.py +68 -0
- data/vendor/pygments-main/tests/test_perllexer.py +1 -1
- data/vendor/pygments-main/tests/test_regexlexer.py +1 -1
- data/vendor/pygments-main/tests/test_token.py +1 -1
- data/vendor/pygments-main/tests/test_using_api.py +1 -1
- data/vendor/pygments-main/tests/test_util.py +22 -3
- metadata +84 -16
@@ -6,13 +6,17 @@ Major developers are Tim Hatch <tim@timhatch.com> and Armin Ronacher
|
|
6
6
|
Other contributors, listed alphabetically, are:
|
7
7
|
|
8
8
|
* Sam Aaron -- Ioke lexer
|
9
|
-
* Kumar Appaiah -- Debian control lexer
|
10
9
|
* Ali Afshar -- image formatter
|
10
|
+
* Thomas Aglassinger -- Rexx lexer
|
11
|
+
* Kumar Appaiah -- Debian control lexer
|
11
12
|
* Andreas Amann -- AppleScript lexer
|
13
|
+
* Timothy Armstrong -- Dart lexer fixes
|
14
|
+
* Jeffrey Arnold -- R/S, Rd, BUGS, Jags, and Stan lexers
|
12
15
|
* Jeremy Ashkenas -- CoffeeScript lexer
|
13
16
|
* Stefan Matthias Aust -- Smalltalk lexer
|
14
17
|
* Ben Bangert -- Mako lexers
|
15
18
|
* Max Battcher -- Darcs patch lexer
|
19
|
+
* Tim Baumann -- (Literate) Agda lexer
|
16
20
|
* Paul Baumgart, 280 North, Inc. -- Objective-J lexer
|
17
21
|
* Michael Bayer -- Myghty lexers
|
18
22
|
* John Benediktsson -- Factor lexer
|
@@ -22,52 +26,78 @@ Other contributors, listed alphabetically, are:
|
|
22
26
|
* Frits van Bommel -- assembler lexers
|
23
27
|
* Pierre Bourdon -- bugfixes
|
24
28
|
* Hiram Chirino -- Scaml and Jade lexers
|
29
|
+
* Ian Cooper -- VGL lexer
|
25
30
|
* Leaf Corcoran -- MoonScript lexer
|
31
|
+
* Christian Jann -- ShellSession lexer
|
26
32
|
* Christopher Creutzig -- MuPAD lexer
|
27
33
|
* Pete Curry -- bugfixes
|
28
|
-
*
|
34
|
+
* Bryan Davis -- EBNF lexer
|
35
|
+
* Owen Durni -- Haxe lexer
|
29
36
|
* Nick Efford -- Python 3 lexer
|
37
|
+
* Sven Efftinge -- Xtend lexer
|
30
38
|
* Artem Egorkine -- terminal256 formatter
|
31
39
|
* James H. Fisher -- PostScript lexer
|
40
|
+
* William S. Fulton -- SWIG lexer
|
32
41
|
* Carlos Galdino -- Elixir and Elixir Console lexers
|
42
|
+
* Michael Galloy -- IDL lexer
|
33
43
|
* Naveen Garg -- Autohotkey lexer
|
34
44
|
* Laurent Gautier -- R/S lexer
|
35
45
|
* Alex Gaynor -- PyPy log lexer
|
46
|
+
* Richard Gerkin -- Igor Pro lexer
|
47
|
+
* Alain Gilbert -- TypeScript lexer
|
48
|
+
* Alex Gilding -- BlitzBasic lexer
|
36
49
|
* Bertrand Goetzmann -- Groovy lexer
|
37
50
|
* Krzysiek Goj -- Scala lexer
|
38
51
|
* Matt Good -- Genshi, Cheetah lexers
|
52
|
+
* Michał Górny -- vim modeline support
|
39
53
|
* Patrick Gotthardt -- PHP namespaces support
|
40
54
|
* Olivier Guibe -- Asymptote lexer
|
55
|
+
* Jordi Gutiérrez Hermoso -- Octave lexer
|
41
56
|
* Martin Harriman -- SNOBOL lexer
|
42
57
|
* Matthew Harrison -- SVG formatter
|
43
58
|
* Steven Hazel -- Tcl lexer
|
44
59
|
* Aslak Hellesøy -- Gherkin lexer
|
45
|
-
*
|
60
|
+
* Greg Hendershott -- Racket lexer
|
46
61
|
* David Hess, Fish Software, Inc. -- Objective-J lexer
|
47
62
|
* Varun Hiremath -- Debian control lexer
|
63
|
+
* Rob Hoelz -- Perl 6 lexer
|
64
|
+
* Doug Hogan -- Mscgen lexer
|
48
65
|
* Ben Hollis -- Mason lexer
|
66
|
+
* Dustin Howett -- Logos lexer
|
67
|
+
* Alastair Houghton -- Lexer inheritance facility
|
49
68
|
* Tim Howard -- BlitzMax lexer
|
50
69
|
* Ivan Inozemtsev -- Fantom lexer
|
51
70
|
* Brian R. Jackson -- Tea lexer
|
52
71
|
* Dennis Kaarsemaker -- sources.list lexer
|
53
72
|
* Igor Kalnitsky -- vhdl lexer
|
73
|
+
* Pekka Klärck -- Robot Framework lexer
|
74
|
+
* Eric Knibbe -- Lasso lexer
|
75
|
+
* Stepan Koltsov -- Clay lexer
|
54
76
|
* Adam Koprowski -- Opa lexer
|
55
77
|
* Benjamin Kowarsch -- Modula-2 lexer
|
78
|
+
* Alexander Kriegisch -- Kconfig and AspectJ lexers
|
56
79
|
* Marek Kubica -- Scheme lexer
|
57
80
|
* Jochen Kupperschmidt -- Markdown processor
|
58
81
|
* Gerd Kurzbach -- Modelica lexer
|
82
|
+
* Jon Larimer, Google Inc. -- Smali lexer
|
59
83
|
* Olov Lassus -- Dart lexer
|
60
84
|
* Sylvestre Ledru -- Scilab lexer
|
61
85
|
* Mark Lee -- Vala lexer
|
62
86
|
* Ben Mabey -- Gherkin lexer
|
87
|
+
* Angus MacArthur -- QML lexer
|
63
88
|
* Simone Margaritelli -- Hybris lexer
|
64
89
|
* Kirk McDonald -- D lexer
|
65
90
|
* Gordon McGregor -- SystemVerilog lexer
|
66
91
|
* Stephen McKamey -- Duel/JBST lexer
|
67
92
|
* Brian McKenna -- F# lexer
|
93
|
+
* Charles McLaughlin -- Puppet lexer
|
68
94
|
* Lukas Meuser -- BBCode formatter, Lua lexer
|
95
|
+
* Paul Miller -- LiveScript lexer
|
69
96
|
* Hong Minhee -- HTTP lexer
|
70
97
|
* Michael Mior -- Awk lexer
|
98
|
+
* Bruce Mitchener -- Dylan lexer rewrite
|
99
|
+
* Reuben Morais -- SourcePawn lexer
|
100
|
+
* Jon Morton -- Rust lexer
|
71
101
|
* Paulo Moura -- Logtalk lexer
|
72
102
|
* Mher Movsisyan -- DTD lexer
|
73
103
|
* Ana Nelson -- Ragel, ANTLR, R console lexers
|
@@ -76,11 +106,13 @@ Other contributors, listed alphabetically, are:
|
|
76
106
|
* Mike Nolta -- Julia lexer
|
77
107
|
* Jonas Obrist -- BBCode lexer
|
78
108
|
* David Oliva -- Rebol lexer
|
109
|
+
* Pat Pannuto -- nesC lexer
|
79
110
|
* Jon Parise -- Protocol buffers lexer
|
80
111
|
* Ronny Pfannschmidt -- BBCode lexer
|
81
112
|
* Benjamin Peterson -- Test suite refactoring
|
82
113
|
* Dominik Picheta -- Nimrod lexer
|
83
114
|
* Clément Prévost -- UrbiScript lexer
|
115
|
+
* Kashif Rasul -- CUDA lexer
|
84
116
|
* Justin Reidy -- MXML lexer
|
85
117
|
* Norman Richards -- JSON lexer
|
86
118
|
* Lubomir Rintel -- GoodData MAQL and CL lexers
|
@@ -92,17 +124,22 @@ Other contributors, listed alphabetically, are:
|
|
92
124
|
* Joe Schafer -- Ada lexer
|
93
125
|
* Ken Schutte -- Matlab lexers
|
94
126
|
* Tassilo Schweyer -- Io, MOOCode lexers
|
127
|
+
* Ted Shaw -- AutoIt lexer
|
95
128
|
* Joerg Sieker -- ABAP lexer
|
96
129
|
* Robert Simmons -- Standard ML lexer
|
97
130
|
* Kirill Simonov -- YAML lexer
|
131
|
+
* Alexander Smishlajev -- Visual FoxPro lexer
|
98
132
|
* Steve Spigarelli -- XQuery lexer
|
99
133
|
* Jerome St-Louis -- eC lexer
|
100
134
|
* James Strachan -- Kotlin lexer
|
135
|
+
* Tom Stuart -- Treetop lexer
|
101
136
|
* Tiberius Teng -- default style overhaul
|
102
137
|
* Jeremy Thurgood -- Erlang, Squid config lexers
|
138
|
+
* Brian Tiffin -- OpenCOBOL lexer
|
103
139
|
* Erick Tryzelaar -- Felix lexer
|
104
140
|
* Daniele Varrazzo -- PostgreSQL lexers
|
105
141
|
* Abe Voelker -- OpenEdge ABL lexer
|
142
|
+
* Pepijn de Vos -- HTML formatter CTags support
|
106
143
|
* Whitney Young -- ObjectiveC lexer
|
107
144
|
* Matthias Vallentin -- Bro lexer
|
108
145
|
* Nathan Weizenbaum -- Haml and Sass lexers
|
@@ -110,6 +147,7 @@ Other contributors, listed alphabetically, are:
|
|
110
147
|
* Nils Winter -- Smalltalk lexer
|
111
148
|
* Davy Wybiral -- Clojure lexer
|
112
149
|
* Diego Zamboni -- CFengine3 lexer
|
150
|
+
* Enrique Zamudio -- Ceylon lexer
|
113
151
|
* Alex Zimin -- Nemerle lexer
|
114
152
|
|
115
153
|
Many thanks for all contributions!
|
@@ -2,17 +2,144 @@ Pygments changelog
|
|
2
2
|
==================
|
3
3
|
|
4
4
|
Issue numbers refer to the tracker at
|
5
|
-
http://bitbucket.org/birkenfeld/pygments-main/issues
|
5
|
+
<http://bitbucket.org/birkenfeld/pygments-main/issues>,
|
6
|
+
pull request numbers to the requests at
|
7
|
+
<http://bitbucket.org/birkenfeld/pygments-main/pull-requests/merged>.
|
8
|
+
|
9
|
+
Version 1.7
|
10
|
+
-----------
|
11
|
+
(under development)
|
12
|
+
|
13
|
+
- Lexers added:
|
14
|
+
|
15
|
+
* Clay (PR#184)
|
16
|
+
* Perl 6 (PR#181)
|
17
|
+
* Swig (PR#168)
|
18
|
+
* nesC (PR#166)
|
19
|
+
* BlitzBasic (PR#197)
|
20
|
+
* EBNF (PR#193)
|
21
|
+
* Igor Pro (PR#172)
|
22
|
+
* Rexx (PR#199)
|
23
|
+
* Agda and Literate Agda (PR#203)
|
24
|
+
|
25
|
+
- Pygments will now recognize "vim" modelines when guessing the lexer for
|
26
|
+
a file based on content (PR#118).
|
27
|
+
|
28
|
+
- The NameHighlightFilter now works with any Name.* token type (#790).
|
29
|
+
|
30
|
+
- Python 3 lexer: add new exceptions from PEP 3151.
|
31
|
+
|
32
|
+
- Opa lexer: add new keywords (PR#170).
|
33
|
+
|
34
|
+
- Julia lexer: add keywords and underscore-separated number
|
35
|
+
literals (PR#176).
|
36
|
+
|
37
|
+
- Lasso lexer: fix method highlighting, update builtins. Fix
|
38
|
+
guessing so that plain XML isn't always taken as Lasso (PR#163).
|
39
|
+
|
40
|
+
- Objective C/C++ lexers: allow "@" prefixing any expression (#871).
|
41
|
+
|
42
|
+
- Ruby lexer: fix lexing of Name::Space tokens (#860).
|
43
|
+
|
44
|
+
- Stan lexer: update for version 1.3.0 of the language (PR#162).
|
45
|
+
|
46
|
+
- JavaScript lexer: add the "yield" keyword (PR#196).
|
47
|
+
|
48
|
+
- HTTP lexer: support for PATCH method (PR#190).
|
49
|
+
|
50
|
+
- Koka lexer: update to newest language spec (PR#201).
|
51
|
+
|
52
|
+
- Haxe lexer: rewrite and support for Haxe 3 (PR#174).
|
53
|
+
|
54
|
+
- Prolog lexer: add different kinds of numeric literals (#864).
|
55
|
+
|
56
|
+
- F# lexer: rewrite with newest spec for F# 3.0 (#842).
|
57
|
+
|
6
58
|
|
7
59
|
Version 1.6
|
8
60
|
-----------
|
9
|
-
(
|
61
|
+
(released Feb 3, 2013)
|
62
|
+
|
63
|
+
- Lexers added:
|
64
|
+
|
65
|
+
* Dylan console (PR#149)
|
66
|
+
* Logos (PR#150)
|
67
|
+
* Shell sessions (PR#158)
|
68
|
+
|
69
|
+
- Fix guessed lexers not receiving lexer options (#838).
|
70
|
+
|
71
|
+
- Fix unquoted HTML attribute lexing in Opa (#841).
|
72
|
+
|
73
|
+
- Fixes to the Dart lexer (PR#160).
|
74
|
+
|
75
|
+
|
76
|
+
Version 1.6rc1
|
77
|
+
--------------
|
78
|
+
(released Jan 9, 2013)
|
10
79
|
|
11
80
|
- Lexers added:
|
12
81
|
|
82
|
+
* AspectJ (PR#90)
|
83
|
+
* AutoIt (PR#122)
|
84
|
+
* BUGS-like languages (PR#89)
|
85
|
+
* Ceylon (PR#86)
|
86
|
+
* Croc (new name for MiniD)
|
87
|
+
* CUDA (PR#75)
|
88
|
+
* Dg (PR#116)
|
89
|
+
* IDL (PR#115)
|
90
|
+
* Jags (PR#89)
|
13
91
|
* Julia (PR#61)
|
92
|
+
* Kconfig (#711)
|
93
|
+
* Lasso (PR#95, PR#113)
|
94
|
+
* LiveScript (PR#84)
|
95
|
+
* Monkey (PR#117)
|
96
|
+
* Mscgen (PR#80)
|
97
|
+
* NSIS scripts (PR#136)
|
98
|
+
* OpenCOBOL (PR#72)
|
99
|
+
* QML (PR#123)
|
100
|
+
* Puppet (PR#133)
|
101
|
+
* Racket (PR#94)
|
102
|
+
* Rdoc (PR#99)
|
103
|
+
* Robot Framework (PR#137)
|
104
|
+
* RPM spec files (PR#124)
|
105
|
+
* Rust (PR#67)
|
106
|
+
* Smali (Dalvik assembly)
|
107
|
+
* SourcePawn (PR#39)
|
108
|
+
* Stan (PR#89)
|
109
|
+
* Treetop (PR#125)
|
110
|
+
* TypeScript (PR#114)
|
111
|
+
* VGL (PR#12)
|
112
|
+
* Visual FoxPro (#762)
|
113
|
+
* Windows Registry (#819)
|
114
|
+
* Xtend (PR#68)
|
115
|
+
|
116
|
+
- The HTML formatter now supports linking to tags using CTags files, when the
|
117
|
+
python-ctags package is installed (PR#87).
|
118
|
+
|
119
|
+
- The HTML formatter now has a "linespans" option that wraps every line in a
|
120
|
+
<span> tag with a specific id (PR#82).
|
121
|
+
|
122
|
+
- When deriving a lexer from another lexer with token definitions, definitions
|
123
|
+
for states not in the child lexer are now inherited. If you override a state
|
124
|
+
in the child lexer, an "inherit" keyword has been added to insert the base
|
125
|
+
state at that position (PR#141).
|
126
|
+
|
127
|
+
- The C family lexers now inherit token definitions from a common base class,
|
128
|
+
removing code duplication (PR#141).
|
129
|
+
|
130
|
+
- Use "colorama" on Windows for console color output (PR#142).
|
131
|
+
|
132
|
+
- Fix Template Haskell highlighting (PR#63).
|
133
|
+
|
134
|
+
- Fix some S/R lexer errors (PR#91).
|
135
|
+
|
136
|
+
- Fix a bug in the Prolog lexer with names that start with 'is' (#810).
|
137
|
+
|
138
|
+
- Rewrite Dylan lexer, add Dylan LID lexer (PR#147).
|
139
|
+
|
140
|
+
- Add a Java quickstart document (PR#146).
|
14
141
|
|
15
|
-
-
|
142
|
+
- Add a "external/autopygmentize" file that can be used as .lessfilter (#802).
|
16
143
|
|
17
144
|
|
18
145
|
Version 1.5
|
@@ -182,7 +309,7 @@ Version 1.3
|
|
182
309
|
* Ada
|
183
310
|
* Coldfusion
|
184
311
|
* Modula-2
|
185
|
-
*
|
312
|
+
* Haxe
|
186
313
|
* R console
|
187
314
|
* Objective-J
|
188
315
|
* Haml and Sass
|
@@ -241,7 +368,7 @@ Version 1.2
|
|
241
368
|
* CMake
|
242
369
|
* Ooc
|
243
370
|
* Coldfusion
|
244
|
-
*
|
371
|
+
* Haxe
|
245
372
|
* R console
|
246
373
|
|
247
374
|
- Added options for rendering LaTeX in source code comments in the
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
7304e4759ae6
|
@@ -64,7 +64,7 @@ def `guess_lexer(text, **options):`
|
|
64
64
|
def `guess_lexer_for_filename(filename, text, **options):`
|
65
65
|
As `guess_lexer()`, but only lexers which have a pattern in `filenames`
|
66
66
|
or `alias_filenames` that matches `filename` are taken into consideration.
|
67
|
-
|
67
|
+
|
68
68
|
`pygments.util.ClassNotFound` is raised if no lexer thinks it can handle the
|
69
69
|
content.
|
70
70
|
|
@@ -0,0 +1,70 @@
|
|
1
|
+
=====================
|
2
|
+
Use Pygments in Java
|
3
|
+
=====================
|
4
|
+
|
5
|
+
Thanks to `Jython <http://www.jython.org>`__ it is possible to use Pygments in
|
6
|
+
Java.
|
7
|
+
|
8
|
+
This page is a simple tutorial to get an idea of how this is working. You can
|
9
|
+
then look at the `Jython documentation <http://www.jython.org/docs/>`__ for more
|
10
|
+
advanced use.
|
11
|
+
|
12
|
+
Since version 1.5, Pygments is deployed on `Maven Central
|
13
|
+
<http://repo1.maven.org/maven2/org/pygments/pygments/>`__ as a JAR so is Jython
|
14
|
+
which makes it a lot easier to create the Java project.
|
15
|
+
|
16
|
+
Here is an example of a `Maven <http://www.maven.org>`__ ``pom.xml`` file for a
|
17
|
+
project running Pygments:
|
18
|
+
|
19
|
+
.. sourcecode:: xml
|
20
|
+
|
21
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
22
|
+
|
23
|
+
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
24
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
25
|
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
26
|
+
http://maven.apache.org/maven-v4_0_0.xsd">
|
27
|
+
<modelVersion>4.0.0</modelVersion>
|
28
|
+
<groupId>example</groupId>
|
29
|
+
<artifactId>example</artifactId>
|
30
|
+
<version>1.0-SNAPSHOT</version>
|
31
|
+
<dependencies>
|
32
|
+
<dependency>
|
33
|
+
<groupId>org.python</groupId>
|
34
|
+
<artifactId>jython-standalone</artifactId>
|
35
|
+
<version>2.5.3</version>
|
36
|
+
</dependency>
|
37
|
+
<dependency>
|
38
|
+
<groupId>org.pygments</groupId>
|
39
|
+
<artifactId>pygments</artifactId>
|
40
|
+
<version>1.5</version>
|
41
|
+
<scope>runtime</scope>
|
42
|
+
</dependency>
|
43
|
+
</dependencies>
|
44
|
+
</project>
|
45
|
+
|
46
|
+
The following Java example:
|
47
|
+
|
48
|
+
.. sourcecode:: java
|
49
|
+
|
50
|
+
PythonInterpreter interpreter = new PythonInterpreter();
|
51
|
+
|
52
|
+
// Set a variable with the content you want to work with
|
53
|
+
interpreter.set("code", code);
|
54
|
+
|
55
|
+
// Simple use Pygments as you would in Python
|
56
|
+
interpreter.exec("from pygments import highlight\n"
|
57
|
+
+ "from pygments.lexers import PythonLexer\n"
|
58
|
+
+ "from pygments.formatters import HtmlFormatter\n"
|
59
|
+
+ "\nresult = highlight(code, PythonLexer(), HtmlFormatter())");
|
60
|
+
|
61
|
+
// Get the result that has been set in a variable
|
62
|
+
System.out.println(interpreter.get("result", String.class));
|
63
|
+
|
64
|
+
will print something like:
|
65
|
+
|
66
|
+
.. sourcecode:: html
|
67
|
+
|
68
|
+
<div class="highlight">
|
69
|
+
<pre><span class="k">print</span> <span class="s">"Hello World"</span></pre>
|
70
|
+
</div>
|
@@ -83,6 +83,58 @@ If no rule matches at the current position, the current char is emitted as an
|
|
83
83
|
1.
|
84
84
|
|
85
85
|
|
86
|
+
Adding and testing a new lexer
|
87
|
+
==============================
|
88
|
+
|
89
|
+
To make pygments aware of your new lexer, you have to perform the following
|
90
|
+
steps:
|
91
|
+
|
92
|
+
First, change to the current directory containing the pygments source code:
|
93
|
+
|
94
|
+
.. sourcecode:: console
|
95
|
+
|
96
|
+
$ cd .../pygments-main
|
97
|
+
|
98
|
+
Next, make sure the lexer is known from outside of the module. All modules in
|
99
|
+
the ``pygments.lexers`` specify ``__all__``. For example, ``other.py`` sets:
|
100
|
+
|
101
|
+
.. sourcecode:: python
|
102
|
+
|
103
|
+
__all__ = ['BrainfuckLexer', 'BefungeLexer', ...]
|
104
|
+
|
105
|
+
Simply add the name of your lexer class to this list.
|
106
|
+
|
107
|
+
Finally the lexer can be made publically known by rebuilding the lexer
|
108
|
+
mapping:
|
109
|
+
|
110
|
+
.. sourcecode:: console
|
111
|
+
|
112
|
+
$ make mapfiles
|
113
|
+
|
114
|
+
To test the new lexer, store an example file with the proper extension in
|
115
|
+
``tests/examplefiles``. For example, to test your ``DiffLexer``, add a
|
116
|
+
``tests/examplefiles/example.diff`` containing a sample diff output.
|
117
|
+
|
118
|
+
Now you can use pygmentize to render your example to HTML:
|
119
|
+
|
120
|
+
.. sourcecode:: console
|
121
|
+
|
122
|
+
$ ./pygmentize -O full -f html -o /tmp/example.html tests/examplefiles/example.diff
|
123
|
+
|
124
|
+
Note that this explicitely calls the ``pygmentize`` in the current directory
|
125
|
+
by preceding it with ``./``. This ensures your modifications are used.
|
126
|
+
Otherwise a possibly already installed, unmodified version without your new
|
127
|
+
lexer would have been called from the system search path (``$PATH``).
|
128
|
+
|
129
|
+
To view the result, open ``/tmp/example.html`` in your browser.
|
130
|
+
|
131
|
+
Once the example renders as expected, you should run the complete test suite:
|
132
|
+
|
133
|
+
.. sourcecode:: console
|
134
|
+
|
135
|
+
$ make test
|
136
|
+
|
137
|
+
|
86
138
|
Regex Flags
|
87
139
|
===========
|
88
140
|
|