rouge 3.4.1 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rouge.rb +3 -0
  3. data/lib/rouge/cli.rb +19 -2
  4. data/lib/rouge/demos/bpf +7 -0
  5. data/lib/rouge/demos/brainfuck +5 -0
  6. data/lib/rouge/demos/magik +6 -0
  7. data/lib/rouge/formatter.rb +2 -2
  8. data/lib/rouge/formatters/tex.rb +90 -0
  9. data/lib/rouge/guessers/glob_mapping.rb +1 -1
  10. data/lib/rouge/lexer.rb +22 -10
  11. data/lib/rouge/lexers/abap.rb +11 -11
  12. data/lib/rouge/lexers/actionscript.rb +34 -34
  13. data/lib/rouge/lexers/apache.rb +8 -8
  14. data/lib/rouge/lexers/apple_script.rb +15 -14
  15. data/lib/rouge/lexers/awk.rb +25 -25
  16. data/lib/rouge/lexers/biml.rb +4 -4
  17. data/lib/rouge/lexers/bpf.rb +104 -0
  18. data/lib/rouge/lexers/brainfuck.rb +53 -0
  19. data/lib/rouge/lexers/bsl.rb +12 -12
  20. data/lib/rouge/lexers/c.rb +30 -30
  21. data/lib/rouge/lexers/ceylon.rb +1 -29
  22. data/lib/rouge/lexers/cfscript.rb +26 -26
  23. data/lib/rouge/lexers/clojure.rb +14 -14
  24. data/lib/rouge/lexers/cmake.rb +14 -14
  25. data/lib/rouge/lexers/coffeescript.rb +30 -30
  26. data/lib/rouge/lexers/common_lisp.rb +36 -36
  27. data/lib/rouge/lexers/conf.rb +6 -6
  28. data/lib/rouge/lexers/coq.rb +18 -18
  29. data/lib/rouge/lexers/cpp.rb +8 -8
  30. data/lib/rouge/lexers/crystal.rb +70 -70
  31. data/lib/rouge/lexers/csharp.rb +28 -28
  32. data/lib/rouge/lexers/css.rb +23 -23
  33. data/lib/rouge/lexers/d.rb +59 -59
  34. data/lib/rouge/lexers/dart.rb +33 -33
  35. data/lib/rouge/lexers/digdag.rb +1 -1
  36. data/lib/rouge/lexers/docker.rb +10 -10
  37. data/lib/rouge/lexers/dot.rb +16 -16
  38. data/lib/rouge/lexers/eiffel.rb +20 -20
  39. data/lib/rouge/lexers/elixir.rb +29 -28
  40. data/lib/rouge/lexers/elm.rb +29 -29
  41. data/lib/rouge/lexers/erb.rb +4 -4
  42. data/lib/rouge/lexers/factor.rb +40 -40
  43. data/lib/rouge/lexers/fortran.rb +32 -32
  44. data/lib/rouge/lexers/fsharp.rb +26 -26
  45. data/lib/rouge/lexers/gherkin.rb +13 -13
  46. data/lib/rouge/lexers/glsl.rb +0 -4
  47. data/lib/rouge/lexers/go.rb +1 -1
  48. data/lib/rouge/lexers/graphql.rb +62 -62
  49. data/lib/rouge/lexers/groovy.rb +23 -25
  50. data/lib/rouge/lexers/hack.rb +1 -1
  51. data/lib/rouge/lexers/haml.rb +25 -29
  52. data/lib/rouge/lexers/handlebars.rb +18 -18
  53. data/lib/rouge/lexers/haskell.rb +66 -65
  54. data/lib/rouge/lexers/hcl.rb +25 -25
  55. data/lib/rouge/lexers/html.rb +31 -31
  56. data/lib/rouge/lexers/http.rb +4 -4
  57. data/lib/rouge/lexers/hylang.rb +14 -14
  58. data/lib/rouge/lexers/idlang.rb +32 -32
  59. data/lib/rouge/lexers/igorpro.rb +30 -30
  60. data/lib/rouge/lexers/ini.rb +12 -12
  61. data/lib/rouge/lexers/io.rb +7 -7
  62. data/lib/rouge/lexers/irb.rb +5 -5
  63. data/lib/rouge/lexers/java.rb +24 -24
  64. data/lib/rouge/lexers/javascript.rb +51 -51
  65. data/lib/rouge/lexers/jinja.rb +22 -22
  66. data/lib/rouge/lexers/json.rb +11 -10
  67. data/lib/rouge/lexers/json_doc.rb +2 -2
  68. data/lib/rouge/lexers/jsonnet.rb +18 -18
  69. data/lib/rouge/lexers/jsp.rb +28 -28
  70. data/lib/rouge/lexers/jsx.rb +16 -16
  71. data/lib/rouge/lexers/julia.rb +44 -44
  72. data/lib/rouge/lexers/kotlin.rb +3 -3
  73. data/lib/rouge/lexers/lasso.rb +50 -50
  74. data/lib/rouge/lexers/liquid.rb +53 -53
  75. data/lib/rouge/lexers/literate_coffeescript.rb +2 -2
  76. data/lib/rouge/lexers/literate_haskell.rb +5 -5
  77. data/lib/rouge/lexers/llvm.rb +23 -16
  78. data/lib/rouge/lexers/lua.rb +3 -3
  79. data/lib/rouge/lexers/m68k.rb +18 -19
  80. data/lib/rouge/lexers/magik.rb +126 -0
  81. data/lib/rouge/lexers/make.rb +22 -28
  82. data/lib/rouge/lexers/markdown.rb +37 -37
  83. data/lib/rouge/lexers/mathematica.rb +11 -11
  84. data/lib/rouge/lexers/matlab.rb +20 -20
  85. data/lib/rouge/lexers/moonscript.rb +3 -3
  86. data/lib/rouge/lexers/mosel.rb +17 -17
  87. data/lib/rouge/lexers/mxml.rb +18 -18
  88. data/lib/rouge/lexers/nasm.rb +24 -25
  89. data/lib/rouge/lexers/nginx.rb +14 -14
  90. data/lib/rouge/lexers/nim.rb +1 -1
  91. data/lib/rouge/lexers/nix.rb +42 -42
  92. data/lib/rouge/lexers/objective_c.rb +38 -38
  93. data/lib/rouge/lexers/ocaml.rb +29 -29
  94. data/lib/rouge/lexers/pascal.rb +4 -4
  95. data/lib/rouge/lexers/perl.rb +68 -68
  96. data/lib/rouge/lexers/php.rb +38 -38
  97. data/lib/rouge/lexers/plist.rb +14 -14
  98. data/lib/rouge/lexers/pony.rb +19 -19
  99. data/lib/rouge/lexers/powershell.rb +25 -25
  100. data/lib/rouge/lexers/praat.rb +75 -75
  101. data/lib/rouge/lexers/prolog.rb +26 -20
  102. data/lib/rouge/lexers/prometheus.rb +30 -30
  103. data/lib/rouge/lexers/properties.rb +12 -12
  104. data/lib/rouge/lexers/protobuf.rb +22 -22
  105. data/lib/rouge/lexers/puppet.rb +31 -31
  106. data/lib/rouge/lexers/python.rb +52 -52
  107. data/lib/rouge/lexers/q.rb +12 -12
  108. data/lib/rouge/lexers/qml.rb +12 -12
  109. data/lib/rouge/lexers/r.rb +12 -12
  110. data/lib/rouge/lexers/racket.rb +22 -22
  111. data/lib/rouge/lexers/ruby.rb +71 -69
  112. data/lib/rouge/lexers/rust.rb +30 -30
  113. data/lib/rouge/lexers/sass.rb +8 -8
  114. data/lib/rouge/lexers/sass/common.rb +40 -40
  115. data/lib/rouge/lexers/scala.rb +43 -43
  116. data/lib/rouge/lexers/scheme.rb +18 -18
  117. data/lib/rouge/lexers/scss.rb +3 -3
  118. data/lib/rouge/lexers/sed.rb +29 -29
  119. data/lib/rouge/lexers/shell.rb +61 -52
  120. data/lib/rouge/lexers/sieve.rb +8 -8
  121. data/lib/rouge/lexers/slim.rb +24 -24
  122. data/lib/rouge/lexers/smalltalk.rb +33 -33
  123. data/lib/rouge/lexers/smarty.rb +12 -12
  124. data/lib/rouge/lexers/sml.rb +67 -67
  125. data/lib/rouge/lexers/sqf.rb +1 -1
  126. data/lib/rouge/lexers/sql.rb +21 -21
  127. data/lib/rouge/lexers/supercollider.rb +19 -19
  128. data/lib/rouge/lexers/swift.rb +42 -39
  129. data/lib/rouge/lexers/tap.rb +20 -20
  130. data/lib/rouge/lexers/tcl.rb +27 -27
  131. data/lib/rouge/lexers/terraform.rb +13 -13
  132. data/lib/rouge/lexers/tex.rb +19 -19
  133. data/lib/rouge/lexers/toml.rb +18 -18
  134. data/lib/rouge/lexers/tulip.rb +36 -36
  135. data/lib/rouge/lexers/turtle.rb +35 -38
  136. data/lib/rouge/lexers/vala.rb +17 -17
  137. data/lib/rouge/lexers/vb.rb +27 -27
  138. data/lib/rouge/lexers/verilog.rb +25 -27
  139. data/lib/rouge/lexers/vhdl.rb +10 -10
  140. data/lib/rouge/lexers/viml.rb +14 -14
  141. data/lib/rouge/lexers/vue.rb +9 -9
  142. data/lib/rouge/lexers/wollok.rb +25 -25
  143. data/lib/rouge/lexers/xml.rb +17 -21
  144. data/lib/rouge/lexers/xojo.rb +15 -15
  145. data/lib/rouge/lexers/yaml.rb +61 -61
  146. data/lib/rouge/plugins/redcarpet.rb +1 -1
  147. data/lib/rouge/tex_theme_renderer.rb +128 -0
  148. data/lib/rouge/theme.rb +4 -0
  149. data/lib/rouge/themes/magritte.rb +78 -0
  150. data/lib/rouge/version.rb +1 -1
  151. metadata +11 -2
