ultraviolet 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. data/History.txt +7 -0
  2. data/Manifest.txt +184 -188
  3. data/Rakefile +2 -2
  4. data/bin/theme2latexrender +9 -30
  5. data/bin/theme2xhtmlrender +17 -23
  6. data/lib/uv.rb +2 -2
  7. data/lib/uv/{html_processor.rb → render_processor.rb} +39 -13
  8. data/lib/uv/utility.rb +67 -0
  9. data/render/latex/active4d.render +7 -7
  10. data/render/latex/all_hallows_eve.render +6 -6
  11. data/render/latex/amy.render +7 -7
  12. data/render/latex/blackboard.render +5 -5
  13. data/render/latex/brilliance_black.render +171 -221
  14. data/render/latex/brilliance_dull.render +105 -105
  15. data/render/latex/cobalt.render +12 -12
  16. data/render/latex/dawn.render +8 -8
  17. data/render/latex/eiffel.render +4 -4
  18. data/render/latex/espresso_libre.render +5 -5
  19. data/render/latex/idle.render +2 -2
  20. data/render/latex/iplastic.render +5 -5
  21. data/render/latex/lazy.render +2 -2
  22. data/render/latex/mac_classic.render +7 -7
  23. data/render/latex/magicwb_amiga.render +8 -8
  24. data/render/latex/pastels_on_dark.render +5 -5
  25. data/render/latex/slush_poppies.render +1 -1
  26. data/render/latex/spacecadet.render +3 -3
  27. data/render/latex/sunburst.render +14 -14
  28. data/render/latex/twilight.render +9 -9
  29. data/render/latex/zenburnesque.render +2 -2
  30. data/render/xhtml/amy.render +1 -1
  31. data/render/xhtml/brilliance_black.render +74 -124
  32. data/render/xhtml/brilliance_dull.render +6 -6
  33. data/render/xhtml/files/css/active4d.css +1 -1
  34. data/render/xhtml/files/css/all_hallows_eve.css +1 -1
  35. data/render/xhtml/files/css/amy.css +6 -3
  36. data/render/xhtml/files/css/blackboard.css +3 -3
  37. data/render/xhtml/files/css/brilliance_black.css +193 -220
  38. data/render/xhtml/files/css/brilliance_dull.css +110 -90
  39. data/render/xhtml/files/css/cobalt.css +3 -3
  40. data/render/xhtml/files/css/dawn.css +6 -6
  41. data/render/xhtml/files/css/eiffel.css +1 -1
  42. data/render/xhtml/files/css/espresso_libre.css +2 -2
  43. data/render/xhtml/files/css/iplastic.css +3 -3
  44. data/render/xhtml/files/css/mac_classic.css +3 -3
  45. data/render/xhtml/files/css/magicwb_amiga.css +6 -3
  46. data/render/xhtml/files/css/pastels_on_dark.css +2 -2
  47. data/render/xhtml/files/css/spacecadet.css +1 -1
  48. data/render/xhtml/files/css/sunburst.css +7 -7
  49. data/render/xhtml/files/css/twilight.css +5 -5
  50. data/render/xhtml/files/css/zenburnesque.css +5 -2
  51. data/render/xhtml/mac_classic.render +1 -1
  52. data/render/xhtml/magicwb_amiga.render +1 -1
  53. data/render/xhtml/zenburnesque.render +1 -1
  54. data/syntax/antlr.syntax +49 -26
  55. data/syntax/apache.syntax +17 -2
  56. data/syntax/c.syntax +2 -2
  57. data/syntax/cm.syntax +32 -0
  58. data/syntax/coldfusion.syntax +4 -3
  59. data/syntax/css.syntax +8 -3
  60. data/syntax/d.syntax +4 -0
  61. data/syntax/groovy.syntax +10 -8
  62. data/syntax/gtd.syntax +22 -0
  63. data/syntax/haml.syntax +2 -2
  64. data/syntax/html.syntax +4 -4
  65. data/syntax/ini.syntax +5 -4
  66. data/syntax/javascript.syntax +2 -1
  67. data/syntax/languagedefinition.syntax +50 -39
  68. data/syntax/macports_portfile.syntax +21 -1
  69. data/syntax/makefile.syntax +1 -0
  70. data/syntax/objective-c.syntax +37 -30
  71. data/syntax/pascal.syntax +1 -1
  72. data/syntax/perl.syntax +40 -0
  73. data/syntax/php.syntax +672 -379
  74. data/syntax/pmwiki.syntax +113 -0
  75. data/syntax/property_list.syntax +4 -14
  76. data/syntax/python.syntax +17 -14
  77. data/syntax/release_notes.syntax +12 -3
  78. data/syntax/ruby_experimental.syntax +8 -8
  79. data/syntax/standard_ml.syntax +79 -3
  80. data/syntax/twiki.syntax +2 -2
  81. data/syntax/txt2tags.syntax +18 -18
  82. data/syntax/xml.syntax +1 -0
  83. data/syntax/yaml.syntax +2 -2
  84. metadata +193 -194
  85. data/syntax/buggy/nemerle.yaml +0 -74
  86. data/syntax/gtd2_text.syntax +0 -31
  87. data/syntax/old/YAML.yaml +0 -160
  88. data/syntax/old/txt2tags.yaml +0 -139
