jekyll-wns 4.2.2 → 4.2.5
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/label_pronounciation.rb +5 -7
- data/lib/jekyll-wns/register_hooks.rb +3 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4f1cda838daed7f4d7a31f3bd9b8d4f375e0ea2ec7d650bbb178574e19867d1
|
4
|
+
data.tar.gz: 34313ef55bdce009a6b7ea55d3954b274159921e6a3961c3f700a905c5baff49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c15c3b9a8f5daedb9c658c9ffd84d4404baff3fc3f352e92dc059019ea077ccb990d41f34006fd5ab36de94059840c6d08aafea9053c1cd1dd58374c2d896f61
|
7
|
+
data.tar.gz: 431dd444a0319cac151a9c3add92689a99ab2851953f2c186a4d9b18981972068bd89a1c36ac48eb9813c1f62fccb3461d272127a4aba49ddcb82213fcb35b53
|
data/jekyll-wns.gemspec
CHANGED
@@ -7,13 +7,11 @@ module WNS
|
|
7
7
|
labels.length > 0
|
8
8
|
end
|
9
9
|
|
10
|
-
def self.
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
doc.content = doc.content.gsub(Regexp.new("\b(#{labels[i]["term"]})\b"), "<span aria-label='#{labels[i]["pronounciation"]}'>\\1</span>")
|
16
|
-
end
|
10
|
+
def self.label_pronounciation!(doc)
|
11
|
+
wns = doc.site.config["wns"] || {}
|
12
|
+
labels = wns["label_pronounciation"] || false
|
13
|
+
for i in (0..(labels.length()) - 1) do
|
14
|
+
doc.content = doc.content.gsub(Regexp.new("\b(#{labels[i]["term"]})\b"), "<span aria-label='#{labels[i]["pronounciation"]}'>\\1</span>")
|
17
15
|
end
|
18
16
|
end
|
19
17
|
end
|
@@ -2,24 +2,23 @@ Jekyll::Hooks.register :pages, :pre_render do |document|
|
|
2
2
|
if document.path =~ /(.md|.html)/
|
3
3
|
WNS::Abbreviations::replace_abbreviations! document
|
4
4
|
WNS::LabelUnicode::label_unicode! document
|
5
|
-
WNS::LabelPronounciation::
|
5
|
+
WNS::LabelPronounciation::label_pronounciation! document
|
6
6
|
WNS::Quads::insert_quads_into_document! document
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
10
|
Jekyll::Hooks.register :pages, :post_render do |document|
|
11
11
|
if document.path =~ /(.md|.html)/
|
12
|
-
|
12
|
+
WNS::LabelPronounciation::label_pronounciation! document
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
16
|
Jekyll::Hooks.register :posts, :pre_render do |document|
|
17
17
|
WNS::Abbreviations::replace_abbreviations! document
|
18
18
|
WNS::LabelUnicode::label_unicode! document
|
19
|
-
WNS::LabelPronounciation::label_unicode! document
|
20
19
|
WNS::Quads::insert_quads_into_document! document
|
21
20
|
end
|
22
21
|
|
23
22
|
Jekyll::Hooks.register :posts, :post_render do |document|
|
24
|
-
|
23
|
+
WNS::LabelPronounciation::label_pronounciation! document
|
25
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-wns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thai Chung
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-mp3info
|