jekyll-wns 4.2.1 → 4.2.4
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: bb627baf34799ff128961bfb4951d0ad258a585d9f2055ab6778ce6c1b96bc35
|
4
|
+
data.tar.gz: 335effd443906c28d24a8deaefe4ca74374df1430d1d52810942b49ee136bcc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a373750c9f956015afb529a83c9042e0006964247b29e90c94df33af293f209c45e99ec8d226792128bf6fc595e2c91ae331e805ca4f947f13c1ef7c62b3a086
|
7
|
+
data.tar.gz: ef3de6123b8a3aa2d7a2a70dd35a1789f5fe77c886ed22f9ef625a992354858c8187a996ff7032ece5d28ec7d14bfeba30b25a772cc24cb2f178e25da283a0a3
|
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
|
@@ -11,7 +11,7 @@ module WNS
|
|
11
11
|
def self.label_unicode!(doc)
|
12
12
|
if LabelUnicode::enabled?(doc)
|
13
13
|
for i in (0..(LabelUnicode::SYMBOLS.length()) - 1) do
|
14
|
-
doc.content = doc.content.gsub(Regexp.new("(
|
14
|
+
doc.content = doc.content.gsub(Regexp.new("(\\S*)#{LabelUnicode::SYMBOLS[i].source}(\\S*)"), "<span aria-label='\\1#{LabelUnicode::READINGS[i]}\\3'>\\1\\2\\3</span>")
|
15
15
|
end
|
16
16
|
end
|
17
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
|