jekyll-wns 3.1.4 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/jekyll-wns.gemspec +1 -1
- data/lib/jekyll-wns/assets/abbreviations.rb +2 -2
- data/lib/jekyll-wns/assets/quads.rb +6 -2
- data/lib/jekyll-wns/register_hooks.rb +3 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce4a530aaa64925e4fe89a2318439175152879194a2a6d2b84d607937ddd0e29
|
4
|
+
data.tar.gz: 3fea0f81407034716ae7b995907f270a36b372b22b7bd6b9530148a2b8decc4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5024b3b8ad0bdcfd5bf6d67e04bf3911b33e328d92cb12c3777c7aad6fc0d7cea0e05ef2e1f85325dcb444b7a1eb7dd4f5e4b718e53837e1eb9bca9f27e872f3
|
7
|
+
data.tar.gz: 4907863579a24fbd276ec75efe74fe06e24edc518255eb397bff24dc3de712d12dc2db313fa93a5dd2542c14ce80c53cfaca61e9f37233e424db3e414cf192cc
|
data/jekyll-wns.gemspec
CHANGED
@@ -5,12 +5,12 @@ module WNS
|
|
5
5
|
CLEANUP_EXPRESSION = /, ([a-zA-Z]\.&)/
|
6
6
|
CLEANUP_REPLACEMENT = ", \\1"
|
7
7
|
|
8
|
-
def enabled?(doc)
|
8
|
+
def self.enabled?(doc)
|
9
9
|
wns = doc.site.config["wns"] || {}
|
10
10
|
wns["abbreviations"] || false
|
11
11
|
end
|
12
12
|
|
13
|
-
def replace_abbreviations!(doc)
|
13
|
+
def self.replace_abbreviations!(doc)
|
14
14
|
if Abbreviations::enabled?(doc)
|
15
15
|
doc.content = doc.content.gsub(Abbreviations::MAIN_EXPRESSION, Abbreviations::MAIN_REPLACEMENT)
|
16
16
|
doc.content = doc.content.gsub(Abbreviations::CLEANUP_EXPRESSION, Abbreviations::CLEANUP_REPLACEMENT)
|
@@ -5,14 +5,18 @@ module WNS
|
|
5
5
|
CLEANUP_EXPRESSION = / ( |> )*/
|
6
6
|
CLEANUP_REPLACEMENT = " "
|
7
7
|
|
8
|
-
def enabled?(doc)
|
8
|
+
def self.enabled?(doc)
|
9
9
|
wns = doc.site.config["wns"] || {}
|
10
10
|
quads = wns["quads"] || false
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
13
|
+
def self.insert_quads(input)
|
14
14
|
output = input.gsub(MAIN_EXPRESSION, MAIN_REPLACEMENT)
|
15
15
|
output = output.gsub(CLEANUP_EXPRESSION, CLEANUP_REPLACEMENT)
|
16
16
|
end
|
17
|
+
|
18
|
+
def self.insert_quads_into_document!(doc)
|
19
|
+
doc.content = insert_quads doc.content
|
20
|
+
end
|
17
21
|
end
|
18
22
|
end
|
@@ -1,11 +1,14 @@
|
|
1
1
|
Jekyll::Hooks.register :documents, :pre_render do |document|
|
2
2
|
WNS::Abbreviations::replace_abbreviations! document
|
3
|
+
WNS::Quads::insert_quads_into_document! document
|
3
4
|
end
|
4
5
|
|
5
6
|
Jekyll::Hooks.register :pages, :pre_render do |document|
|
6
7
|
WNS::Abbreviations::replace_abbreviations! document
|
8
|
+
WNS::Quads::insert_quads_into_document! document
|
7
9
|
end
|
8
10
|
|
9
11
|
Jekyll::Hooks.register :posts, :pre_render do |document|
|
10
12
|
WNS::Abbreviations::replace_abbreviations! document
|
13
|
+
WNS::Quads::insert_quads_into_document! document
|
11
14
|
end
|