jekyll-spaceship 0.9.6 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf1f9c38de511a38ca120048c76fa129f9052acb224eed310ceaada9e94421a0
|
4
|
+
data.tar.gz: 7fb2cf77d779023e060d25950e0edf466b6e23e7b30994fba8a656239cd6c100
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 412b791444ca4a08219a8d9e8099ab3f695e435466d27bd7810c368bf6dfe2039cfc5c2275af04db3495cd7d06547283ed49d30a613884fa0a10b65f55a841ea
|
7
|
+
data.tar.gz: e399f4b1175694f91b00c1504b6ecb89dc43799ff77f600962f2ebbf45043708fc7c82bb3bbfb4728738e6ccf202a6d1be4b260f8e10b52b24523180f8f2ef1a
|
@@ -5,7 +5,6 @@ module Jekyll::Spaceship
|
|
5
5
|
CONFIG_NAME = 'jekyll-spaceship'
|
6
6
|
DEFAULT_CONFIG = {
|
7
7
|
'processors' => [
|
8
|
-
'cache-processor',
|
9
8
|
'table-processor',
|
10
9
|
'mathjax-processor',
|
11
10
|
'plantuml-processor',
|
@@ -65,10 +64,7 @@ module Jekyll::Spaceship
|
|
65
64
|
def self.load_config
|
66
65
|
# post load site config for `group :jekyll_plugin`
|
67
66
|
Jekyll::Hooks.register :site, :after_init do |site|
|
68
|
-
# load config
|
69
67
|
self.load(site.config)
|
70
|
-
# dispatch site after_init event
|
71
|
-
Manager.dispatch(site, :site, :after_init)
|
72
68
|
end
|
73
69
|
end
|
74
70
|
end
|
@@ -14,7 +14,6 @@ module Jekyll::Spaceship
|
|
14
14
|
container = _register.first
|
15
15
|
events = _register.last.uniq
|
16
16
|
events = events.select do |event|
|
17
|
-
next true if event.match(/^after/)
|
18
17
|
next true if event.match(/^post/)
|
19
18
|
next events.index(event.to_s.gsub(/^pre/, 'post').to_sym).nil?
|
20
19
|
end
|
@@ -60,25 +59,21 @@ module Jekyll::Spaceship
|
|
60
59
|
def self.dispatch(page, container, event)
|
61
60
|
@@_processors.each do |processor|
|
62
61
|
processor.dispatch page, container, event
|
63
|
-
break unless processor.next?
|
64
62
|
end
|
65
63
|
if event.to_s.start_with?('post') and Type.html? output_ext(page)
|
66
64
|
self.dispatch_html_block(page)
|
67
65
|
end
|
68
66
|
@@_processors.each do |processor|
|
69
67
|
processor.on_handled if processor.handled
|
70
|
-
break unless processor.next?
|
71
68
|
end
|
72
69
|
end
|
73
70
|
|
74
71
|
def self.ext(page)
|
75
|
-
return unless page.respond_to? :path
|
76
72
|
ext = page.path.match(/\.[^.]+$/)
|
77
73
|
ext.to_s.rstrip
|
78
74
|
end
|
79
75
|
|
80
76
|
def self.output_ext(page)
|
81
|
-
return unless page.respond_to? :url_placeholders
|
82
77
|
page.url_placeholders[:output_ext]
|
83
78
|
end
|
84
79
|
|
@@ -90,10 +90,6 @@ module Jekyll::Spaceship
|
|
90
90
|
def self.config
|
91
91
|
end
|
92
92
|
|
93
|
-
def next?
|
94
|
-
true
|
95
|
-
end
|
96
|
-
|
97
93
|
def process?
|
98
94
|
Type.html?(output_ext) or Type.markdown?(ext)
|
99
95
|
end
|
@@ -198,20 +194,6 @@ module Jekyll::Spaceship
|
|
198
194
|
content
|
199
195
|
end
|
200
196
|
|
201
|
-
def get_exclusion(id)
|
202
|
-
result = nil
|
203
|
-
match_data = id.match /<!JEKYLL@(.+)@(.+)>/
|
204
|
-
unless match_data.nil?
|
205
|
-
id = match_data[2].to_i
|
206
|
-
result = {
|
207
|
-
:id => id,
|
208
|
-
:marker => match_data[0],
|
209
|
-
:content => @exclusion_store[id]
|
210
|
-
}
|
211
|
-
end
|
212
|
-
result
|
213
|
-
end
|
214
|
-
|
215
197
|
def self.escape_html(content)
|
216
198
|
# escape link
|
217
199
|
content.scan(/((https?:)?\/\/\S+\?[a-zA-Z0-9%\-_=\.&;]+)/) do |result|
|
@@ -255,31 +237,5 @@ module Jekyll::Spaceship
|
|
255
237
|
"<img class=\"#{css_class}\" src=\"#{body}\">"
|
256
238
|
end
|
257
239
|
end
|
258
|
-
|
259
|
-
def self.handle_bang_link(
|
260
|
-
content,
|
261
|
-
url = '(https?:)?\\/\\/.*',
|
262
|
-
title = '("(.*)".*){0,1}',
|
263
|
-
&block
|
264
|
-
)
|
265
|
-
# pre-handle reference-style links
|
266
|
-
regex = /(\[(.*)\]:\s*(#{url}\s*#{title}))/
|
267
|
-
content.scan regex do |match_data|
|
268
|
-
match = match_data[0]
|
269
|
-
ref_name = match_data[1]
|
270
|
-
ref_value = match_data[2]
|
271
|
-
content = content.gsub(match, '')
|
272
|
-
.gsub(/\!\[(.*)\]\s*\[#{ref_name}\]/,
|
273
|
-
"![\1](#{ref_value})")
|
274
|
-
end
|
275
|
-
|
276
|
-
# handle inline-style links
|
277
|
-
regex = /(\!\[(.*)\]\(.*#{url}\s*#{title}\))/
|
278
|
-
content.scan regex do |match_data|
|
279
|
-
url = match_data[2]
|
280
|
-
title = match_data[6]
|
281
|
-
block.call(url, title)
|
282
|
-
end
|
283
|
-
end
|
284
240
|
end
|
285
241
|
end
|
@@ -35,6 +35,8 @@ module Jekyll::Spaceship
|
|
35
35
|
patterns['include'].each do |pattern|
|
36
36
|
content.scan(pattern) do |result|
|
37
37
|
expr = result[0]
|
38
|
+
body = result[1]
|
39
|
+
next if body.size.zero?
|
38
40
|
is_excluded = false
|
39
41
|
patterns['exclude'].each do |pe|
|
40
42
|
break is_excluded = true if expr.match(/#{pe}/)
|
@@ -42,6 +44,7 @@ module Jekyll::Spaceship
|
|
42
44
|
next if is_excluded
|
43
45
|
escaped_expr = expr
|
44
46
|
.gsub(/(?<!^)\\(?!\S$)/, '\\\\\\\\')
|
47
|
+
.gsub(/(?<!\\)\$/, '\\\$')
|
45
48
|
.gsub(/\\ /, '\\\\\\ ')
|
46
49
|
content = content.gsub(expr, escaped_expr)
|
47
50
|
end
|
@@ -89,7 +92,7 @@ module Jekyll::Spaceship
|
|
89
92
|
r&.each do |i|
|
90
93
|
btag = Regexp.escape(i[0])
|
91
94
|
etag = Regexp.escape(i[1])
|
92
|
-
patterns <<= /((?<!\\\\)#{btag}
|
95
|
+
patterns <<= /((?<!\\\\)#{btag}(.*?)(?<!\\\\)#{etag})/
|
93
96
|
end
|
94
97
|
end
|
95
98
|
end
|
@@ -118,6 +121,8 @@ module Jekyll::Spaceship
|
|
118
121
|
# check normal mathjax expression
|
119
122
|
node.content.scan(pattern) do |result|
|
120
123
|
expr = result[0]
|
124
|
+
body = result[1]
|
125
|
+
next if body.size.zero?
|
121
126
|
is_excluded = false
|
122
127
|
patterns['exclude'].each do |pe|
|
123
128
|
break is_excluded = true if expr.match(/#{pe}/)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-spaceship
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jeffreytse
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -114,7 +114,7 @@ dependencies:
|
|
114
114
|
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '3.0'
|
117
|
-
description:
|
117
|
+
description:
|
118
118
|
email:
|
119
119
|
- jeffreytse.mail@gmail.com
|
120
120
|
executables: []
|
@@ -155,7 +155,7 @@ homepage: https://github.com/jeffreytse/jekyll-spaceship
|
|
155
155
|
licenses:
|
156
156
|
- MIT
|
157
157
|
metadata: {}
|
158
|
-
post_install_message:
|
158
|
+
post_install_message:
|
159
159
|
rdoc_options: []
|
160
160
|
require_paths:
|
161
161
|
- lib
|
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
171
|
version: '0'
|
172
172
|
requirements: []
|
173
173
|
rubygems_version: 3.0.8
|
174
|
-
signing_key:
|
174
|
+
signing_key:
|
175
175
|
specification_version: 4
|
176
176
|
summary: A Jekyll plugin to provide powerful supports for table, mathjax, plantuml,
|
177
177
|
mermaid, emoji, video, audio, youtube, vimeo, dailymotion, spotify, soundcloud,
|