@@ -5,11 +5,11 @@ rescue LoadError
5
5
  require 'rubygems'
6
6
  require 'plist'
7
7
  end
8
+ require 'uv/utility'
8
9
 
9
10
  base_dir = File.join( File.dirname(__FILE__), '..', 'render' )
10
11
 
11
12
 
12
-
13
13
  def settings
14
14
  unless @settings
15
15
  @settings = @theme["settings"].find { |s| ! s["name"] }["settings"]
@@ -17,22 +17,7 @@ def settings
17
17
  @settings
18
18
  end
19
19
 
20
- def normalize_color color
21
- if color =~ /^#/ && color.size == 9
22
- div0 = (settings["background"] ? settings["background"][1..-1].hex : 0xFFFFFF )
23
- div1, alpha = color[1..-1].hex.divmod( 0x100 )
24
- result = ""
25
- 3.times {
26
- div0, mod0 = div0.divmod( 0x100 )
27
- div1, mod1 = div1.divmod( 0x100 )
28
- result = ((mod1 * alpha + mod0 * ( 0x100 - alpha ) ) / 0x100).to_s(16).upcase.rjust(2, '0') + result
29
- }
30
- result = "#" + result
31
- result
32
- else
33
- color
34
- end
35
- end
20
+ puts "Processing #{ARGV[0]}"
36
21
 
37
22
  @theme = Plist::parse_xml( ARGV[0] )
38
23
  render = {"name" => @theme["name"]}