data/lib/rouge/theme.rb CHANGED
@@ -83,6 +83,10 @@ module Rouge
83
83
  self.class.get_style(token)
84
84
  end
85
85
 
86
+ def name
87
+ self.class.name
88
+ end
89
+
86
90
  class << self
87
91
  def style(*tokens)
88
92
  style = tokens.last.is_a?(Hash) ? tokens.pop : {}
@@ -0,0 +1,78 @@
1
+ # -*- coding: utf-8 -*- #
2
+ # frozen_string_literal: true
3
+
4
+ module Rouge
5
+ module Themes
6
+ class Magritte < CSSTheme
7
+ name 'magritte'
8
+
9
+ palette :dragon => '#006c6c'
10
+ palette :black => '#000000'
11
+ palette :forest => '#007500'
12
+ palette :candy => '#ff0089'
13
+ palette :wine => '#7c0000'
14
+ palette :grape => '#4c48fe'
15
+ palette :dark => '#000707'
16
+ palette :cherry => '#f22700'
17
+ palette :white => '#ffffff'
18
+ palette :royal => '#19003a'
19
+
20
+ palette :purple => '#840084'
21
+ palette :chocolate => '#920241'
22
+ palette :lavender => '#d8d9ff'
23
+ palette :eggshell => '#f3ffff'
24
+ palette :yellow => '#ffff3f'
25
+
26
+ palette :lightgray => '#BBBBBB'
27
+ palette :darkgray => '#999999'
28
+
29
+ style Text, :fg => :dark, :bg => :eggshell
30
+ style Generic::Lineno, :fg => :eggshell, :bg => :dark
31
+
32
+ # style Generic::Prompt, :fg => :chilly, :bold => true
33
+
34
+ style Comment, :fg => :dragon, :italic => true
35
+ style Comment::Preproc, :fg => :chocolate, :bold => true, :italic => true
36
+ style Error, :fg => :eggshell, :bg => :cherry
37
+ style Generic::Error, :fg => :cherry, :italic => true, :bold => true
38
+ style Keyword, :fg => :royal, :bold => true
39
+ style Operator, :fg => :grape, :bold => true
40
+ style Punctuation, :fg => :grape
41
+ style Generic::Deleted, :fg => :cherry
42
+ style Generic::Inserted, :fg => :forest
43
+ style Generic::Emph, :italic => true
44
+ style Generic::Strong, :bold => true
45
+ style Generic::Traceback, :fg => :black, :bg => :lavender
46
+ style Keyword::Constant, :fg => :forest, :bold => true
47
+ style Keyword::Namespace,
48
+ Keyword::Pseudo,
49
+ Keyword::Reserved,
50
+ Generic::Heading,
51
+ Generic::Subheading, :fg => :forest, :bold => true
52
+ style Keyword::Type,
53
+ Name::Constant,
54
+ Name::Class,
55
+ Name::Decorator,
56
+ Name::Namespace,
57
+ Name::Builtin::Pseudo,
58
+ Name::Exception, :fg => :chocolate, :bold => true
59
+ style Name::Label,
60
+ Name::Tag, :fg => :purple, :bold => true
61
+ style Literal::Number,
62
+ Literal::Date, :fg => :forest, :bold => true
63
+ style Literal::String::Symbol, :fg => :forest
64
+ style Literal::String, :fg => :wine, :bold => true
65
+ style Literal::String::Escape,
66
+ Literal::String::Char,
67
+ Literal::String::Interpol, :fg => :purple, :bold => true
68
+ style Name::Builtin, :bold => true
69
+ style Name::Entity, :fg => :darkgray, :bold => true
70
+ style Text::Whitespace,
71
+ Generic::Output, :fg => :lightgray
72
+ style Name::Function,
73
+ Name::Property,
74
+ Name::Attribute, :fg => :candy
75
+ style Name::Variable, :fg => :candy, :bold => true
76
+ end
77
+ end
78
+ end
data/lib/rouge/version.rb CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Rouge
5
5
  def self.version
