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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2fb3df193ce350ac996fb965a707f559129757461ab977c79fac36d3bb93c65d
4
- data.tar.gz: 674a53eb066831f36a133492d5603b1f2fd3536de775bab6059b4e32083b0e45
3
+ metadata.gz: ce4a530aaa64925e4fe89a2318439175152879194a2a6d2b84d607937ddd0e29
4
+ data.tar.gz: 3fea0f81407034716ae7b995907f270a36b372b22b7bd6b9530148a2b8decc4f
5
5
  SHA512:
6
- metadata.gz: a919817f3c9f3f7fc8655f8e6cf1e3cd85f6b37219fef19ee5805fb2716ea1e9ffe7e3f7cbbdd3e40ac3fc90ac8c2756dd162e81680da1eb51e67117db469130
7
- data.tar.gz: ec283dbe5c4dee47b38412edb829d112404ce2ac9286a9cc80019e9591f549c151fde25747f2f4ae26f32c19c94a1c29e519a43193013661f3dbabab226ed4f1
6
+ metadata.gz: 5024b3b8ad0bdcfd5bf6d67e04bf3911b33e328d92cb12c3777c7aad6fc0d7cea0e05ef2e1f85325dcb444b7a1eb7dd4f5e4b718e53837e1eb9bca9f27e872f3
7
+ data.tar.gz: 4907863579a24fbd276ec75efe74fe06e24edc518255eb397bff24dc3de712d12dc2db313fa93a5dd2542c14ce80c53cfaca61e9f37233e424db3e414cf192cc
data/jekyll-wns.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "jekyll-wns"
5
- spec.version = "3.1.4"
5
+ spec.version = "3.2.0"
6
6
  spec.authors = ["Thai Chung"]
7
7
  spec.email = ["mail@0xReki.de"]
8
8
  spec.summary = "Collection of Filters, Tags and Hooks I use."
@@ -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 quads(input)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-wns
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.4
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thai Chung