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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0351f261c69b6656bf1d298ce16dfb717d5c52986a5cf56ca7855346fb72dca
4
- data.tar.gz: fb3675d3b79af34e0c5468e0713d42e673016fa6d6a143b4bbd41421222fdc54
3
+ metadata.gz: 38306cb9f707488c12823384ec74b7930cf88213f85c44dc175127e811c481fd
4
+ data.tar.gz: 327780f0d819168bc54b9b71869b4b18a4df0b07316403155d2ec0b445bb5015
5
5
  SHA512:
6
- metadata.gz: a836a9f9c7aa948d35ad2028488de9ab0cdc87b54b7d577891db98eadd85d01cbd7d54aa53f910d7c3a8c508de11085e08303f7f3d287c831b03f8e4dcd9d85b
7
- data.tar.gz: 6e7f9eb5905b628a8686ecce3b6667f0ecddf3fca96b67c9dd4b6400088556d40659c872c2796927d6e12374e32560413c2886b28b2ca68de4ebdba382d6b049
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. Add `gem "jekyll-wns", git: "https://github.com/0xReki/jekyll-wns.git, branch: "main"` to your site's Gemfile and run `bundle`
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
- gems:
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "jekyll-wns"
5
- spec.version = "3.3.1"
5
+ spec.version = "3.4.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."
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
- MAIN_EXPRESSION = /([a-zA-Z])\.([a-zA-Z])\.(,|) /
4
- MAIN_REPLACEMENT = "\\1.&#8239;\\2.\\3&nbsp;"
3
+ THREE_LETTER_EXPRESSION = /([a-zA-Z])\.([a-zA-Z])\.([a-zA-Z])\.(,|) /
4
+ THREE_LETTER_REPLACEMENT = "\\1.&#8239;\\2.&#8239;\\3.\\4&nbsp;"
5
+ TWO_LETTER_EXPRESSION = /([a-zA-Z])\.([a-zA-Z])\.(,|) /
6
+ TWO_LETTER_REPLACEMENT = "\\1.&#8239;\\2.\\3&nbsp;"
5
7
  CLEANUP_EXPRESSION = /, ([a-zA-Z]\.&)/
6
8
  CLEANUP_REPLACEMENT = ",&nbsp;\\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::MAIN_EXPRESSION, Abbreviations::MAIN_REPLACEMENT)
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">β€ŽβšŽβ€βšβ€ŽβšŽβšβ€ŽβšŽβšβ€ŽβšŽβšβ€ŽβšŽβšβ€ŽβšŽβšβ€ŽβšŽβšβ€ŽβšŽβšβ€ŽβšŽβšβ€ŽβšŽβšβ€ŽβšŽ</p>'
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
@@ -1,2 +1,3 @@
1
1
  Liquid::Template.register_tag('scene_break', WNS::SceneBreakTag)
2
2
  Liquid::Template.register_tag('youtube', WNS::YoutubeTag)
3
+ Liquid::Template.register_tag('ruby', WNS::RubyTag)
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.3.1
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