jekyll-html 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +24 -24
- data/.rubocop.yml +8 -0
- data/.travis.yml +5 -2
- data/Gemfile +7 -5
- data/LICENSE +21 -21
- data/README.md +6 -6
- data/Rakefile +12 -10
- data/jekyll-html.gemspec +24 -21
- data/lib/jekyll-html.rb +23 -25
- data/lib/jekyll-html/end_tag.rb +9 -11
- data/lib/jekyll-html/start_tag.rb +9 -11
- data/lib/jekyll-html/version.rb +7 -0
- data/script/cibuild +6 -0
- data/script/fmt +11 -0
- data/script/release +7 -0
- metadata +26 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd9d9fe272f49637d75ecf1b0640b0fbab6cb7083029ae5cf272de0b087815a7
|
4
|
+
data.tar.gz: 652ad949a3d5cccaf81b4e7347e9b5a90735b70e28d5944a694f604fb1b100e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e86f1af00e2fc74832cebf24dce84a89f93aa9b8d5fc9114e77c8c6f33e7807923c0ceb7685d8f1f2078d1680eb1e7c8e796b136f7399069744ee5dad241ebd0
|
7
|
+
data.tar.gz: 4601a42005570d86f550e49d2338f385268dbfb885d3a6f249c4ddbaad02a38c9180b9076ef0536d33a0b327bdecec6797148bb1f82b28b6e5d46324687572a5
|
data/.gitignore
CHANGED
@@ -1,24 +1,24 @@
|
|
1
|
-
*.gem
|
2
|
-
*.swp
|
3
|
-
*~
|
4
|
-
.DS_Store
|
5
|
-
.analysis
|
6
|
-
.bundle/
|
7
|
-
.byebug_history
|
8
|
-
.jekyll-metadata
|
9
|
-
.ruby-gemset
|
10
|
-
.ruby-version
|
11
|
-
.sass-cache
|
12
|
-
/test/source/file_name.txt
|
13
|
-
/vendor
|
14
|
-
Gemfile.lock
|
15
|
-
_site/
|
16
|
-
.idea/
|
17
|
-
bin/
|
18
|
-
bbin/
|
19
|
-
coverage
|
20
|
-
gh-pages/
|
21
|
-
pkg/
|
22
|
-
site/_site/
|
23
|
-
test/dest
|
24
|
-
tmp/*
|
1
|
+
*.gem
|
2
|
+
*.swp
|
3
|
+
*~
|
4
|
+
.DS_Store
|
5
|
+
.analysis
|
6
|
+
.bundle/
|
7
|
+
.byebug_history
|
8
|
+
.jekyll-metadata
|
9
|
+
.ruby-gemset
|
10
|
+
.ruby-version
|
11
|
+
.sass-cache
|
12
|
+
/test/source/file_name.txt
|
13
|
+
/vendor
|
14
|
+
Gemfile.lock
|
15
|
+
_site/
|
16
|
+
.idea/
|
17
|
+
bin/
|
18
|
+
bbin/
|
19
|
+
coverage
|
20
|
+
gh-pages/
|
21
|
+
pkg/
|
22
|
+
site/_site/
|
23
|
+
test/dest
|
24
|
+
tmp/*
|
data/.rubocop.yml
ADDED
data/.travis.yml
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
sudo: false
|
2
2
|
language: ruby
|
3
3
|
|
4
|
-
before_install:
|
5
|
-
|
4
|
+
before_install: gem update --system
|
5
|
+
before_script: bundle update
|
6
|
+
|
7
|
+
script: script/cibuild
|
6
8
|
|
7
9
|
matrix:
|
8
10
|
include:
|
11
|
+
- rvm: 2.6.0-preview1
|
9
12
|
- rvm: 2.5.0
|
10
13
|
- rvm: 2.4.3
|
11
14
|
- rvm: 2.3.6
|
data/Gemfile
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
6
|
+
|
7
|
+
gemspec
|
data/LICENSE
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2017-present Kacper Duras
|
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.
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017-present Kacper Duras
|
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
CHANGED
@@ -23,15 +23,15 @@ $ gem install jekyll-html
|
|
23
23
|
|
24
24
|
Input:
|
25
25
|
```
|
26
|
-
{%
|
26
|
+
{% st p %}
|
27
27
|
Example text
|
28
|
-
{%
|
28
|
+
{% et p %}
|
29
29
|
|
30
|
-
{%
|
31
|
-
{%
|
30
|
+
{% st div class=test_class %}
|
31
|
+
{% et p class=test_class %}
|
32
32
|
Example text
|
33
|
-
{%
|
34
|
-
{%
|
33
|
+
{% et p class=test_class %}
|
34
|
+
{% et div %}
|
35
35
|
```
|
36
36
|
|
37
37
|
Output:
|
data/Rakefile
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
t.
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rake/testtask"
|
5
|
+
|
6
|
+
Rake::TestTask.new(:test) do |t|
|
7
|
+
t.libs << "test"
|
8
|
+
t.libs << "lib"
|
9
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
10
|
+
end
|
11
|
+
|
12
|
+
task :default => :test
|
data/jekyll-html.gemspec
CHANGED
@@ -1,38 +1,41 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path("../lib", __FILE__)
|
2
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require "jekyll-html/version"
|
3
6
|
|
4
7
|
Gem::Specification.new do |spec|
|
5
|
-
spec.name =
|
6
|
-
spec.version =
|
7
|
-
spec.authors = [
|
8
|
-
spec.email = [
|
8
|
+
spec.name = "jekyll-html"
|
9
|
+
spec.version = Jekyll::HTML::VERSION
|
10
|
+
spec.authors = ["Kacper Duras"]
|
11
|
+
spec.email = ["git@kacperduras.pl"]
|
9
12
|
|
10
|
-
spec.summary =
|
11
|
-
spec.homepage =
|
12
|
-
spec.license =
|
13
|
+
spec.summary = "A Jekyll plugin to use HTML tags in Jekyll pages, posts and collections."
|
14
|
+
spec.homepage = "https://github.com/kacperduras/jekyll-html"
|
15
|
+
spec.license = "MIT"
|
13
16
|
|
14
17
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
15
18
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
16
19
|
if spec.respond_to?(:metadata)
|
17
|
-
spec.metadata[
|
20
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
18
21
|
else
|
19
|
-
raise
|
20
|
-
|
22
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
23
|
+
"public gem pushes."
|
21
24
|
end
|
22
25
|
|
23
|
-
spec.required_ruby_version =
|
26
|
+
spec.required_ruby_version = ">= 2.2"
|
24
27
|
|
25
28
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
26
|
-
f.match(%r
|
29
|
+
f.match(%r!^(test|spec|features)/!)
|
27
30
|
end
|
28
|
-
spec.bindir =
|
29
|
-
spec.executables = spec.files.grep(%r
|
30
|
-
spec.require_paths = [
|
31
|
-
|
32
|
-
spec.add_dependency 'jekyll', '~> 3.7.0'
|
31
|
+
spec.bindir = "exe"
|
32
|
+
spec.executables = spec.files.grep(%r!^exe/!) { |f| File.basename(f) }
|
33
|
+
spec.require_paths = ["lib"]
|
33
34
|
|
34
|
-
spec.
|
35
|
+
spec.add_dependency "jekyll", "~> 3.7.3"
|
35
36
|
|
36
|
-
spec.add_development_dependency
|
37
|
-
spec.add_development_dependency
|
37
|
+
spec.add_development_dependency "bundler", "~> 1.16.1"
|
38
|
+
spec.add_development_dependency "minitest", "~> 5.11.3"
|
39
|
+
spec.add_development_dependency "rake", "~> 12.3"
|
40
|
+
spec.add_development_dependency "rubocop", "~> 0.52.0"
|
38
41
|
end
|
data/lib/jekyll-html.rb
CHANGED
@@ -1,33 +1,33 @@
|
|
1
|
-
|
2
|
-
require 'liquid'
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
4
|
-
require
|
5
|
-
require
|
3
|
+
require "jekyll"
|
4
|
+
require "liquid"
|
6
5
|
|
7
|
-
|
6
|
+
require "jekyll-html/start_tag"
|
7
|
+
require "jekyll-html/end_tag"
|
8
8
|
|
9
|
-
|
9
|
+
module Jekyll
|
10
|
+
module HTML
|
10
11
|
|
11
12
|
class << self
|
12
|
-
|
13
13
|
def generate_start_tag(tag_content)
|
14
|
-
raise(
|
15
|
-
raise(
|
14
|
+
raise("Tag content cannot be null!") if tag_content.nil?
|
15
|
+
raise("Tag content cannot be empty!") if tag_content.empty?
|
16
16
|
|
17
|
-
content = tag_content.split(
|
18
|
-
raise(
|
17
|
+
content = tag_content.split(" ")
|
18
|
+
raise("Splitted content cannot be empty!") if content.empty?
|
19
19
|
|
20
|
-
result =
|
20
|
+
result = ""
|
21
21
|
|
22
22
|
content.each do |target|
|
23
|
-
|
24
|
-
if
|
25
|
-
result += target +
|
23
|
+
target_content = target.split("=")
|
24
|
+
if target_content.length != 2
|
25
|
+
result += target + " "
|
26
26
|
next
|
27
27
|
end
|
28
28
|
|
29
|
-
key =
|
30
|
-
value =
|
29
|
+
key = target_content[0]
|
30
|
+
value = target_content[1].tr("_", " ")
|
31
31
|
|
32
32
|
result += "#{key}=\"#{value}\"\""
|
33
33
|
end
|
@@ -36,20 +36,18 @@ module Jekyll
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def generate_end_tag(tag_content)
|
39
|
-
raise(
|
40
|
-
raise(
|
39
|
+
raise("Tag content cannot be null!") if tag_content.nil?
|
40
|
+
raise("Tag content cannot be empty!") if tag_content.empty?
|
41
41
|
|
42
|
-
content = tag_content.split(
|
43
|
-
raise(
|
42
|
+
content = tag_content.split(" ")
|
43
|
+
raise("Splitted content cannot be empty!") if content.empty?
|
44
44
|
|
45
45
|
"</#{content[0]}>"
|
46
46
|
end
|
47
|
-
|
48
47
|
end
|
49
48
|
|
50
49
|
end
|
51
|
-
|
52
50
|
end
|
53
51
|
|
54
|
-
Liquid::Template.register_tag(
|
55
|
-
Liquid::Template.register_tag(
|
52
|
+
Liquid::Template.register_tag("st", Jekyll::HTML::StartTag)
|
53
|
+
Liquid::Template.register_tag("et", Jekyll::HTML::EndTag)
|
data/lib/jekyll-html/end_tag.rb
CHANGED
@@ -1,24 +1,22 @@
|
|
1
|
-
|
2
|
-
require 'liquid'
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
4
|
-
require
|
3
|
+
require "jekyll"
|
4
|
+
require "liquid"
|
5
5
|
|
6
|
-
|
6
|
+
require "jekyll-html"
|
7
7
|
|
8
|
-
|
8
|
+
module Jekyll
|
9
|
+
module HTML
|
9
10
|
|
10
11
|
class EndTag < Liquid::Tag
|
11
|
-
|
12
|
-
|
13
|
-
@context = txt.nil? || txt.empty? ? '' : txt
|
12
|
+
def initialize(_tag_name, txt, _tokens)
|
13
|
+
@context = txt.nil? || txt.empty? ? "" : txt
|
14
14
|
end
|
15
15
|
|
16
|
-
def render(
|
16
|
+
def render(_context)
|
17
17
|
Jekyll::Html.generate_end_tag(@context)
|
18
18
|
end
|
19
|
-
|
20
19
|
end
|
21
20
|
|
22
21
|
end
|
23
|
-
|
24
22
|
end
|
@@ -1,24 +1,22 @@
|
|
1
|
-
|
2
|
-
require 'liquid'
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
4
|
-
require
|
3
|
+
require "jekyll"
|
4
|
+
require "liquid"
|
5
5
|
|
6
|
-
|
6
|
+
require "jekyll-html"
|
7
7
|
|
8
|
-
|
8
|
+
module Jekyll
|
9
|
+
module HTML
|
9
10
|
|
10
11
|
class StartTag < Liquid::Tag
|
11
|
-
|
12
|
-
|
13
|
-
@context = txt.nil? || txt.empty? ? '' : txt
|
12
|
+
def initialize(_tag_name, txt, _tokens)
|
13
|
+
@context = txt.nil? || txt.empty? ? "" : txt
|
14
14
|
end
|
15
15
|
|
16
|
-
def render(
|
16
|
+
def render(_context)
|
17
17
|
Jekyll::Html.generate_start_tag(@context)
|
18
18
|
end
|
19
|
-
|
20
19
|
end
|
21
20
|
|
22
21
|
end
|
23
|
-
|
24
22
|
end
|
data/script/cibuild
ADDED
data/script/fmt
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# Lint Ruby according to Jekyll's conventions
|
3
|
+
set -e
|
4
|
+
|
5
|
+
echo "Rubocop $(bundle exec rubocop --version)"
|
6
|
+
bundle exec rubocop -S -D -E $@
|
7
|
+
success=$?
|
8
|
+
if ((success != 0)); then
|
9
|
+
echo -e "\nTry running \`script/fmt -a\` to automatically fix errors"
|
10
|
+
fi
|
11
|
+
exit $success
|
data/script/release
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kacper Duras
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.7.
|
19
|
+
version: 3.7.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.7.
|
26
|
+
version: 3.7.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 1.16.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 5.11.3
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 5.11.3
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rake
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,19 +67,19 @@ dependencies:
|
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '12.3'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
70
|
+
name: rubocop
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
73
|
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
75
|
+
version: 0.52.0
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
82
|
+
version: 0.52.0
|
69
83
|
description:
|
70
84
|
email:
|
71
85
|
- git@kacperduras.pl
|
@@ -74,6 +88,7 @@ extensions: []
|
|
74
88
|
extra_rdoc_files: []
|
75
89
|
files:
|
76
90
|
- ".gitignore"
|
91
|
+
- ".rubocop.yml"
|
77
92
|
- ".travis.yml"
|
78
93
|
- Gemfile
|
79
94
|
- LICENSE
|
@@ -85,6 +100,10 @@ files:
|
|
85
100
|
- lib/jekyll-html.rb
|
86
101
|
- lib/jekyll-html/end_tag.rb
|
87
102
|
- lib/jekyll-html/start_tag.rb
|
103
|
+
- lib/jekyll-html/version.rb
|
104
|
+
- script/cibuild
|
105
|
+
- script/fmt
|
106
|
+
- script/release
|
88
107
|
homepage: https://github.com/kacperduras/jekyll-html
|
89
108
|
licenses:
|
90
109
|
- MIT
|