rouge 4.0.1 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/rouge/demos/cisco_ios +19 -0
- data/lib/rouge/lexers/cisco_ios.rb +83 -0
- data/lib/rouge/lexers/cpp.rb +5 -1
- data/lib/rouge/lexers/csharp.rb +13 -12
- data/lib/rouge/lexers/ghc_cmm.rb +1 -1
- data/lib/rouge/lexers/javascript.rb +23 -0
- data/lib/rouge/lexers/php.rb +3 -1
- data/lib/rouge/lexers/python.rb +8 -5
- data/lib/rouge/lexers/yaml.rb +1 -3
- data/lib/rouge/themes/github.rb +137 -62
- data/lib/rouge/version.rb +1 -1
- data/lib/rouge.rb +3 -5
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 555fb3207f31723860f17a269418bbaea9dff23c0ae97dc5f27fabd797fc4ad5
|
4
|
+
data.tar.gz: ad0c9a8de4f66de72f487f8310abda1e763c92816ef2de031a7aea89bcd155c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcdb09306c5640839523e4ade20a7a272d835f0cd7eec7d2a3b43ae4598d5f0ef50ce2c64e24de31d98e10501f5a8ea53b0e064b51a0e3166756a0669e76b3e9
|
7
|
+
data.tar.gz: 8c2deba5fc1d897f655642ed01f1817743d249fe1a8dabcc9de873b5203378b63315c5f5fd18c25a479d97aed5e726c9efffb43b1f0c83fbcc6aaf75ce1cf23d
|
data/Gemfile
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
interface FastEthernet0.20
|
2
|
+
encapsulation dot1Q 20
|
3
|
+
no ip route-cache
|
4
|
+
bridge-group 1
|
5
|
+
no bridge-group 1 source-learning
|
6
|
+
bridge-group 1 spanning-disabled
|
7
|
+
|
8
|
+
! Supports shortened versions of config words, too
|
9
|
+
inter gi0.10
|
10
|
+
encap dot1q 10 native
|
11
|
+
inter gi0
|
12
|
+
|
13
|
+
banner login # Authenticate yourself! #
|
14
|
+
|
15
|
+
! Supports #, $ and % to delimit banners, and multiline
|
16
|
+
banner motd $
|
17
|
+
Attention!
|
18
|
+
We will be having scheduled system maintenance on this device.
|
19
|
+
$
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# -*- coding: utf-8 -*- #
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
# Based on/regexes mostly from Brandon Bennett's pygments-routerlexers:
|
5
|
+
# https://github.com/nemith/pygments-routerlexers
|
6
|
+
|
7
|
+
module Rouge
|
8
|
+
module Lexers
|
9
|
+
class CiscoIos < RegexLexer
|
10
|
+
title 'Cisco IOS'
|
11
|
+
desc 'Cisco IOS configuration lexer'
|
12
|
+
tag 'cisco_ios'
|
13
|
+
filenames '*.cfg'
|
14
|
+
mimetypes 'text/x-cisco-conf'
|
15
|
+
|
16
|
+
state :root do
|
17
|
+
rule %r/^!.*/, Comment::Single
|
18
|
+
|
19
|
+
rule %r/^(version\s+)(.*)$/ do
|
20
|
+
groups Keyword, Num::Float
|
21
|
+
end
|
22
|
+
|
23
|
+
rule %r/(desc*r*i*p*t*i*o*n*)(.*?)$/ do
|
24
|
+
groups Keyword, Comment::Single
|
25
|
+
end
|
26
|
+
|
27
|
+
rule %r/^(inte*r*f*a*c*e*|controller|router \S+|voice translation-\S+|voice-port|line)(.*)$/ do
|
28
|
+
groups Keyword::Type, Name::Function
|
29
|
+
end
|
30
|
+
|
31
|
+
rule %r/(password|secret)(\s+[57]\s+)(\S+)/ do
|
32
|
+
groups Keyword, Num, String::Double
|
33
|
+
end
|
34
|
+
|
35
|
+
rule %r/(permit|deny)/, Operator::Word
|
36
|
+
|
37
|
+
rule %r/^(banner\s+)(motd\s+|login\s+)([#$%])/ do
|
38
|
+
groups Keyword, Name::Function, Str::Delimiter
|
39
|
+
push :cisco_ios_text
|
40
|
+
end
|
41
|
+
|
42
|
+
rule %r/^(dial-peer\s+\S+\s+)(\S+)(.*?)$/ do
|
43
|
+
groups Keyword, Name::Attribute, Keyword
|
44
|
+
end
|
45
|
+
|
46
|
+
rule %r/^(vlan\s+)(\d+)$/ do
|
47
|
+
groups Keyword, Name::Attribute
|
48
|
+
end
|
49
|
+
|
50
|
+
# IPv4 Address/Prefix
|
51
|
+
rule %r/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(\/\d{1,2})?/, Num
|
52
|
+
|
53
|
+
# NSAP
|
54
|
+
rule %r/49\.\d{4}\.\d{4}\.\d{4}\.\d{4}\.\d{2}/, Num
|
55
|
+
|
56
|
+
# MAC Address
|
57
|
+
rule %r/[a-f0-9]{4}\.[a-f0-9]{4}\.[a-f0-9]{4}/, Num::Hex
|
58
|
+
|
59
|
+
rule %r/^(\s*no\s+)(\S+)/ do
|
60
|
+
groups Keyword::Constant, Keyword
|
61
|
+
end
|
62
|
+
|
63
|
+
rule %r/^[^\n\r]\s*\S+/, Keyword
|
64
|
+
|
65
|
+
# Obfuscated Passwords
|
66
|
+
rule %r/\*+/, Name::Entity
|
67
|
+
|
68
|
+
rule %r/(?<= )\d+(?= )/, Num
|
69
|
+
|
70
|
+
# Newline catcher, avoid errors on empty lines
|
71
|
+
rule %r/\n+/m, Text
|
72
|
+
|
73
|
+
# This one goes last, a text catch-all
|
74
|
+
rule %r/./, Text
|
75
|
+
end
|
76
|
+
|
77
|
+
state :cisco_ios_text do
|
78
|
+
rule %r/[^#$%]/, Text
|
79
|
+
rule %r/[#$%]/, Str::Delimiter, :pop!
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
data/lib/rouge/lexers/cpp.rb
CHANGED
@@ -71,7 +71,11 @@ module Rouge
|
|
71
71
|
rule %r/\bnullptr\b/, Name::Builtin
|
72
72
|
rule %r/(?:u8|u|U|L)?R"([a-zA-Z0-9_{}\[\]#<>%:;.?*\+\-\/\^&|~!=,"']{,16})\(.*?\)\1"/m, Str
|
73
73
|
rule %r/(::|<=>)/, Operator
|
74
|
-
rule %r/[{
|
74
|
+
rule %r/[{]/, Punctuation
|
75
|
+
rule %r/}/ do
|
76
|
+
token Punctuation
|
77
|
+
pop! if in_state?(:function) # pop :function
|
78
|
+
end
|
75
79
|
end
|
76
80
|
|
77
81
|
state :classname do
|
data/lib/rouge/lexers/csharp.rb
CHANGED
@@ -27,19 +27,19 @@ module Rouge
|
|
27
27
|
static switch this throw true try typeof unchecked unsafe
|
28
28
|
virtual void volatile while
|
29
29
|
add alias async await get global partial remove set value where
|
30
|
-
yield nameof
|
31
|
-
ascending by descending equals from group in into join let
|
32
|
-
orderby select
|
30
|
+
yield nameof notnull
|
31
|
+
ascending by descending equals from group in init into join let
|
32
|
+
on orderby select unmanaged when and not or with
|
33
33
|
)
|
34
34
|
|
35
35
|
keywords_type = %w(
|
36
|
-
bool byte char decimal double dynamic float int long
|
37
|
-
sbyte short string uint ulong ushort var
|
36
|
+
bool byte char decimal double dynamic float int long nint nuint
|
37
|
+
object sbyte short string uint ulong ushort var
|
38
38
|
)
|
39
39
|
|
40
40
|
cpp_keywords = %w(
|
41
41
|
if endif else elif define undef line error warning region
|
42
|
-
endregion pragma
|
42
|
+
endregion pragma nullable
|
43
43
|
)
|
44
44
|
|
45
45
|
state :whitespace do
|
@@ -81,14 +81,15 @@ module Rouge
|
|
81
81
|
rule %r/@"(""|[^"])*"/m, Str
|
82
82
|
rule %r/"(\\.|.)*?["\n]/, Str
|
83
83
|
rule %r/'(\\.|.)'/, Str::Char
|
84
|
-
rule %r/
|
84
|
+
rule %r/0b[_01]+[lu]?/i, Num
|
85
|
+
rule %r/0x[_0-9a-f]+[lu]?/i, Num
|
85
86
|
rule %r(
|
86
|
-
[0-9]
|
87
|
-
([.][0-9]*)? # decimal
|
88
|
-
(e[+-][0-9]
|
89
|
-
[
|
87
|
+
[0-9](?:[_0-9]*[0-9])?
|
88
|
+
([.][0-9](?:[_0-9]*[0-9])?)? # decimal
|
89
|
+
(e[+-]?[0-9](?:[_0-9]*[0-9])?)? # exponent
|
90
|
+
[fldum]? # type
|
90
91
|
)ix, Num
|
91
|
-
rule %r/\b(?:class|struct|interface)\b/, Keyword, :class
|
92
|
+
rule %r/\b(?:class|record|struct|interface)\b/, Keyword, :class
|
92
93
|
rule %r/\b(?:namespace|using)\b/, Keyword, :namespace
|
93
94
|
rule %r/^#[ \t]*(#{cpp_keywords.join('|')})\b.*?\n/,
|
94
95
|
Comment::Preproc
|
data/lib/rouge/lexers/ghc_cmm.rb
CHANGED
@@ -22,7 +22,7 @@ module Rouge
|
|
22
22
|
ws = %r(\s|//.*?\n|/[*](?:[^*]|(?:[*][^/]))*[*]+/)mx
|
23
23
|
|
24
24
|
# Make sure that this is not a preprocessor macro, e.g. `#if` or `#define`.
|
25
|
-
id = %r((
|
25
|
+
id = %r((?!\#[a-zA-Z])[\w#\$%_']+)
|
26
26
|
|
27
27
|
complex_id = %r(
|
28
28
|
(?:[\w#$%_']|\(\)|\(,\)|\[\]|[0-9])*
|
@@ -177,6 +177,21 @@ module Rouge
|
|
177
177
|
push :expr_start
|
178
178
|
end
|
179
179
|
|
180
|
+
rule %r/(class)((?:\s|\\\s)+)/ do
|
181
|
+
groups Keyword::Declaration, Text
|
182
|
+
push :classname
|
183
|
+
end
|
184
|
+
|
185
|
+
rule %r/([\p{Nl}$_]*\p{Lu}[\p{Word}]*)[ \t]*(?=(\(.*\)))/m, Name::Class
|
186
|
+
|
187
|
+
rule %r/(function)((?:\s|\\\s)+)(#{id})/ do
|
188
|
+
groups Keyword::Declaration, Text, Name::Function
|
189
|
+
end
|
190
|
+
|
191
|
+
rule %r/function(?=(\(.*\)))/, Keyword::Declaration # For anonymous functions
|
192
|
+
|
193
|
+
rule %r/(#{id})[ \t]*(?=(\(.*\)))/m, Name::Function
|
194
|
+
|
180
195
|
rule %r/[{}]/, Punctuation, :statement
|
181
196
|
|
182
197
|
rule id do |m|
|
@@ -220,6 +235,14 @@ module Rouge
|
|
220
235
|
rule %r/'/, Str::Delimiter, :pop!
|
221
236
|
end
|
222
237
|
|
238
|
+
state :classname do
|
239
|
+
rule %r/(#{id})((?:\s|\\\s)+)(extends)((?:\s|\\\s)+)/ do
|
240
|
+
groups Name::Class, Text, Keyword::Declaration, Text
|
241
|
+
end
|
242
|
+
|
243
|
+
rule id, Name::Class, :pop!
|
244
|
+
end
|
245
|
+
|
223
246
|
# braced parts that aren't object literals
|
224
247
|
state :statement do
|
225
248
|
rule %r/case\b/ do
|
data/lib/rouge/lexers/php.rb
CHANGED
@@ -211,7 +211,7 @@ module Rouge
|
|
211
211
|
|
212
212
|
state :whitespace do
|
213
213
|
rule %r/\s+/, Text
|
214
|
-
rule %r
|
214
|
+
rule %r/#[^\[].*?$/, Comment::Single
|
215
215
|
rule %r(//.*?$), Comment::Single
|
216
216
|
rule %r(/\*\*(?!/).*?\*/)m, Comment::Doc
|
217
217
|
rule %r(/\*.*?\*/)m, Comment::Multiline
|
@@ -235,6 +235,8 @@ module Rouge
|
|
235
235
|
groups Keyword::Namespace, Text, Name::Namespace
|
236
236
|
end
|
237
237
|
|
238
|
+
rule %r/#\[.*\]$/, Name::Attribute
|
239
|
+
|
238
240
|
rule %r/(class|interface|trait|extends|implements)
|
239
241
|
(\s+)
|
240
242
|
(#{id_with_ns})/ix do |m|
|
data/lib/rouge/lexers/python.rb
CHANGED
@@ -40,7 +40,7 @@ module Rouge
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def self.builtins_pseudo
|
43
|
-
@builtins_pseudo ||= %w(
|
43
|
+
@builtins_pseudo ||= %w(None Ellipsis NotImplemented False True)
|
44
44
|
end
|
45
45
|
|
46
46
|
def self.exceptions
|
@@ -86,6 +86,8 @@ module Rouge
|
|
86
86
|
rule %r/\\\n/, Text
|
87
87
|
rule %r/\\/, Text
|
88
88
|
|
89
|
+
rule %r/@#{dotted_identifier}/i, Name::Decorator
|
90
|
+
|
89
91
|
rule %r/(in|is|and|or|not)\b/, Operator::Word
|
90
92
|
rule %r/(<<|>>|\/\/|\*\*)=?/, Operator
|
91
93
|
rule %r/[-~+\/*%=<>&^|@]=?|!=/, Operator
|
@@ -93,13 +95,13 @@ module Rouge
|
|
93
95
|
rule %r/(from)((?:\\\s|\s)+)(#{dotted_identifier})((?:\\\s|\s)+)(import)/ do
|
94
96
|
groups Keyword::Namespace,
|
95
97
|
Text,
|
96
|
-
Name
|
98
|
+
Name,
|
97
99
|
Text,
|
98
100
|
Keyword::Namespace
|
99
101
|
end
|
100
102
|
|
101
103
|
rule %r/(import)(\s+)(#{dotted_identifier})/ do
|
102
|
-
groups Keyword::Namespace, Text, Name
|
104
|
+
groups Keyword::Namespace, Text, Name
|
103
105
|
end
|
104
106
|
|
105
107
|
rule %r/(def)((?:\s|\\\s)+)/ do
|
@@ -112,6 +114,9 @@ module Rouge
|
|
112
114
|
push :classname
|
113
115
|
end
|
114
116
|
|
117
|
+
rule %r/([a-z_]\w*)[ \t]*(?=(\(.*\)))/m, Name::Function
|
118
|
+
rule %r/([A-Z_]\w*)[ \t]*(?=(\(.*\)))/m, Name::Class
|
119
|
+
|
115
120
|
# TODO: not in python 3
|
116
121
|
rule %r/`.*?`/, Str::Backtick
|
117
122
|
rule %r/([rfbu]{0,2})('''|"""|['"])/i do |m|
|
@@ -120,8 +125,6 @@ module Rouge
|
|
120
125
|
push :generic_string
|
121
126
|
end
|
122
127
|
|
123
|
-
rule %r/@#{dotted_identifier}/i, Name::Decorator
|
124
|
-
|
125
128
|
# using negative lookbehind so we don't match property names
|
126
129
|
rule %r/(?<!\.)#{identifier}/ do |m|
|
127
130
|
if self.class.keywords.include? m[0]
|
data/lib/rouge/lexers/yaml.rb
CHANGED
@@ -18,8 +18,6 @@ module Rouge
|
|
18
18
|
return true if text =~ /\A\s*%YAML/m
|
19
19
|
end
|
20
20
|
|
21
|
-
SPECIAL_VALUES = Regexp.union(%w(true false null))
|
22
|
-
|
23
21
|
# NB: Tabs are forbidden in YAML, which is why you see things
|
24
22
|
# like /[ ]+/.
|
25
23
|
|
@@ -340,7 +338,7 @@ module Rouge
|
|
340
338
|
end
|
341
339
|
|
342
340
|
rule %r/[ ]+/, Str
|
343
|
-
rule
|
341
|
+
rule %r((true|false|null)\b), Keyword::Constant
|
344
342
|
rule %r/\d+(?:\.\d+)?(?=(\r?\n)| +#)/, Literal::Number, :pop!
|
345
343
|
|
346
344
|
# regular non-whitespace characters
|
data/lib/rouge/themes/github.rb
CHANGED
@@ -6,68 +6,143 @@ module Rouge
|
|
6
6
|
class Github < CSSTheme
|
7
7
|
name 'github'
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
9
|
+
# Primer primitives
|
10
|
+
# https://github.com/primer/primitives/tree/main/src/tokens
|
11
|
+
P_RED_0 = {:light => '#ffebe9', :dark => '#ffdcd7'}
|
12
|
+
P_RED_3 = {:dark => '#ff7b72'}
|
13
|
+
P_RED_5 = {:light => '#cf222e'}
|
14
|
+
P_RED_7 = {:light => '#82071e', :dark => '#8e1519'}
|
15
|
+
P_RED_8 = {:dark => '#67060c'}
|
16
|
+
P_ORANGE_2 = {:dark => '#ffa657'}
|
17
|
+
P_ORANGE_6 = {:light => '#953800'}
|
18
|
+
P_GREEN_0 = {:light => '#dafbe1', :dark => '#aff5b4'}
|
19
|
+
P_GREEN_1 = {:dark => '#7ee787'}
|
20
|
+
P_GREEN_6 = {:light => '#116329'}
|
21
|
+
P_GREEN_8 = {:dark => '#033a16'}
|
22
|
+
P_BLUE_1 = {:dark => '#a5d6ff'}
|
23
|
+
P_BLUE_2 = {:dark => '#79c0ff'}
|
24
|
+
P_BLUE_5 = {:dark => '#1f6feb'}
|
25
|
+
P_BLUE_6 = {:light => '#0550ae'}
|
26
|
+
P_BLUE_8 = {:light => '#0a3069'}
|
27
|
+
P_PURPLE_2 = {:dark => '#d2a8ff'}
|
28
|
+
P_PURPLE_5 = {:light => '#8250df'}
|
29
|
+
P_GRAY_0 = {:light => '#f6f8fa', :dark => '#f0f6fc'}
|
30
|
+
P_GRAY_1 = {:dark => '#c9d1d9'}
|
31
|
+
P_GRAY_3 = {:dark => '#8b949e'}
|
32
|
+
P_GRAY_5 = {:light => '#6e7781'}
|
33
|
+
P_GRAY_8 = {:dark => '#161b22'}
|
34
|
+
P_GRAY_9 = {:light => '#24292f'}
|
35
|
+
|
36
|
+
extend HasModes
|
37
|
+
|
38
|
+
def self.light!
|
39
|
+
mode :dark # indicate that there is a dark variant
|
40
|
+
mode! :light
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.dark!
|
44
|
+
mode :light # indicate that there is a light variant
|
45
|
+
mode! :dark
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.make_dark!
|
49
|
+
palette :comment => P_GRAY_3[@mode]
|
50
|
+
palette :constant => P_BLUE_2[@mode]
|
51
|
+
palette :entity => P_PURPLE_2[@mode]
|
52
|
+
palette :heading => P_BLUE_5[@mode]
|
53
|
+
palette :keyword => P_RED_3[@mode]
|
54
|
+
palette :string => P_BLUE_1[@mode]
|
55
|
+
palette :tag => P_GREEN_1[@mode]
|
56
|
+
palette :variable => P_ORANGE_2[@mode]
|
57
|
+
|
58
|
+
palette :fgDefault => P_GRAY_1[@mode]
|
59
|
+
palette :bgDefault => P_GRAY_8[@mode]
|
60
|
+
|
61
|
+
palette :fgInserted => P_GREEN_0[@mode]
|
62
|
+
palette :bgInserted => P_GREEN_8[@mode]
|
63
|
+
|
64
|
+
palette :fgDeleted => P_RED_0[@mode]
|
65
|
+
palette :bgDeleted => P_RED_8[@mode]
|
66
|
+
|
67
|
+
palette :fgError => P_GRAY_0[@mode]
|
68
|
+
palette :bgError => P_RED_7[@mode]
|
69
|
+
end
|
70
|
+
|
71
|
+
def self.make_light!
|
72
|
+
palette :comment => P_GRAY_5[@mode]
|
73
|
+
palette :constant => P_BLUE_6[@mode]
|
74
|
+
palette :entity => P_PURPLE_5[@mode]
|
75
|
+
palette :heading => P_BLUE_6[@mode]
|
76
|
+
palette :keyword => P_RED_5[@mode]
|
77
|
+
palette :string => P_BLUE_8[@mode]
|
78
|
+
palette :tag => P_GREEN_6[@mode]
|
79
|
+
palette :variable => P_ORANGE_6[@mode]
|
80
|
+
|
81
|
+
palette :fgDefault => P_GRAY_9[@mode]
|
82
|
+
palette :bgDefault => P_GRAY_0[@mode]
|
83
|
+
|
84
|
+
palette :fgInserted => P_GREEN_6[@mode]
|
85
|
+
palette :bgInserted => P_GREEN_0[@mode]
|
86
|
+
|
87
|
+
palette :fgDeleted => P_RED_7[@mode]
|
88
|
+
palette :bgDeleted => P_RED_0[@mode]
|
89
|
+
|
90
|
+
palette :fgError => P_GRAY_0[@mode]
|
91
|
+
palette :bgError => P_RED_7[@mode]
|
92
|
+
end
|
93
|
+
|
94
|
+
light!
|
95
|
+
|
96
|
+
style Text, :fg => :fgDefault, :bg => :bgDefault
|
97
|
+
|
98
|
+
style Keyword, :fg => :keyword
|
99
|
+
|
100
|
+
style Generic::Error, :fg => :fgError
|
101
|
+
|
102
|
+
style Generic::Deleted, :fg => :fgDeleted, :bg => :bgDeleted
|
103
|
+
|
104
|
+
style Name::Builtin,
|
105
|
+
Name::Class,
|
106
|
+
Name::Constant,
|
107
|
+
Name::Namespace, :fg => :variable
|
108
|
+
|
109
|
+
style Literal::String::Regex,
|
110
|
+
Name::Attribute,
|
111
|
+
Name::Tag, :fg => :tag
|
112
|
+
|
113
|
+
style Generic::Inserted, :fg => :fgInserted, :bg => :bgInserted
|
114
|
+
|
115
|
+
style Keyword::Constant,
|
116
|
+
Literal,
|
117
|
+
Literal::String::Backtick,
|
118
|
+
Name::Builtin::Pseudo,
|
119
|
+
Name::Exception,
|
120
|
+
Name::Label,
|
121
|
+
Name::Property,
|
122
|
+
Name::Variable,
|
123
|
+
Operator, :fg => :constant
|
124
|
+
|
125
|
+
style Generic::Heading,
|
126
|
+
Generic::Subheading, :fg => :heading, :bold => true
|
127
|
+
|
128
|
+
style Literal::String, :fg => :string
|
129
|
+
|
130
|
+
style Name::Decorator,
|
131
|
+
Name::Function, :fg => :entity
|
132
|
+
|
133
|
+
style Error, :fg => :fgError, :bg => :bgError
|
134
|
+
|
135
|
+
style Comment,
|
136
|
+
Generic::Lineno,
|
137
|
+
Generic::Traceback, :fg => :comment
|
138
|
+
|
139
|
+
style Name::Entity,
|
140
|
+
Literal::String::Interpol, :fg => :fgDefault
|
141
|
+
|
142
|
+
style Generic::Emph, :fg => :fgDefault, :italic => true
|
143
|
+
|
144
|
+
style Generic::Strong, :fg => :fgDefault, :bold => true
|
145
|
+
|
71
146
|
end
|
72
147
|
end
|
73
148
|
end
|
data/lib/rouge/version.rb
CHANGED
data/lib/rouge.rb
CHANGED
@@ -47,11 +47,9 @@ module Rouge
|
|
47
47
|
#
|
48
48
|
# @api private
|
49
49
|
def load_lexers
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
Dir.glob(File.join(lexer_dir, '*.rb')).each do |f|
|
54
|
-
Lexers.load_lexer(f.sub(lexer_dir, ''))
|
50
|
+
lexer_dir = Pathname.new(LIB_DIR) / "rouge/lexers"
|
51
|
+
Pathname.glob(lexer_dir / '*.rb').each do |f|
|
52
|
+
Lexers.load_lexer(f.relative_path_from(lexer_dir))
|
55
53
|
end
|
56
54
|
end
|
57
55
|
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: 4.0
|
4
|
+
version: 4.1.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:
|
11
|
+
date: 2023-02-12 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:
|
@@ -44,6 +44,7 @@ files:
|
|
44
44
|
- lib/rouge/demos/c
|
45
45
|
- lib/rouge/demos/ceylon
|
46
46
|
- lib/rouge/demos/cfscript
|
47
|
+
- lib/rouge/demos/cisco_ios
|
47
48
|
- lib/rouge/demos/clean
|
48
49
|
- lib/rouge/demos/clojure
|
49
50
|
- lib/rouge/demos/cmake
|
@@ -284,6 +285,7 @@ files:
|
|
284
285
|
- lib/rouge/lexers/c.rb
|
285
286
|
- lib/rouge/lexers/ceylon.rb
|
286
287
|
- lib/rouge/lexers/cfscript.rb
|
288
|
+
- lib/rouge/lexers/cisco_ios.rb
|
287
289
|
- lib/rouge/lexers/clean.rb
|
288
290
|
- lib/rouge/lexers/clojure.rb
|
289
291
|
- lib/rouge/lexers/cmake.rb
|