jekyll-plugin-rtlify 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/LICENSE +21 -0
- data/README.md +3 -0
- data/lib/rtlify.rb +22 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 549c874adaa18619e359444cc3d0364471f01cc4
|
4
|
+
data.tar.gz: f27eeb2ca20bcf71bd5b59e9ef45a0d38e804a08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05c17e6e168aa6c5867ee63560fe2bc2e2144cc80945a712540013f2f7723a74dfd3660d42e72733744b127093060f4abcfeeecb98f6aca2f420b25827e7c95d
|
7
|
+
data.tar.gz: 8c9ed1246753b3513ff85fc58600c7ec806bee1e757660a45c4d58e04f30d0f315d76ac3f463a8f2838d4902ea2f8f09e138f9da2759a4a302fe1f19f8689a6e
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Keyvan Mir Mohammad Sadeghi
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
data/lib/rtlify.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
module Jekyll
|
2
|
+
class RTLifyTag < Liquid::Tag
|
3
|
+
|
4
|
+
def initialize(tag_name, variable, tokens)
|
5
|
+
super
|
6
|
+
if match = variable.match(/{{\s*(.*)\s*}}/)
|
7
|
+
@variable, = match.captures
|
8
|
+
else
|
9
|
+
raise 'invalid variable'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def render(context)
|
14
|
+
html = context.find_variable(@variable)
|
15
|
+
tags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'ul']
|
16
|
+
tags.each { |tag| html = html.gsub(/<#{tag}/, "<#{tag} dir=\"auto\"")}
|
17
|
+
html
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
Liquid::Template.register_tag('rtlify', Jekyll::RTLifyTag)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-plugin-rtlify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keyvan Mir Mohammad Sadeghi
|
@@ -58,7 +58,11 @@ email:
|
|
58
58
|
executables: []
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
|
-
files:
|
61
|
+
files:
|
62
|
+
- Gemfile
|
63
|
+
- LICENSE
|
64
|
+
- README.md
|
65
|
+
- lib/rtlify.rb
|
62
66
|
homepage: https://github.com/woforo/jekyll-plugin-rtlify
|
63
67
|
licenses:
|
64
68
|
- MIT
|