schizm 0.0.1
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/bin/schizm +36 -0
- data/lib/schizm/chunk.rb +130 -0
- data/lib/schizm/env.rb +421 -0
- data/lib/schizm/env_colors.rb +173 -0
- data/lib/schizm/markup.rb +157 -0
- data/lib/schizm/match.rb +211 -0
- data/lib/schizm/parse.rb +398 -0
- data/lib/schizm/string.rb +161 -0
- data/res/fonts/fira-code-bold.otf +0 -0
- data/res/fonts/fira-code-license +102 -0
- data/res/fonts/fira-code-light.otf +0 -0
- data/res/fonts/fira-code-medium.otf +0 -0
- data/res/fonts/fira-code-regular.otf +0 -0
- data/res/fonts/fira-code.css +20 -0
- data/res/fonts/genericons-neue-license +339 -0
- data/res/fonts/genericons-neue.css +1 -0
- data/res/fonts/genericons-neue.eot +0 -0
- data/res/fonts/genericons-neue.ttf +0 -0
- data/res/fonts/genericons-neue.woff2 +0 -0
- data/res/fonts/social-logos-license +264 -0
- data/res/fonts/social-logos.css +1 -0
- data/res/fonts/social-logos.eot +0 -0
- data/res/fonts/social-logos.ttf +0 -0
- data/res/fonts/social-logos.woff2 +0 -0
- data/res/license/BSD-2-Clause +24 -0
- data/res/license/BSD-3-Clause +29 -0
- data/res/license/GPL-2.0 +13 -0
- data/res/license/GPL-3.0 +12 -0
- data/res/license/LGPL-2.1 +14 -0
- data/res/license/LGPL-3.0 +14 -0
- data/res/license/MIT +17 -0
- data/res/license/MPL-2.0 +3 -0
- data/res/schizm.js +0 -0
- data/res/schizm.liquid +81 -0
- data/res/scss/fonts.scss +4 -0
- data/res/scss/mixin.scss +20 -0
- data/res/scss/style.scss +323 -0
- metadata +81 -0
@@ -0,0 +1,173 @@
|
|
1
|
+
module Schizm
|
2
|
+
|
3
|
+
module Env
|
4
|
+
|
5
|
+
COLORS = {
|
6
|
+
'red' => {
|
7
|
+
'50' => ['#FFEBEE', '#222222'],
|
8
|
+
'100' => ['#FFCDD2', '#222222'],
|
9
|
+
'200' => ['#EF9A9A', '#222222'],
|
10
|
+
'300' => ['#E57373', '#222222'],
|
11
|
+
'400' => ['#EF5350', '#EEEEEE'],
|
12
|
+
'500' => ['#F44336', '#EEEEEE'],
|
13
|
+
'600' => ['#E53935', '#EEEEEE'],
|
14
|
+
'700' => ['#D32F2F', '#EEEEEE'],
|
15
|
+
'800' => ['#C62828', '#EEEEEE'],
|
16
|
+
'900' => ['#B71C1C', '#EEEEEE'],
|
17
|
+
'A100' => ['#FF8A80', '#222222'],
|
18
|
+
'A200' => ['#FF5252', '#EEEEEE'],
|
19
|
+
'A400' => ['#FF1744', '#EEEEEE'],
|
20
|
+
'A700' => ['#D50000', '#EEEEEE']
|
21
|
+
},
|
22
|
+
'pink' => {
|
23
|
+
'50' => ['#FCE4EC', '#222222'],
|
24
|
+
'100' => ['#F8BBD0', '#222222'],
|
25
|
+
'200' => ['#F48FB1', '#222222'],
|
26
|
+
'300' => ['#F06292', '#222222'],
|
27
|
+
'400' => ['#EC407A', '#EEEEEE'],
|
28
|
+
'500' => ['#E91E63', '#EEEEEE'],
|
29
|
+
'600' => ['#D81B60', '#EEEEEE'],
|
30
|
+
'700' => ['#C2185B', '#EEEEEE'],
|
31
|
+
'800' => ['#AD1457', '#EEEEEE'],
|
32
|
+
'900' => ['#880E4F', '#EEEEEE'],
|
33
|
+
'A100' => ['#FF80AB', '#222222'],
|
34
|
+
'A200' => ['#FF4081', '#EEEEEE'],
|
35
|
+
'A400' => ['#F50057', '#EEEEEE'],
|
36
|
+
'A700' => ['#C51162', '#EEEEEE']
|
37
|
+
},
|
38
|
+
'purple' => {
|
39
|
+
'50' => ['#F3E5F5', '#222222'],
|
40
|
+
'100' => ['#E1BEE7', '#222222'],
|
41
|
+
'200' => ['#CE93D8', '#222222'],
|
42
|
+
'300' => ['#BA68C8', '#EEEEEE'],
|
43
|
+
'400' => ['#AB47BC', '#EEEEEE'],
|
44
|
+
'500' => ['#9C27B0', '#EEEEEE'],
|
45
|
+
'600' => ['#8E24AA', '#EEEEEE'],
|
46
|
+
'700' => ['#7B1FA2', '#EEEEEE'],
|
47
|
+
'800' => ['#6A1B8A', '#EEEEEE'],
|
48
|
+
'900' => ['#4A148C', '#EEEEEE'],
|
49
|
+
'A100' => ['#EA80FC', '#222222'],
|
50
|
+
'A200' => ['#E040FB', '#EEEEEE'],
|
51
|
+
'A400' => ['#D500F9', '#EEEEEE'],
|
52
|
+
'A700' => ['#AA00FF', '#EEEEEE']
|
53
|
+
},
|
54
|
+
'deep-purple' => {
|
55
|
+
'50' => ['#EDE7F6', '#222222'],
|
56
|
+
'100' => ['#D1C4E9', '#222222'],
|
57
|
+
'200' => ['#B39DDB', '#222222'],
|
58
|
+
'300' => ['#9575CD', '#EEEEEE'],
|
59
|
+
'400' => ['#7E57C2', '#EEEEEE'],
|
60
|
+
'500' => ['#673AB7', '#EEEEEE'],
|
61
|
+
'600' => ['#5E35B1', '#EEEEEE'],
|
62
|
+
'700' => ['#512DA8', '#EEEEEE'],
|
63
|
+
'800' => ['#4527A0', '#EEEEEE'],
|
64
|
+
'900' => ['#311B92', '#EEEEEE'],
|
65
|
+
'A100' => ['#B388FF', '#222222'],
|
66
|
+
'A200' => ['#7C4DFF', '#EEEEEE'],
|
67
|
+
'A400' => ['#651FFF', '#EEEEEE'],
|
68
|
+
'A700' => ['#6200EA', '#EEEEEE']
|
69
|
+
},
|
70
|
+
'indigo' => {
|
71
|
+
'50' => ['#E8EAF6', '#222222'],
|
72
|
+
'100' => ['#C5CAE9', '#222222'],
|
73
|
+
'200' => ['#9FA8DA', '#222222'],
|
74
|
+
'300' => ['#7986CB', '#EEEEEE'],
|
75
|
+
'400' => ['#5C6BC0', '#EEEEEE'],
|
76
|
+
'500' => ['#3F51B5', '#EEEEEE'],
|
77
|
+
'600' => ['#3949AB', '#EEEEEE'],
|
78
|
+
'700' => ['#303F9F', '#EEEEEE'],
|
79
|
+
'800' => ['#283593', '#EEEEEE'],
|
80
|
+
'900' => ['#1A237E', '#EEEEEE'],
|
81
|
+
'A100' => ['#8C9EFF', '#222222'],
|
82
|
+
'A200' => ['#536DFE', '#EEEEEE'],
|
83
|
+
'A400' => ['#3D5AFE', '#EEEEEE'],
|
84
|
+
'A700' => ['#304FFE', '#EEEEEE']
|
85
|
+
},
|
86
|
+
'blue' => {
|
87
|
+
'50' => ['#E3F2FD', '#222222'],
|
88
|
+
'100' => ['#BBDEFB', '#222222'],
|
89
|
+
'200' => ['#90CAF9', '#222222'],
|
90
|
+
'300' => ['#64B5F6', '#222222'],
|
91
|
+
'400' => ['#42A5F5', '#222222'],
|
92
|
+
'500' => ['#2196F3', '#222222'],
|
93
|
+
'600' => ['#1E88E5', '#EEEEEE'],
|
94
|
+
'700' => ['#1976D2', '#EEEEEE'],
|
95
|
+
'800' => ['#1565C0', '#EEEEEE'],
|
96
|
+
'900' => ['#0D47A1', '#EEEEEE'],
|
97
|
+
'A100' => ['#82B1FF', '#222222'],
|
98
|
+
'A200' => ['#448AFF', '#EEEEEE'],
|
99
|
+
'A400' => ['#2979FF', '#EEEEEE'],
|
100
|
+
'A700' => ['#2962FF', '#EEEEEE']
|
101
|
+
},
|
102
|
+
'light-blue' => {
|
103
|
+
'50' => ['#E1F5FE', '#222222'],
|
104
|
+
'100' => ['#B3E5FC', '#222222'],
|
105
|
+
'200' => ['#81D4FA', '#222222'],
|
106
|
+
'300' => ['#4FC3F7', '#222222'],
|
107
|
+
'400' => ['#29B6F6', '#222222'],
|
108
|
+
'500' => ['#03A9F4', '#222222'],
|
109
|
+
'600' => ['#039BE5', '#222222'],
|
110
|
+
'700' => ['#0288D1', '#EEEEEE'],
|
111
|
+
'800' => ['#0277BD', '#EEEEEE'],
|
112
|
+
'900' => ['#01579B', '#EEEEEE'],
|
113
|
+
'A100' => ['#80D8FF', '#222222'],
|
114
|
+
'A200' => ['#40C4FF', '#222222'],
|
115
|
+
'A400' => ['#00B0FF', '#222222'],
|
116
|
+
'A700' => ['#0091EA', '#EEEEEE']
|
117
|
+
},
|
118
|
+
'cyan' => {
|
119
|
+
'50' => ['#E0F7FA', '#222222'],
|
120
|
+
'100' => ['#B2EBF2', '#222222'],
|
121
|
+
'200' => ['#80DEEA', '#222222'],
|
122
|
+
'300' => ['#4DD0E1', '#222222'],
|
123
|
+
'400' => ['#26C6DA', '#222222'],
|
124
|
+
'500' => ['#00BCD4', '#222222'],
|
125
|
+
'600' => ['#00ACC1', '#222222'],
|
126
|
+
'700' => ['#0097A7', '#EEEEEE'],
|
127
|
+
'800' => ['#00838F', '#EEEEEE'],
|
128
|
+
'900' => ['#006064', '#EEEEEE'],
|
129
|
+
'A100' => ['#84FFFF', '#222222'],
|
130
|
+
'A200' => ['#18FFFF', '#222222'],
|
131
|
+
'A400' => ['#00E5FF', '#222222'],
|
132
|
+
'A700' => ['#00B8D4', '#222222']
|
133
|
+
},
|
134
|
+
'teal' => {
|
135
|
+
'50' => ['#E0F2F1', '#222222'],
|
136
|
+
'100' => ['#B2DFDB', '#222222'],
|
137
|
+
'200' => ['#80CBC4', '#222222'],
|
138
|
+
'300' => ['#4DB6AC', '#222222'],
|
139
|
+
'400' => ['#26A69A', '#222222'],
|
140
|
+
'500' => ['#009688', '#EEEEEE'],
|
141
|
+
'600' => ['#00897B', '#EEEEEE'],
|
142
|
+
'700' => ['#00796B', '#EEEEEE'],
|
143
|
+
'800' => ['#00695C', '#EEEEEE'],
|
144
|
+
'900' => ['#004D40', '#EEEEEE'],
|
145
|
+
'A100' => ['#A7FFEB', '#222222'],
|
146
|
+
'A200' => ['#64FFDA', '#222222'],
|
147
|
+
'A400' => ['#1DE9B6', '#222222'],
|
148
|
+
'A700' => ['#00BFA5', '#222222']
|
149
|
+
},
|
150
|
+
# TODO green
|
151
|
+
# TODO light-green
|
152
|
+
# TODO lime
|
153
|
+
# TODO yellow
|
154
|
+
# TODO amber
|
155
|
+
# TODO orange
|
156
|
+
# TODO deep-orange
|
157
|
+
# TODO brown
|
158
|
+
# TODO grey
|
159
|
+
# TODO blue-grey
|
160
|
+
}
|
161
|
+
|
162
|
+
def self.sass_colors color, var
|
163
|
+
colors = ""
|
164
|
+
COLORS[color].each do |key, val|
|
165
|
+
colors << "$#{var}-#{key}: #{val[0]};\n"
|
166
|
+
colors << "$#{var}-#{key}-text: #{val[1]};\n"
|
167
|
+
end
|
168
|
+
return colors
|
169
|
+
end
|
170
|
+
|
171
|
+
end # module Env
|
172
|
+
|
173
|
+
end # module Schizm
|
@@ -0,0 +1,157 @@
|
|
1
|
+
require_relative 'string'
|
2
|
+
|
3
|
+
module Schizm
|
4
|
+
|
5
|
+
class Markup
|
6
|
+
|
7
|
+
def initialize tag = nil
|
8
|
+
@tag = tag
|
9
|
+
@attrs = {}
|
10
|
+
@elems = []
|
11
|
+
end
|
12
|
+
|
13
|
+
attr_reader :tag
|
14
|
+
attr_accessor :attrs
|
15
|
+
attr_accessor :elems
|
16
|
+
|
17
|
+
def [] key
|
18
|
+
return @attrs[key]
|
19
|
+
end
|
20
|
+
|
21
|
+
def []= key, value
|
22
|
+
return @attrs[key] = value
|
23
|
+
end
|
24
|
+
|
25
|
+
def has_attr? name
|
26
|
+
return @attrs.has_key? name
|
27
|
+
end
|
28
|
+
|
29
|
+
def add_attrs pairs
|
30
|
+
pairs.each do |key, value|
|
31
|
+
@attrs[key] = value
|
32
|
+
end
|
33
|
+
return self
|
34
|
+
end
|
35
|
+
|
36
|
+
def << param
|
37
|
+
case param
|
38
|
+
when nil
|
39
|
+
# Ignore silently.
|
40
|
+
when ::Array
|
41
|
+
for entry in param
|
42
|
+
self << entry
|
43
|
+
end
|
44
|
+
when ::Integer
|
45
|
+
self << '&#' << param.to_s << ';'
|
46
|
+
when ::String
|
47
|
+
target = @elems.last
|
48
|
+
target = @elems unless target.is_a? ::String
|
49
|
+
target << param
|
50
|
+
else
|
51
|
+
@elems << param
|
52
|
+
end
|
53
|
+
return self
|
54
|
+
end
|
55
|
+
|
56
|
+
def add_elems param
|
57
|
+
return self << param
|
58
|
+
end
|
59
|
+
|
60
|
+
def last
|
61
|
+
return @elems.last
|
62
|
+
end
|
63
|
+
|
64
|
+
def yield_each *tags, &block
|
65
|
+
if @tag and tags.include? @tag.to_s
|
66
|
+
yield self
|
67
|
+
end
|
68
|
+
for elem in @elems
|
69
|
+
elem.yield_each *tags, &block if elem.is_a? Markup
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def find_first_of *tags, &block
|
74
|
+
if @tag and tags.include? @tag.to_s
|
75
|
+
return self if not block or (block.call(self) == true)
|
76
|
+
end
|
77
|
+
for elem in @elems
|
78
|
+
temp = elem.find_first_of *tags, &block if elem.is_a? Markup
|
79
|
+
return temp if temp
|
80
|
+
end
|
81
|
+
nil
|
82
|
+
end
|
83
|
+
|
84
|
+
def to_plain_text
|
85
|
+
text = String.new
|
86
|
+
@elems.each do |elem|
|
87
|
+
case elem
|
88
|
+
when Markup
|
89
|
+
if elem.tag == "script" and
|
90
|
+
(elem["type"] == "math/tex; mode=inline" or
|
91
|
+
elem["type"] == "math/tex; mode=display")
|
92
|
+
temp = elem.elems[0].dump
|
93
|
+
text << String.new(temp[1..(temp.size-2)]).html
|
94
|
+
else
|
95
|
+
text << elem.to_plain_text
|
96
|
+
end
|
97
|
+
else
|
98
|
+
text << elem.to_s if elem.respond_to? :to_s
|
99
|
+
end
|
100
|
+
end
|
101
|
+
text
|
102
|
+
end
|
103
|
+
|
104
|
+
def to_s
|
105
|
+
s = String.new
|
106
|
+
unless @tag == nil
|
107
|
+
s << "<" << @tag
|
108
|
+
@attrs.each do |k, v|
|
109
|
+
if k and k.to_s != ""
|
110
|
+
s << " #{k.to_s}" if v == nil
|
111
|
+
s << " #{k.to_s}=\"#{v.to_s}\"" if v != nil and v.to_s != ""
|
112
|
+
end
|
113
|
+
end
|
114
|
+
s << ">"
|
115
|
+
end
|
116
|
+
@elems.each do |elem|
|
117
|
+
s << elem.to_s if elem.respond_to? :to_s
|
118
|
+
end
|
119
|
+
unless @tag == nil
|
120
|
+
s << "</" << @tag << ">"
|
121
|
+
end
|
122
|
+
s
|
123
|
+
end
|
124
|
+
|
125
|
+
def guess_title
|
126
|
+
elem = find_first_of "h1" do |temp|
|
127
|
+
true if temp.has_attr? "class" and temp["class"] == "title"
|
128
|
+
end
|
129
|
+
return elem.to_plain_text if elem
|
130
|
+
return ""
|
131
|
+
end
|
132
|
+
|
133
|
+
def guess_description
|
134
|
+
size = 80
|
135
|
+
elem = find_first_of "p"
|
136
|
+
text = elem.to_plain_text if elem
|
137
|
+
return text.truncate size if text
|
138
|
+
return ""
|
139
|
+
end
|
140
|
+
|
141
|
+
def guess_parts
|
142
|
+
parts = "parts:\n"
|
143
|
+
yield_each "h2" do |elem|
|
144
|
+
if elem.has_attr? "class"
|
145
|
+
if elem["class"] == "title"
|
146
|
+
parts << " -\n"
|
147
|
+
parts << " id: \"#{elem["id"]}\"\n"
|
148
|
+
parts << " title: \"#{elem.to_plain_text}\"\n"
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
parts
|
153
|
+
end
|
154
|
+
|
155
|
+
end
|
156
|
+
|
157
|
+
end
|
data/lib/schizm/match.rb
ADDED
@@ -0,0 +1,211 @@
|
|
1
|
+
module Schizm
|
2
|
+
|
3
|
+
# Header path, extension put in match group 1.
|
4
|
+
HEADER_PATH = /^.*\.(h|hh|hpp|hxx)$/
|
5
|
+
|
6
|
+
# Source path, extension put in match group 1.
|
7
|
+
SOURCE_PATH = /^.*\.(c|cc|cpp|cxx|inl|tcc)$/
|
8
|
+
|
9
|
+
# Space sequence.
|
10
|
+
SPACE = /\p{Space}+/u
|
11
|
+
|
12
|
+
# Indent level.
|
13
|
+
INDENT = /^[ ]{4}/u
|
14
|
+
|
15
|
+
# Empty line.
|
16
|
+
EMPTY_LINE = /^\n/u
|
17
|
+
|
18
|
+
# Empty lines.
|
19
|
+
EMPTY_LINES = /#{EMPTY_LINE}*/u
|
20
|
+
|
21
|
+
# Explicit end-of-block marker.
|
22
|
+
EOB_MARKER = /^\^\n/u
|
23
|
+
|
24
|
+
# Explicit or implicit end of simple block.
|
25
|
+
END_SIMPLE = /^\^?\n|\z/u
|
26
|
+
|
27
|
+
# Explicit or implicit end of indent block.
|
28
|
+
END_INDENT = /\n(?=[ ]{0,3}\p{Graph})|\z/u
|
29
|
+
|
30
|
+
# Setext heading.
|
31
|
+
HEADING_SETEXT = /^[ ]{0,3}(\p{Graph}.*)\n(===+|---+)\n/u
|
32
|
+
|
33
|
+
# Atx heading.
|
34
|
+
HEADING_ATX = /^[ ]{0,3}(\#{1,6})(.+)\n/u
|
35
|
+
|
36
|
+
# Horizontal rule.
|
37
|
+
HRULE = /^(?:\*[ ]?){3,}(?:\n|\z)/u
|
38
|
+
|
39
|
+
# 1. A character region escaped by inline code delimiters,
|
40
|
+
# 2. a character region escaped by inline math delimiters, or
|
41
|
+
# 3. a character which is not a backslash or a closing brace.
|
42
|
+
#
|
43
|
+
NOT_CLOSE_BRACE = /`(?:[^\\`]*(?:\\.)*)*`|\$(?:[^\\$]*(?:\\.)*)*\$|[^\\}]/um
|
44
|
+
|
45
|
+
# 1. A character region escaped by inline code delimiters,
|
46
|
+
# 2. a character region escaped by inline math delimiters, or
|
47
|
+
# 3. a character which is not a backslash or a closing bracket.
|
48
|
+
#
|
49
|
+
NOT_CLOSE_BRACK = /`(?:[^\\`]*(?:\\.)*)*`|\$(?:[^\\$]*(?:\\.)*)*\$|[^\\\]]/um
|
50
|
+
|
51
|
+
# 1. A character region escaped by inline code delimiters,
|
52
|
+
# 2. a character region escaped by inline math delimiters, or
|
53
|
+
# 3. a character which is not a backslash or a closing parenthesis.
|
54
|
+
#
|
55
|
+
NOT_CLOSE_PAREN = /`(?:[^\\`]*(?:\\.)*)*`|\$(?:[^\\$]*(?:\\.)*)*\$|[^\\)]/um
|
56
|
+
|
57
|
+
# Matches until an unescaped closing brace.
|
58
|
+
DELIM_BRACES = /#{NOT_CLOSE_BRACE}*(?:\\.#{NOT_CLOSE_BRACE}*)*/um
|
59
|
+
|
60
|
+
# Matches until an unescaped closing bracket.
|
61
|
+
DELIM_BRACKS = /#{NOT_CLOSE_BRACK}*(?:\\.#{NOT_CLOSE_BRACK}*)*/um
|
62
|
+
|
63
|
+
# Matches until an unescaped closing parenthesis.
|
64
|
+
DELIM_PARENS = /#{NOT_CLOSE_PAREN}*(?:\\.#{NOT_CLOSE_PAREN}*)*/um
|
65
|
+
|
66
|
+
# HTML entity.
|
67
|
+
HTML_ENTITY = /&(?:\w+|\#\d+|\#x\h+);/
|
68
|
+
|
69
|
+
# HTML special characters.
|
70
|
+
HTML_ESCAPE = /[\p{^ASCII}&<>]/u
|
71
|
+
|
72
|
+
# Character escape, put in match group 1.
|
73
|
+
CHAR_ESCAPE = /\\(.)/u
|
74
|
+
|
75
|
+
# Link definition, content put in match group 1, params put in match group 2.
|
76
|
+
LINK_DEF = /^\((#{DELIM_PARENS})\):[ ]*(.*)[ ]*\n/u
|
77
|
+
|
78
|
+
# Link reference, content put in match group 1, params put in match group 2.
|
79
|
+
LINK_REF = /\[(#{DELIM_BRACKS})\]\((#{DELIM_PARENS})\)/um
|
80
|
+
|
81
|
+
# Link params, title put in match group 1, target put in match group 2.
|
82
|
+
LINK_PARAMS = /(?:"(.+?)"[ ]+)?(.+)/um
|
83
|
+
|
84
|
+
# Center math, content put in match group 1.
|
85
|
+
CENTER_MATH = /[$][$]((?:[^\\$]*(?:\\.)*)*)[$][$]/um
|
86
|
+
|
87
|
+
# Markup attributes for +CENTER_MATH+.
|
88
|
+
CENTER_MATH_ATTRS = {'type' => 'math/tex; mode=display'}
|
89
|
+
|
90
|
+
# Inline math, content put in match group 1.
|
91
|
+
INLINE_MATH = /[$]((?:[^\\$]*(?:\\.)*)*)[$]/um
|
92
|
+
|
93
|
+
# Markup attributes for +INLINE_MATH+.
|
94
|
+
INLINE_MATH_ATTRS = {'type' => 'math/tex; mode=inline'}
|
95
|
+
|
96
|
+
# Inline code, content put in match group 1.
|
97
|
+
INLINE_CODE = /[`]((?:[^\\`]*(?:\\.)*)*)[`]/um
|
98
|
+
|
99
|
+
# Inline emphasis, depth put in match group 1, content put in match group 2.
|
100
|
+
INLINE_EMPH = /([*]+)((?:[^\\*]*(?:\\.)*)*)[*]+/um
|
101
|
+
|
102
|
+
# Inline subscript, content put in match group 1.
|
103
|
+
INLINE_SUB = /_{(#{DELIM_BRACES})}/um
|
104
|
+
|
105
|
+
# Inline superscript, content put in match group 1.
|
106
|
+
INLINE_SUP = /\^{(#{DELIM_BRACES})}/um
|
107
|
+
|
108
|
+
# Inline insert, content put in match group 1.
|
109
|
+
INLINE_INS = /\+{(#{DELIM_BRACES})}/um
|
110
|
+
|
111
|
+
# Inline delete, content put in match group 1.
|
112
|
+
INLINE_DEL = /~{(#{DELIM_BRACES})}/um
|
113
|
+
|
114
|
+
# Chunk label, content put in match group 1.
|
115
|
+
CHUNK_LABEL = /[@]\[(#{DELIM_BRACKS})\]/um
|
116
|
+
|
117
|
+
# Chunk param, content put in match group 1.
|
118
|
+
CHUNK_PARAM = /[#]\[(#{DELIM_BRACKS})\]/um
|
119
|
+
|
120
|
+
CHUNK_LABEL_WITH_PARAMS = /#{CHUNK_LABEL}#{CHUNK_PARAM}/um
|
121
|
+
|
122
|
+
# Chunk block, content put in match group 1.
|
123
|
+
CHUNK_BLOCK = /\((#{DELIM_PARENS})\)/um
|
124
|
+
|
125
|
+
# Enter quote block.
|
126
|
+
ENTER_QUOTE = /^[ ]{0,3}[>][>][>]/u
|
127
|
+
|
128
|
+
# Enter aside block.
|
129
|
+
ENTER_ASIDE = /^[ ]{0,3}[(][i][)]/u
|
130
|
+
|
131
|
+
# Enter alert block.
|
132
|
+
ENTER_ALERT = /^[ ]{0,3}[(][!][)]/u
|
133
|
+
|
134
|
+
# Enter bug block.
|
135
|
+
ENTER_BUG = /^[ ]{0,3}[(][?][)]/u
|
136
|
+
|
137
|
+
# Enter olist element.
|
138
|
+
ENTER_OLIST = /^[ ]{0,3}--[#]/u
|
139
|
+
|
140
|
+
# Enter ulist element.
|
141
|
+
ENTER_ULIST = /^[ ]{0,3}--[%]/u
|
142
|
+
|
143
|
+
# Enter tlist element, content put in match group 1.
|
144
|
+
ENTER_TLIST = /^[ ]{0,3}\[([x ])\]/u
|
145
|
+
|
146
|
+
# Enter dlist element, content put in match group 1.
|
147
|
+
ENTER_DLIST = /^[ ]{0,3}\[(#{DELIM_BRACKS})\]:/u
|
148
|
+
|
149
|
+
# Enter code block.
|
150
|
+
ENTER_CODE = /^[ ]{4,}(?=\p{Graph})/u
|
151
|
+
|
152
|
+
# Enter text block.
|
153
|
+
ENTER_TEXT = /^[ ]{0,3}(?=\p{Graph})/u
|
154
|
+
|
155
|
+
# Special ASCII sequences.
|
156
|
+
GLYPH = [
|
157
|
+
[/\(tm\)/ui, 8482], # Trademark.
|
158
|
+
[/\(c\)/ui, 9400], # Copyright.
|
159
|
+
[/\(r\)/ui, 174], # Registered.
|
160
|
+
[/\+-/u, 177], # Plus minus.
|
161
|
+
[/==/u, 8801], # Identical.
|
162
|
+
[/~=/u, 8773], # Congruent.
|
163
|
+
[/!=/u, 8800], # Not equal.
|
164
|
+
[/<=/u, 8804], # Less equal.
|
165
|
+
[/>=/u, 8805], # Greater equal.
|
166
|
+
[/~~/u, 8776], # Approximately.
|
167
|
+
[/--/u, 8211], # En dash.
|
168
|
+
[/---/u, 8212], # Em dash.
|
169
|
+
[/\.{3}/u, 8230], # Ellipsis.
|
170
|
+
[/<--/u, 8592], # Left single arrow.
|
171
|
+
[/<==/u, 8656], # Left double arrow.
|
172
|
+
[/-->/u, 8594], # Right single arrow.
|
173
|
+
[/==>/u, 8658], # Right double arrow.
|
174
|
+
[/<-->/u, 8596], # Horizontal single arrow.
|
175
|
+
[/<==>/u, 8660], # Horizontal double arrow.
|
176
|
+
[/<~~/u, 8668], # Left squiggle arrow.
|
177
|
+
[/~~>/u, 8669], # Right squiggle arrow.
|
178
|
+
[/<<--/u, 8606], # Left two headed arrow.
|
179
|
+
[/-->>/u, 8608], # Right two headed arrow.
|
180
|
+
[/<--</u, 8610], # Left arrow with tail.
|
181
|
+
[/>-->/u, 8611], # Right arrow with tail.
|
182
|
+
[/\|<--/u, 8676], # Left arrow to bar.
|
183
|
+
[/-->\|/u, 8677], # Right arrow to bar.
|
184
|
+
[/<---/u, 10229], # Left long single arrow.
|
185
|
+
[/<===/u, 10232], # Left long double arrow.
|
186
|
+
[/--->/u, 10230], # Right long single arrow.
|
187
|
+
[/===>/u, 10233], # Right long double arrow.
|
188
|
+
[/<--->/u, 10231], # Horizontal long single arrow.
|
189
|
+
[/<===>/u, 10234], # Horizontal long double arrow.
|
190
|
+
[/<---\|/u, 10235], # Left long single arrow from bar.
|
191
|
+
[/<===\|/u, 10237], # Left long double arrow from bar.
|
192
|
+
[/\|--->/u, 10236], # Right long single arrow from bar.
|
193
|
+
[/\|===>/u, 10238], # Right long double arrow from bar.
|
194
|
+
[/<-\/-/u, 8602], # Left single arrow with stroke.
|
195
|
+
[/<=\/=/u, 8653], # Left double arrow with stroke.
|
196
|
+
[/<-\|-/u, 8695], # Left single arrow with vertical bar.
|
197
|
+
[/<=\|=/u, 10498], # Left double arrow with vertical bar.
|
198
|
+
[/-\/->/u, 8603], # Right single arrow with stroke.
|
199
|
+
[/=\/=>/u, 8655], # Right double arrow with stroke.
|
200
|
+
[/-\|->/u, 8696], # Right single arrow with vertical bar.
|
201
|
+
[/=\|=>/u, 10499], # Right double arrow with vertical bar.
|
202
|
+
[/<-\/->/u, 8622], # Horizontal single arrow with stroke.
|
203
|
+
[/<-\|->/u, 8697], # Horizontal single arrow with vertical bar.
|
204
|
+
[/<=\|=>/u, 10500], # Horizontal double arrow with vertical bar.
|
205
|
+
[/<--\|/u, 8612], # Left single arrow from bar.
|
206
|
+
[/<==\|/u, 10502], # Left double arrow from bar.
|
207
|
+
[/\|-->/u, 8614], # Right single arrow from bar.
|
208
|
+
[/\|==>/u, 10503] # Right double arrow from bar.
|
209
|
+
]
|
210
|
+
|
211
|
+
end # module Schizm
|