6
- "3.4.1"
6
+ "3.5.0"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rouge
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.1
4
+ version: 3.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeanine Adkisson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-12 00:00:00.000000000 Z
11
+ date: 2019-06-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rouge aims to a be a simple, easy-to-extend drop-in replacement for pygments.
14
14
  email:
@@ -30,6 +30,8 @@ files:
30
30
  - lib/rouge/demos/applescript
31
31
  - lib/rouge/demos/awk
32
32
  - lib/rouge/demos/biml
33
+ - lib/rouge/demos/bpf
34
+ - lib/rouge/demos/brainfuck
33
35
  - lib/rouge/demos/bsl
34
36
  - lib/rouge/demos/c
35
37
  - lib/rouge/demos/ceylon
@@ -97,6 +99,7 @@ files:
97
99
  - lib/rouge/demos/llvm
98
100
  - lib/rouge/demos/lua
99
101
  - lib/rouge/demos/m68k
102
+ - lib/rouge/demos/magik
100
103
  - lib/rouge/demos/make
101
104
  - lib/rouge/demos/markdown
102
105
  - lib/rouge/demos/mathematica
@@ -174,6 +177,7 @@ files:
174
177
  - lib/rouge/formatters/html_table.rb
175
178
  - lib/rouge/formatters/null.rb
