jekyll-wns 3.3.1 β 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -2
- data/jekyll-wns.gemspec +1 -1
- data/lib/jekyll-wns.rb +2 -0
- data/lib/jekyll-wns/assets/abbreviations.rb +6 -3
- data/lib/jekyll-wns/assets/ruby_tag.rb +21 -0
- data/lib/jekyll-wns/assets/scene_break_tag.rb +1 -1
- data/lib/jekyll-wns/register_tags.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38306cb9f707488c12823384ec74b7930cf88213f85c44dc175127e811c481fd
|
4
|
+
data.tar.gz: 327780f0d819168bc54b9b71869b4b18a4df0b07316403155d2ec0b445bb5015
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3aaba0a6bf99ac328b04d46083dcc3205feb010f60fa07eafdac95d7e2ad7d731eff4061ded3e82955f955019f59787f1e615b7b37c02d4f3914f753b225ed76
|
7
|
+
data.tar.gz: 2869712897b1038a276af2d06e3d19e45f0ba2e606dc5d735b4834f1abc4b321b23bd3226d7ceda4da978fd17e28dd562a005e7f82f0241ef0bd7ac4ab8423c3
|
data/README.md
CHANGED
@@ -4,11 +4,11 @@ A collection of filters, tags and hooks that I use on my pages.
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
1.
|
7
|
+
1. Run Μ bundle add jekyll-wns` and
|
8
8
|
2. Add the following to your site's `_config.yml`:
|
9
9
|
|
10
10
|
```yml
|
11
|
-
|
11
|
+
plugins:
|
12
12
|
- jekyll-wns
|
13
13
|
```
|
14
14
|
|
@@ -76,6 +76,24 @@ gems:
|
|
76
76
|
<p style="text-align:center" data-mce-style="text-align:center">πΏπΎπΏπΎπΏπΎπΏπΎ
|
77
77
|
```
|
78
78
|
|
79
|
+
#### Ruby Annotations
|
80
|
+
|
81
|
+
```liquid
|
82
|
+
{% ruby b|t %}
|
83
|
+
|
84
|
+
{% ruby a#b|t#s %}
|
85
|
+
|
86
|
+
{% ruby a#b#c|x#y#z %}
|
87
|
+
```
|
88
|
+
|
89
|
+
```html
|
90
|
+
<p><ruby><span class="rb first last" aria-hidden="true">b</span><rp>(</rp><rt first="" last="">t</rt><rp>)</rp></ruby></p>
|
91
|
+
|
92
|
+
<p><ruby><span class="rb first" aria-hidden="true">a</span><rp>(</rp><rt first="">t</rt><rp>)</rp><span class="rb last" aria-hidden="true">b</span><rp>(</rp><rt last="">s</rt><rp>)</rp></ruby></p>
|
93
|
+
|
94
|
+
<p><ruby><span class="rb first" aria-hidden="true">a</span><rp>(</rp><rt first="">x</rt><rp>)</rp><span class="rb" aria-hidden="true">b</span><rp>(</rp><rt>y</rt><rp>)</rp><span class="rb last" aria-hidden="true">c</span><rp>(</rp><rt last="">z</rt><rp>)</rp></ruby></p>
|
95
|
+
```
|
96
|
+
|
79
97
|
#### YouTube Embed
|
80
98
|
|
81
99
|
The following snippet should be integrated into your site for the tag to properly work:
|
data/jekyll-wns.gemspec
CHANGED
data/lib/jekyll-wns.rb
CHANGED
@@ -7,6 +7,8 @@ require_relative 'jekyll-wns/assets/quads'
|
|
7
7
|
require_relative 'jekyll-wns/assets/digest_filters'
|
8
8
|
require_relative 'jekyll-wns/assets/file_properties_filter'
|
9
9
|
require_relative 'jekyll-wns/assets/quads_filter'
|
10
|
+
|
11
|
+
require_relative 'jekyll-wns/assets/ruby_tag'
|
10
12
|
require_relative 'jekyll-wns/assets/scene_break_tag'
|
11
13
|
require_relative 'jekyll-wns/assets/youtube_tag'
|
12
14
|
|
@@ -1,7 +1,9 @@
|
|
1
1
|
module WNS
|
2
2
|
module Abbreviations
|
3
|
-
|
4
|
-
|
3
|
+
THREE_LETTER_EXPRESSION = /([a-zA-Z])\.([a-zA-Z])\.([a-zA-Z])\.(,|) /
|
4
|
+
THREE_LETTER_REPLACEMENT = "\\1. \\2. \\3.\\4 "
|
5
|
+
TWO_LETTER_EXPRESSION = /([a-zA-Z])\.([a-zA-Z])\.(,|) /
|
6
|
+
TWO_LETTER_REPLACEMENT = "\\1. \\2.\\3 "
|
5
7
|
CLEANUP_EXPRESSION = /, ([a-zA-Z]\.&)/
|
6
8
|
CLEANUP_REPLACEMENT = ", \\1"
|
7
9
|
|
@@ -12,7 +14,8 @@ module WNS
|
|
12
14
|
|
13
15
|
def self.replace_abbreviations!(doc)
|
14
16
|
if Abbreviations::enabled?(doc)
|
15
|
-
doc.content = doc.content.gsub(Abbreviations::
|
17
|
+
doc.content = doc.content.gsub(Abbreviations::THREE_LETTER_EXPRESSION, Abbreviations::THREE_LETTER_REPLACEMENT)
|
18
|
+
doc.content = doc.content.gsub(Abbreviations::TWO_LETTER_EXPRESSION, Abbreviations::TWO_LETTER_REPLACEMENT)
|
16
19
|
doc.content = doc.content.gsub(Abbreviations::CLEANUP_EXPRESSION, Abbreviations::CLEANUP_REPLACEMENT)
|
17
20
|
end
|
18
21
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module WNS
|
2
|
+
class RubyTag < Liquid::Tag
|
3
|
+
def initialize(tag_name, text, tokens)
|
4
|
+
super
|
5
|
+
|
6
|
+
@text = text.strip!.split("|")
|
7
|
+
end
|
8
|
+
|
9
|
+
def render(context)
|
10
|
+
base = @text[0].split("#")
|
11
|
+
text = @text[1].split("#")
|
12
|
+
output = "<ruby>"
|
13
|
+
i = 0
|
14
|
+
while i < base.length()
|
15
|
+
output += "<span class='rb" + (i == 0 ? " first" : "") + (i == base.length() - 1 ? " last" : "") + "' aria-hidden='true'>#{base[i]}</span><rp>(</rp><rt" + (i == 0 ? " first" : "") + (i == base.length() - 1 ? " last" : "") + ">#{text[i]}</rt><rp>)</rp>"
|
16
|
+
i += 1
|
17
|
+
end
|
18
|
+
output += "</ruby>"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -13,7 +13,7 @@ module WNS
|
|
13
13
|
when "wave"
|
14
14
|
'<p style="text-align:center;letter-spacing:-.13em" data-mce-style="text-align:center;letter-spacing:-.13em">β β‘β β‘β β‘β β‘β β‘β β‘β β‘β β‘β β‘β β‘β β</p>'
|
15
15
|
when "wall"
|
16
|
-
'<p style="text-align:center;letter-spacing:-.2em" data-mce-style="text-align:center;letter-spacing:-.2em"
|
16
|
+
'<p style="text-align:center;letter-spacing:-.2em" data-mce-style="text-align:center;letter-spacing:-.2em">ββββββββββββββββββββ</p>'
|
17
17
|
else
|
18
18
|
'<p style="text-align:center" data-mce-style="text-align:center">πΏπΎπΏπΎπΏπΎπΏπΎπΏπΎπΏπΎπΏπΎπΏ</p>'
|
19
19
|
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.
|
4
|
+
version: 3.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thai Chung
|
@@ -31,6 +31,7 @@ files:
|
|
31
31
|
- lib/jekyll-wns/assets/file_properties_filter.rb
|
32
32
|
- lib/jekyll-wns/assets/quads.rb
|
33
33
|
- lib/jekyll-wns/assets/quads_filter.rb
|
34
|
+
- lib/jekyll-wns/assets/ruby_tag.rb
|
34
35
|
- lib/jekyll-wns/assets/scene_break_tag.rb
|
35
36
|
- lib/jekyll-wns/assets/youtube_tag.rb
|
36
37
|
- lib/jekyll-wns/register_filters.rb
|