@@ -42,6 +27,7 @@ standard_name = File.basename( ARGV[0] ).downcase.gsub(/\s+/, '_').gsub('.tmthem
42
27
  code_name = "pre.#{standard_name}"
43
28
 
44
29
  render["tags"] = []
30
+ count_names = {}
45
31
  @theme["settings"].each do |t|
46
32
  if t["scope"]
47
33
  class_name = t["name"].downcase.gsub(/\W/, ' ').gsub('.tmtheme', '').split(' ').collect{|s| s.capitalize}.join
@@ -49,6 +35,14 @@ render["tags"] = []
49
35
  class_name = "x" * t["name"].size
50
36
  end
51
37
 
38
+ if count_names[class_name]
39
+ tname = class_name
40
+ class_name = "#{class_name}#{count_names[class_name]}"
41
+ count_names[tname] += count_names[tname] + 1
42
+ else
43
+ count_names[class_name] = 1
44
+ end
45
+
52
46
  tag = {}
53
47
  tag["selector"] = t["scope"]
54
48
  tag["begin"] = "<span class=\"#{class_name}\">"
@@ -57,8 +51,8 @@ render["tags"] = []
57
51
 
58
52
  if s = t["settings"]
59
53
  style = {}
60
- style["color"] = normalize_color(s["foreground"])
61
- style["background-color"] = normalize_color(s["background"])
54
+ style["color"] = Uv.normalize_color(settings, s["foreground"], true)
55
+ style["background-color"] = Uv.normalize_color(settings, s["background"])
62
56
  case s["fontStyle"]
63
57
  when /bold/ then style["font-weight"] = "bold"
64
58
  when /italic/ then style["font-style"] = "italic"
@@ -69,13 +63,13 @@ render["tags"] = []
69
63
  elsif ! t["name"]
70
64
  if s = t["settings"]
71
65
  style = {}
72
- style["color"] = normalize_color(s["foreground"])
73
- style["background-color"] = normalize_color(s["background"])
66
+ style["color"] = Uv.normalize_color(settings, s["foreground"], true)
67
+ style["background-color"] = Uv.alpha_blend(s["background"], s["background"])
74
68
  css[code_name] = style
75
69
  @style = style
76
70
  style = {}
77
- style["color"] = normalize_color(s["foreground"])
78
- style["background-color"] = normalize_color(s["selection"])
71
+ style["background-color"] = Uv.alpha_blend(s["selection"], s["selection"])
72
+ style["color"] = Uv.foreground( style["background-color"] )
79
73
  css[".line-numbers"] = style
80
74
 
81
75
  tag = {}
data/lib/uv.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'fileutils'
2
2
  require 'textpow'
3
- require 'uv/html_processor.rb'
3
+ require 'uv/render_processor.rb'
4
4
 
5
5
 
6
6
  module Uv
@@ -69,7 +69,7 @@ module Uv
69
69
  raise( ArgumentError, "Output for #{output} is not yet implemented" ) unless File.exists?(renderer)
70
70
  css_class = render_style
71
71
  render_options = YAML.load( File.open( renderer ) )
72
- render_processor = HtmlProcessor.new( render_options, line_numbers, headers )
72
+ render_processor = RenderProcessor.new( render_options, line_numbers, headers )
73
73
  @syntaxes[syntax_name].parse( text, render_processor )
74
74
  render_processor.string
75
75
  end
@@ -3,7 +3,7 @@ require 'cgi'
3
3
  module Uv
4
4
 
5
5
 
6
- class HtmlProcessor
6
+ class RenderProcessor
7
7
  @@score_manager = Textpow::ScoreManager.new
8
8
 
9
9
  attr_reader :string
@@ -18,13 +18,15 @@ module Uv
18
18
  @escapeHTML = true
19
19
  end
20
20
 
21
- def start_parsing
22
- @stack = []
21
+ def start_parsing name
22
+ @stack = [name]
23
23
  @string = ""
24
24
  @line = nil
25
25
  @line_number = 0
26
26
  print @render_options["document"]["begin"] if @headers
27
27
  print @render_options["listing"]["begin"]
28
+ # opt = options @stack
29
+ # print opt["begin"] if opt
28
30
  end
29
31
 
30
32
  def print string
@@ -45,21 +47,41 @@ module Uv
45
47
  @stack << name
46
48
  print escape(@line[@position...position].gsub(/\n|\r/, '')) if position > @position
47
49
  @position = position
48
- opt = options
50
+ opt = options @stack
49
51
  print opt["begin"] if opt
50
52
  end
51
53
 
52
54
  def close_tag name, position
53
55
  print escape(@line[@position...position].gsub(/\n|\r/, '')) if position > @position
54
56
  @position = position
55
- opt = options
57
+ opt = options @stack
56
58
  print opt["end"] if opt
57
59
  @stack.pop
58
60
  end
59
61
 
62
+ def close_line
63
+ stack = @stack[0..-1]
64
+ while stack.size > 1
65
+ opt = options stack
66
+ print opt["end"] if opt
67
+ stack.pop
68
+ end
69
+ end
70
+
71
+ def open_line
72
+ stack = [@stack.first]
73
+ clone = @stack[1..-1]
74
+ while stack.size < @stack.size
75
+ stack << clone.shift
76
+ opt = options stack
77
+ print opt["begin"] if opt
78
+ end
79
+ end
80
+
60
81
  def new_line line
61
82
  if @line
62
83
  print escape(@line[@position..-1].gsub(/\n|\r/, ''))
84
+ close_line
63
85
  print @render_options["line"]["end"]
64
86
  print "\n"
65
87
  end
@@ -73,25 +95,29 @@ module Uv
73
95
  print @render_options["line-numbers"]["end"]
74
96
  print " "
75
97
  end
98
+ open_line
76
99
  end
77
100
 
78
- def end_parsing
101
+ def end_parsing name
79
102
  if @line
80
103
  print escape(@line[@position..-1].gsub(/\n|\r/, ''))
104
+ while @stack.size > 1
105
+ opt = options @stack
106
+ print opt["end"] if opt
107
+ @stack.pop
108
+ end
81
109
  print @render_options["line"]["end"]
82
110
  print "\n"
83
111
  end
84
- while ! @stack.empty?
85
- opt = options
86
- print opt["end"] if opt
87
- @stack.pop
88
- end
112
+ # opt = options @stack
113
+ # print opt["end"] if opt
114
+ @stack.pop
89
115
  print @render_options["listing"]["end"]
90
116
  print @render_options["document"]["end"] if @headers
91
117
  end
92
118
 
93
- def options
94
- ref = @stack.join ' '
119
+ def options stack
120
+ ref = stack.join ' '
95
121
  return @options[ref] if @options.has_key? ref
96
122
 
97
123
  result = @render_options['tags'].max do |a, b|
@@ -0,0 +1,67 @@
1
+ module Uv
2
+ def Uv.foreground bg
3
+ fg = "#FFFFFF"
4
+ 3.times do |i|
5
+ fg = "#000000" if bg[i*2+1, 2].hex > 0xFF / 2
6
+ end
7
+ fg
8
+ end
9
+
10
+ def Uv.alpha_blend bg, fg
11
+ unless bg =~ /^#((\d|[ABCDEF]){3}|(\d|[ABCDEF]){6}|(\d|[ABCDEF]){8})$/i
12
+ raise(ArgumentError, "Malformed background color '#{bg}'" )
13
+ end
14
+ unless fg =~ /^#((\d|[ABCDEF]){3}|(\d|[ABCDEF]){6}|(\d|[ABCDEF]){8})$/i
15
+ raise(ArgumentError, "Malformed foreground color '#{fg}'" )
16
+ end
17
+
18
+ if bg.size == 4
19
+ tbg = (fg[1,1].hex * 0xff / 0xf).to_s(16).upcase.rjust(2, '0')
20
+ tbg += (fg[2,1].hex * 0xff / 0xf).to_s(16).upcase.rjust(2, '0')
21
+ tbg += (fg[3,1].hex * 0xff / 0xf).to_s(16).upcase.rjust(2, '0')
22
+ bg = "##{tbg}"
23
+ end
24
+
25
+ result = ""
26
+ if fg.size == 4
27
+ result += (fg[1,1].hex * 0xff / 0xf).to_s(16).upcase.rjust(2, '0')
28
+ result += (fg[2,1].hex * 0xff / 0xf).to_s(16).upcase.rjust(2, '0')
29
+ result += (fg[3,1].hex * 0xff / 0xf).to_s(16).upcase.rjust(2, '0')
30
+ elsif fg.size == 9
31
+ if bg.size == 7
32
+ div0 = bg[1..-1].hex
33
+ div1, alpha = fg[1..-1].hex.divmod( 0x100 )
34
+ 3.times {
35
+ div0, mod0 = div0.divmod( 0x100 )
36
+ div1, mod1 = div1.divmod( 0x100 )
37
+ result = ((mod0 * alpha + mod1 * ( 0x100 - alpha ) ) / 0x100).to_s(16).upcase.rjust(2, '0') + result
38
+ }
39
+ else
40
+ div_a, alpha_a = bg[1..-1].hex.divmod( 0x100 )
41
+ div_b, alpha_b = fg[1..-1].hex.divmod( 0x100 )
42
+ alpha = alpha_a + alpha_b * (0x100 - alpha_a)
43
+ 3.times {
44
+ div_b, c_b = div_b.divmod( 0x100 )
45
+ div_a, c_a = div_a.divmod( 0x100 )
46
+ result = ((c_a * alpha_a + ( 0x100 - alpha_a ) * alpha_b * c_b ) / alpha).to_s(16).upcase.rjust(2, '0') + result
47
+ }
48
+ end
49
+ #result = "FF00FF"
50
+ else
51
+ result = fg[1..-1]
52
+ end
53
+ "##{result}"
54
+ end
55
+
56
+ def Uv.normalize_color settings, color, fg = false
57
+ if color
58
+ if fg
59
+ alpha_blend( settings["foreground"] ? settings["foreground"] : "#000000FF", color )
60
+ else
61
+ alpha_blend( settings["background"] ? settings["background"] : "#000000FF", color )
62
+ end
63
+ else
64
+ color
65
+ end
66
+ end
67
+ end
@@ -4,7 +4,7 @@ line:
4
4
  begin: ""
5
5
  end: "}}\\\\"
6
6
  tags:
7
- - begin: \colorbox[HTML]{F4F6FF}{
7
+ - begin: \setlength{\fboxsep}{0ex}\colorbox[HTML]{ECF1FF}{\rule[-0.5ex]{0pt}{2.0ex}
8
8
  end: "}"
9
9
  selector: text.html source.active4d
10
10
  - begin: "{\\color[HTML]{000000}"
@@ -85,19 +85,19 @@ tags:
85
85
  - begin: "{\\color[HTML]{A535AE}"
86
86
  end: "}"
87
87
  selector: support.variable
88
- - begin: \colorbox[HTML]{990000}{\color[HTML]{FFFFFF}
88
+ - begin: \setlength{\fboxsep}{0ex}\colorbox[HTML]{990000}{\rule[-0.5ex]{0pt}{2.0ex}\color[HTML]{FFFFFF}
89
89
  end: "}"
90
90
  selector: invalid
91
- - begin: \colorbox[HTML]{656565}{\color[HTML]{FFFFFF}
91
+ - begin: \setlength{\fboxsep}{0ex}\colorbox[HTML]{656565}{\rule[-0.5ex]{0pt}{2.0ex}\color[HTML]{FFFFFF}
92
92
  end: "}"
93
93
  selector: meta.diff
94
- - begin: \colorbox[HTML]{1B63FF}{\color[HTML]{FFFFFF}
94
+ - begin: \setlength{\fboxsep}{0ex}\colorbox[HTML]{1B63FF}{\rule[-0.5ex]{0pt}{2.0ex}\color[HTML]{FFFFFF}
95
95
  end: "}"
96
96
  selector: meta.diff.range
97
- - begin: \colorbox[HTML]{FF7880}{\color[HTML]{000000}
97
+ - begin: \setlength{\fboxsep}{0ex}\colorbox[HTML]{FF7880}{\rule[-0.5ex]{0pt}{2.0ex}\color[HTML]{000000}
98
98
  end: "}"
99
99
  selector: markup.deleted.diff
100
- - begin: \colorbox[HTML]{98FF9A}{\color[HTML]{000000}
100
+ - begin: \setlength{\fboxsep}{0ex}\colorbox[HTML]{98FF9A}{\rule[-0.5ex]{0pt}{2.0ex}\color[HTML]{000000}
101
101
  end: "}"
102
102
  selector: markup.inserted.diff
103
103
  - begin: "{\\color[HTML]{5E5E5E}"
@@ -126,7 +126,7 @@ document:
126
126
  end: |
127
127
  \end{document}
128
128
 
129
- filter: "@escaped.gsub(/(_|\\{|\\}|&|\\#|\\\\)/, '\\\\\\\\\\1').gsub(/~/, '\\\\textasciitilde').gsub(/ /,'\\\\hspace{1ex}').gsub(/\\t/,'\\\\hspace{3ex}')"
129
+ filter: "@escaped.gsub(/(\\$)/, '\\\\\\\\\\1').gsub(/\\\\(?!\\$)/, '$\\\\\\\\backslash$').gsub(/(_|\\{|\\}|&|\\#|%)/, '\\\\\\\\\\1').gsub(/~/, '\\\\textasciitilde ').gsub(/ /,'\\\\hspace{1ex}').gsub(/\\t| /,'\\\\hspace{3ex}').gsub(/\\\"/, \"''\").gsub(/(\\^)/,'\\\\\\\\\\1{}')"
130
130
  line-numbers:
131
131
  begin: \texttt{
132
132
  end: "}&\\mbox{\\texttt{"
@@ -4,10 +4,10 @@ line:
4
4
  begin: ""
5
5
  end: "}}\\\\"
6
6
  tags:
7
- - begin: \colorbox[HTML]{434242}{\color[HTML]{FFFFFF}
7
+ - begin: \setlength{\fboxsep}{0ex}\colorbox[HTML]{434242}{\rule[-0.5ex]{0pt}{2.0ex}\color[HTML]{FFFFFF}
8
8
  end: "}"
9
9
  selector: text
10
- - begin: \colorbox[HTML]{000000}{\color[HTML]{FFFFFF}
10
+ - begin: \setlength{\fboxsep}{0ex}\colorbox[HTML]{000000}{\rule[-0.5ex]{0pt}{2.0ex}\color[HTML]{FFFFFF}
11
11
  end: "}"
12
12
  selector: source
13
13
  - begin: "{\\color[HTML]{9933CC}"
@@ -31,7 +31,7 @@ tags:
31
31
  - begin: "{\\textit{"
32
32
  end: "}}"
33
33
  selector: variable.parameter
34
- - begin: \colorbox[HTML]{9B9B9B}{\color[HTML]{FFFFFF}
34
+ - begin: \setlength{\fboxsep}{0ex}\colorbox[HTML]{9B9B9B}{\rule[-0.5ex]{0pt}{2.0ex}\color[HTML]{FFFFFF}
35
35
  end: "}"
36
36
  selector: source comment.block
37
37
  - begin: "{\\color[HTML]{66CC33}"
@@ -40,7 +40,7 @@ tags:
40
40
  - begin: "{\\color[HTML]{AAAAAA}"
41
41
  end: "}"
42
42
  selector: string constant.character.escape
43
- - begin: \colorbox[HTML]{CCCC33}{\color[HTML]{000000}
43
+ - begin: \setlength{\fboxsep}{0ex}\colorbox[HTML]{CCCC33}{\rule[-0.5ex]{0pt}{2.0ex}\color[HTML]{000000}
44
44
  end: "}"
45
45
  selector: string.interpolated
46
46
  - begin: "{\\color[HTML]{CCCC33}"
@@ -70,7 +70,7 @@ tags:
70
70
  listing:
71
71
  begin: |
72
72
  \newcolumntype{C}{>{\color[HTML]{FFFFFF}\columncolor[HTML]{000000}}l}
73
- \newcolumntype{N}{>{\color[HTML]{FFFFFF}\columncolor[HTML]{644D6E}}l}
73
+ \newcolumntype{N}{>{\color[HTML]{FFFFFF}\columncolor[HTML]{73597E}}l}
74
74
  \begin{longtable}{NC}
75
75
 
76
76
  end: |
@@ -90,7 +90,7 @@ document:
90
90
  end: |
91
91
  \end{document}
92
92
 
93
- filter: "@escaped.gsub(/(_|\\{|\\}|&|\\#|\\\\)/, '\\\\\\\\\\1').gsub(/~/, '\\\\textasciitilde').gsub(/ /,'\\\\hspace{1ex}').gsub(/\\t/,'\\\\hspace{3ex}')"
93
+ filter: "@escaped.gsub(/(\\$)/, '\\\\\\\\\\1').gsub(/\\\\(?!\\$)/, '$\\\\\\\\backslash$').gsub(/(_|\\{|\\}|&|\\#|%)/, '\\\\\\\\\\1').gsub(/~/, '\\\\textasciitilde ').gsub(/ /,'\\\\hspace{1ex}').gsub(/\\t| /,'\\\\hspace{3ex}').gsub(/\\\"/, \"''\").gsub(/(\\^)/,'\\\\\\\\\\1{}')"
94
94
  line-numbers:
95
95
  begin: \texttt{
96
96
  end: "}&\\mbox{\\texttt{"
@@ -4,7 +4,7 @@ line:
4
4
  begin: ""
5
5
  end: "}}\\\\"
6
6
  tags:
7
- - begin: \colorbox[HTML]{200020}{\color[HTML]{404080}\textit{
7
+ - begin: \setlength{\fboxsep}{0ex}\colorbox[HTML]{200020}{\rule[-0.5ex]{0pt}{2.0ex}\color[HTML]{404080}\textit{
8
8
  end: "}}"
9
9
  selector: comment.block
10
10
  - begin: "{\\color[HTML]{999999}"
@@ -118,7 +118,7 @@ tags:
118
118
  - begin: "{"
119
119
  end: "}"
120
120
  selector: entity.other.attribute-name
121
- - begin: \colorbox[HTML]{200020}{
121
+ - begin: \setlength{\fboxsep}{0ex}\colorbox[HTML]{200020}{\rule[-0.5ex]{0pt}{2.0ex}
122
122
  end: "}"
123
123
  selector: support.constant
124
124
  - begin: "{"
@@ -127,13 +127,13 @@ tags:
127
127
  - begin: "{"
128
128
  end: "}"
129
129
  selector: support.other.variable
130
- - begin: \colorbox[HTML]{FFFF00}{\color[HTML]{400080}\textbf{
130
+ - begin: \setlength{\fboxsep}{0ex}\colorbox[HTML]{FFFF00}{\rule[-0.5ex]{0pt}{2.0ex}\color[HTML]{400080}\textbf{
131
131
  end: "}}"
132
132
  selector: invalid.illegal
133
- - begin: \colorbox[HTML]{CC66FF}{\color[HTML]{200020}
133
+ - begin: \setlength{\fboxsep}{0ex}\colorbox[HTML]{CC66FF}{\rule[-0.5ex]{0pt}{2.0ex}\color[HTML]{200020}
134
134
  end: "}"
135
135
  selector: invalid.deprecated
136
- - begin: \colorbox[HTML]{2A003F}{
136
+ - begin: \setlength{\fboxsep}{0ex}\colorbox[HTML]{350060}{\rule[-0.5ex]{0pt}{2.0ex}
137
137
  end: "}"
138
138
  selector: source.camlp4.embedded
139
139
  - begin: "{"
@@ -145,7 +145,7 @@ tags:
145
145
  listing:
146
146
  begin: |
147
147
  \newcolumntype{C}{>{\color[HTML]{D0D0FF}\columncolor[HTML]{200020}}l}
148
- \newcolumntype{N}{>{\color[HTML]{D0D0FF}\columncolor[HTML]{500010}}l}
148
+ \newcolumntype{N}{>{\color[HTML]{000000}\columncolor[HTML]{800000}}l}
149
149
  \begin{longtable}{NC}
150
150
 
151
151
  end: |
@@ -165,7 +165,7 @@ document:
165
165
  end: |
166
166
  \end{document}
167
167
 
168
- filter: "@escaped.gsub(/(_|\\{|\\}|&|\\#|\\\\)/, '\\\\\\\\\\1').gsub(/~/, '\\\\textasciitilde').gsub(/ /,'\\\\hspace{1ex}').gsub(/\\t/,'\\\\hspace{3ex}')"
168
+ filter: "@escaped.gsub(/(\\$)/, '\\\\\\\\\\1').gsub(/\\\\(?!\\$)/, '$\\\\\\\\backslash$').gsub(/(_|\\{|\\}|&|\\#|%)/, '\\\\\\\\\\1').gsub(/~/, '\\\\textasciitilde ').gsub(/ /,'\\\\hspace{1ex}').gsub(/\\t| /,'\\\\hspace{3ex}').gsub(/\\\"/, \"''\").gsub(/(\\^)/,'\\\\\\\\\\1{}')"
169
169
  line-numbers:
170
170
  begin: \texttt{
171
171
  end: "}&\\mbox{\\texttt{"
@@ -31,7 +31,7 @@ tags:
31
31
  - begin: "{\\color[HTML]{AB2A1D}\\textit{"
32
32
  end: "}}"
33
33
  selector: invalid.deprecated
34
- - begin: \colorbox[HTML]{9D1E15}{\color[HTML]{F8F8F8}
34
+ - begin: \setlength{\fboxsep}{0ex}\colorbox[HTML]{9D1E15}{\rule[-0.5ex]{0pt}{2.0ex}\color[HTML]{F8F8F8}
35
35
  end: "}"
36
36
  selector: invalid.illegal
37
37
  - begin: "{\\color[HTML]{FF6400}\\textit{"
@@ -70,10 +70,10 @@ tags:
70
70
  - begin: "{\\underline{"
71
71
  end: "}}"
72
72
  selector: source.ocaml constant.numeric.floating-point
73
- - begin: \colorbox[HTML]{131727}{
73
+ - begin: \setlength{\fboxsep}{0ex}\colorbox[HTML]{F7F7F8}{\rule[-0.5ex]{0pt}{2.0ex}
74
74
  end: "}"
75
75
  selector: text.tex.latex meta.function.environment
76
- - begin: \colorbox[HTML]{0F1427}{
76
+ - begin: \setlength{\fboxsep}{0ex}\colorbox[HTML]{7691F3}{\rule[-0.5ex]{0pt}{2.0ex}
77
77
  end: "}"
78
78
  selector: text.tex.latex meta.function.environment meta.function.environment
79
79
  - begin: "{\\color[HTML]{FBDE2D}"
@@ -85,7 +85,7 @@ tags:
85
85
  listing:
86
86
  begin: |
87
87
  \newcolumntype{C}{>{\color[HTML]{F8F8F8}\columncolor[HTML]{0C1021}}l}
88
- \newcolumntype{N}{>{\color[HTML]{F8F8F8}\columncolor[HTML]{253B76}}l}
88
+ \newcolumntype{N}{>{\color[HTML]{FFFFFF}\columncolor[HTML]{253B76}}l}
89
89
  \begin{longtable}{NC}
90
90
 
91
91
  end: |
@@ -105,7 +105,7 @@ document:
105
105
  end: |
106
106
  \end{document}
107
107
 
108
- filter: "@escaped.gsub(/(_|\\{|\\}|&|\\#|\\\\)/, '\\\\\\\\\\1').gsub(/~/, '\\\\textasciitilde').gsub(/ /,'\\\\hspace{1ex}').gsub(/\\t/,'\\\\hspace{3ex}')"
108
+ filter: "@escaped.gsub(/(\\$)/, '\\\\\\\\\\1').gsub(/\\\\(?!\\$)/, '$\\\\\\\\backslash$').gsub(/(_|\\{|\\}|&|\\#|%)/, '\\\\\\\\\\1').gsub(/~/, '\\\\textasciitilde ').gsub(/ /,'\\\\hspace{1ex}').gsub(/\\t| /,'\\\\hspace{3ex}').gsub(/\\\"/, \"''\").gsub(/(\\^)/,'\\\\\\\\\\1{}')"
109
109
  line-numbers:
110
110
  begin: \texttt{
111
111
  end: "}&\\mbox{\\texttt{"