176
179
  - lib/rouge/formatters/terminal256.rb
180
+ - lib/rouge/formatters/tex.rb
177
181
  - lib/rouge/guesser.rb
178
182
  - lib/rouge/guessers/disambiguation.rb
179
183
  - lib/rouge/guessers/filename.rb
@@ -191,6 +195,8 @@ files:
191
195
  - lib/rouge/lexers/apple_script.rb
192
196
  - lib/rouge/lexers/awk.rb
193
197
  - lib/rouge/lexers/biml.rb
198
+ - lib/rouge/lexers/bpf.rb
199
+ - lib/rouge/lexers/brainfuck.rb
194
200
  - lib/rouge/lexers/bsl.rb
195
201
  - lib/rouge/lexers/c.rb
196
202
  - lib/rouge/lexers/ceylon.rb
@@ -260,6 +266,7 @@ files:
260
266
  - lib/rouge/lexers/lua.rb
261
267
  - lib/rouge/lexers/lua/builtins.rb
262
268
  - lib/rouge/lexers/m68k.rb
269
+ - lib/rouge/lexers/magik.rb
263
270
  - lib/rouge/lexers/make.rb
264
271
  - lib/rouge/lexers/markdown.rb
265
272
  - lib/rouge/lexers/mathematica.rb
@@ -338,6 +345,7 @@ files:
338
345
  - lib/rouge/plugins/redcarpet.rb
339
346
  - lib/rouge/regex_lexer.rb
340
347
  - lib/rouge/template_lexer.rb
348
+ - lib/rouge/tex_theme_renderer.rb
341
349
  - lib/rouge/text_analyzer.rb
342
350
  - lib/rouge/theme.rb
343
351
  - lib/rouge/themes/base16.rb
@@ -346,6 +354,7 @@ files:
346
354
  - lib/rouge/themes/github.rb
347
355
  - lib/rouge/themes/gruvbox.rb
348
356
  - lib/rouge/themes/igor_pro.rb
357
+ - lib/rouge/themes/magritte.rb
349
358
  - lib/rouge/themes/molokai.rb
350
359
  - lib/rouge/themes/monokai.rb
351
360
  - lib/rouge/themes/monokai_sublime.rb