rouge 1.10.1 → 1.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rouge/cli.rb +1 -1
  3. data/lib/rouge/demos/actionscript +4 -0
  4. data/lib/rouge/demos/apiblueprint +33 -0
  5. data/lib/rouge/demos/biml +38 -0
  6. data/lib/rouge/demos/ceylon +7 -0
  7. data/lib/rouge/demos/cmake +7 -0
  8. data/lib/rouge/demos/coq +11 -0
  9. data/lib/rouge/demos/d +16 -0
  10. data/lib/rouge/demos/eiffel +30 -0
  11. data/lib/rouge/demos/fortran +22 -0
  12. data/lib/rouge/demos/gradle +10 -0
  13. data/lib/rouge/demos/jinja +9 -0
  14. data/lib/rouge/demos/jsonnet +28 -0
  15. data/lib/rouge/demos/julia +11 -0
  16. data/lib/rouge/demos/nasm +26 -0
  17. data/lib/rouge/demos/objective_c +4 -0
  18. data/lib/rouge/demos/protobuf +5 -0
  19. data/lib/rouge/demos/shell_session +10 -0
  20. data/lib/rouge/demos/smarty +12 -0
  21. data/lib/rouge/demos/tap +5 -0
  22. data/lib/rouge/demos/twig +9 -0
  23. data/lib/rouge/demos/typescript +1 -0
  24. data/lib/rouge/demos/verilog +27 -0
  25. data/lib/rouge/demos/viml +14 -5
  26. data/lib/rouge/formatters/html_wrapper.rb +11 -0
  27. data/lib/rouge/formatters/terminal256.rb +1 -1
  28. data/lib/rouge/lexer.rb +4 -2
  29. data/lib/rouge/lexers/actionscript.rb +195 -0
  30. data/lib/rouge/lexers/apache.rb +23 -20
  31. data/lib/rouge/lexers/apache/keywords.yml +721 -410
  32. data/lib/rouge/lexers/apiblueprint.rb +51 -0
  33. data/lib/rouge/lexers/biml.rb +41 -0
  34. data/lib/rouge/lexers/c.rb +7 -2
  35. data/lib/rouge/lexers/ceylon.rb +123 -0
  36. data/lib/rouge/lexers/clojure.rb +1 -1
  37. data/lib/rouge/lexers/cmake.rb +206 -0
  38. data/lib/rouge/lexers/coffeescript.rb +1 -1
  39. data/lib/rouge/lexers/coq.rb +187 -0
  40. data/lib/rouge/lexers/cpp.rb +12 -1
  41. data/lib/rouge/lexers/csharp.rb +12 -5
  42. data/lib/rouge/lexers/css.rb +2 -0
  43. data/lib/rouge/lexers/d.rb +176 -0
  44. data/lib/rouge/lexers/diff.rb +9 -9
  45. data/lib/rouge/lexers/eiffel.rb +65 -0
  46. data/lib/rouge/lexers/fortran.rb +142 -0
  47. data/lib/rouge/lexers/gradle.rb +37 -0
  48. data/lib/rouge/lexers/groovy.rb +2 -2
  49. data/lib/rouge/lexers/ini.rb +2 -2
  50. data/lib/rouge/lexers/java.rb +11 -8
  51. data/lib/rouge/lexers/javascript.rb +2 -1
  52. data/lib/rouge/lexers/jinja.rb +137 -0
  53. data/lib/rouge/lexers/jsonnet.rb +151 -0
  54. data/lib/rouge/lexers/julia.rb +172 -0
  55. data/lib/rouge/lexers/markdown.rb +1 -0
  56. data/lib/rouge/lexers/nasm.rb +203 -0
  57. data/lib/rouge/lexers/objective_c.rb +11 -0
  58. data/lib/rouge/lexers/php.rb +1 -1
  59. data/lib/rouge/lexers/powershell.rb +1 -1
  60. data/lib/rouge/lexers/protobuf.rb +70 -0
  61. data/lib/rouge/lexers/python.rb +23 -0
  62. data/lib/rouge/lexers/r.rb +53 -20
  63. data/lib/rouge/lexers/ruby.rb +4 -4
  64. data/lib/rouge/lexers/rust.rb +2 -2
  65. data/lib/rouge/lexers/shell_session.rb +29 -0
  66. data/lib/rouge/lexers/smarty.rb +91 -0
  67. data/lib/rouge/lexers/sql.rb +1 -1
  68. data/lib/rouge/lexers/swift.rb +20 -5
  69. data/lib/rouge/lexers/tap.rb +91 -0
  70. data/lib/rouge/lexers/twig.rb +37 -0
  71. data/lib/rouge/lexers/typescript.rb +46 -0
  72. data/lib/rouge/lexers/verilog.rb +164 -0
  73. data/lib/rouge/regex_lexer.rb +1 -1
  74. data/lib/rouge/version.rb +1 -1
  75. data/rouge.gemspec +1 -1
  76. metadata +47 -6
  77. data/lib/rouge/formatters/html_inline.rb +0 -20
  78. data/lib/rouge/formatters/html_linewise.rb +0 -31
@@ -1,20 +0,0 @@
1
- # -*- coding: utf-8 -*- #
2
-
3
- module Rouge
4
- module Formatters
5
- class HTMLInline < HTML
6
- def initialize(theme)
7
- @theme = theme
8
- end
9
-
10
- def safe_span(tok, safe_val)
11
- return safe_val if tok == Token::Tokens::Text
12
-
13
- rules = @inline_theme.style_for(tok).rendered_rules
14
-
15
- "<span style=\"#{rules.to_a.join(';')}\">#{safe_val}</span>"
16
- end
17
- end
18
- end
19
- end
20
-
@@ -1,31 +0,0 @@
1
- # -*- coding: utf-8 -*- #
2
-
3
- module Rouge
4
- module Formatters
5
- class HTMLLinewise < Formatter
6
- def initialize(formatter, opts={})
7
- @formatter = formatter
8
- @class_format = opts.fetch(:class, '%i')
9
- end
10
-
11
- def stream(tokens, &b)
12
- yield "<span class=#{next_line_class}>"
13
- tokens.each do |tok, val|
14
- val.scan /\n|[^\n]+/ do |s|
15
- if s == "\n"
16
- yield "</span>\n<span class=#{next_line_class}>"
17
- else
18
- @formatter.span(tok, s)
19
- end
20
- end
21
- end
22
- yield "</span>"
23
- end
24
-
25
- def next_line_class
26
- @lineno ||= -1
27
- sprintf(@class_format, @lineno += 1).inspect
28
- end
29
- end
30
- end
31
- end