jekyll-figure 0.0.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/test.yml +27 -0
- data/.gitignore +1 -2
- data/README.md +57 -28
- data/jekyll-figure.gemspec +3 -3
- data/lib/jekyll-figure/version.rb +1 -1
- data/lib/jekyll-figure-ref.rb +22 -0
- data/lib/jekyll-figure.rb +27 -10
- data/lib/utils.rb +47 -0
- data/spec/fixtures/_layouts/some_default.html +6 -0
- data/spec/jekyll-figure-ref_spec.rb +25 -0
- data/spec/jekyll-figure_spec.rb +38 -16
- data/spec/spec_helper.rb +3 -3
- metadata +18 -18
- data/.travis.yml +0 -14
- data/script/bootstrap +0 -3
- data/script/cibuild +0 -3
- data/script/console +0 -34
- data/script/release +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4ef02f57060db513906d950dbf708ddc1237495dd3df4ff783799fd049a908d
|
4
|
+
data.tar.gz: 46f4a6336c409de505479624196de701a22b9bd087a56939f552d24f9ffff987
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 844cd1bf4a667cf4f2fc006f8fc71d4b32c25cafadacdeab072add72c31cfd71ea07fce71f0871f6075aab42ab24a8d70213fbeb32f071b61f19caff097be094
|
7
|
+
data.tar.gz: 86e3492bcc24ab601d33362da912d227ac538282951589a0b80a72de3e08a3f6c678c5e08a1acec8cd2db94b994191fa43546b53af8b3a09bcd757761a8b4f31
|
@@ -0,0 +1,27 @@
|
|
1
|
+
name: test
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [main]
|
6
|
+
pull_request:
|
7
|
+
branches: [main]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
strategy:
|
13
|
+
matrix:
|
14
|
+
ruby: [2.6.6]
|
15
|
+
jekyll: [3.0, 4.0]
|
16
|
+
steps:
|
17
|
+
- uses: actions/checkout@v2
|
18
|
+
- name: Set up Ruby
|
19
|
+
uses: ruby/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby }}
|
22
|
+
env:
|
23
|
+
JEKYLL_VERSION: ${{ matrix.jekyll }}
|
24
|
+
- name: Install dependencies
|
25
|
+
run: bundle install
|
26
|
+
- name: Run tests
|
27
|
+
run: bundle exec rake spec
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -2,26 +2,26 @@
|
|
2
2
|
|
3
3
|
A liquid tag for Jekyll that generates `<figure>` elements.
|
4
4
|
|
5
|
-
[](https://rubygems.org/gems/jekyll-figure)
|
6
|
+
[](https://github.com/paulrobertlloyd/jekyll-figure/actions)
|
7
7
|
|
8
8
|
## Installation
|
9
9
|
|
10
10
|
1. Add `gem 'jekyll-figure'` to your site’s Gemfile and run `bundle`
|
11
11
|
2. Add the following to your site’s `_config.yml`:
|
12
12
|
|
13
|
-
|
14
13
|
```yaml
|
15
14
|
plugins:
|
16
15
|
- jekyll-figure
|
17
16
|
```
|
17
|
+
|
18
18
|
Note: If you are using a Jekyll version less than 3.5.0, use the `gems` key instead of `plugins`.
|
19
19
|
|
20
20
|
## Usage
|
21
21
|
|
22
22
|
This plugin provides a liquid tag that enables you to generate a `<figure>` element. It takes optional `caption` and `class` parameters.
|
23
23
|
|
24
|
-
```
|
24
|
+
```liquid
|
25
25
|
{% figure [caption:"Caption (markdown)"] [class:"class1 class2"] %}
|
26
26
|
Figure content (markdown)
|
27
27
|
{% endfigure %}
|
@@ -31,7 +31,7 @@ Figure content (markdown)
|
|
31
31
|
|
32
32
|
In simplest usage:
|
33
33
|
|
34
|
-
```
|
34
|
+
```liquid
|
35
35
|
{% figure %}
|
36
36
|
Content
|
37
37
|
{% endfigure %}
|
@@ -43,69 +43,98 @@ Content
|
|
43
43
|
</figure>
|
44
44
|
```
|
45
45
|
|
46
|
-
|
46
|
+
You can provide a caption, for which any markdown will be rendered:
|
47
47
|
|
48
|
-
```
|
49
|
-
{% figure %}
|
50
|
-
|
48
|
+
```liquid
|
49
|
+
{% figure caption:"*Markdown* caption" %}
|
50
|
+
Content
|
51
51
|
{% endfigure %}
|
52
52
|
```
|
53
53
|
|
54
54
|
```html
|
55
55
|
<figure>
|
56
|
-
<
|
56
|
+
<p>Content</p>
|
57
|
+
<figcaption><em>Markdown</em> caption</figcaption>
|
57
58
|
</figure>
|
58
59
|
```
|
59
60
|
|
60
|
-
You can provide a
|
61
|
+
You can also provide a class name(s) for CSS styling:
|
61
62
|
|
62
|
-
```
|
63
|
-
{% figure caption:"
|
63
|
+
```liquid
|
64
|
+
{% figure caption:"A caption" class:"classname" %}
|
64
65
|
Content
|
65
66
|
{% endfigure %}
|
66
67
|
```
|
67
68
|
|
68
69
|
```html
|
69
|
-
<figure>
|
70
|
+
<figure class="classname">
|
70
71
|
<p>Content</p>
|
71
|
-
<figcaption
|
72
|
+
<figcaption>A caption</figcaption>
|
72
73
|
</figure>
|
73
74
|
```
|
74
75
|
|
75
|
-
|
76
|
+
The `caption` parameter also accepts liquid markup:
|
76
77
|
|
77
|
-
```
|
78
|
-
{% figure caption:"
|
78
|
+
```liquid
|
79
|
+
{% figure caption:"{{ page.title }}" %}
|
79
80
|
Content
|
80
81
|
{% endfigure %}
|
81
82
|
```
|
82
83
|
|
83
84
|
```html
|
84
|
-
<figure
|
85
|
+
<figure>
|
85
86
|
<p>Content</p>
|
86
|
-
<figcaption>
|
87
|
+
<figcaption>The title of my page</figcaption>
|
87
88
|
</figure>
|
88
89
|
```
|
89
90
|
|
90
|
-
|
91
|
+
You can also add labels and reference them:
|
91
92
|
|
92
|
-
```
|
93
|
-
{% figure caption:"
|
94
|
-
|
93
|
+
```liquid
|
94
|
+
{% figure caption:"A caption." label:example %}
|
95
|
+
An example figure that can be referenced later.
|
95
96
|
{% endfigure %}
|
97
|
+
|
98
|
+
You can see an example in {% figref example %}.
|
96
99
|
```
|
97
100
|
|
101
|
+
```html
|
102
|
+
<figure id="example">
|
103
|
+
<p>An example figure that can be referenced later.</p>
|
104
|
+
<figcaption><em>Figure 1:</em> A caption.</figcaption>
|
105
|
+
</figure>
|
106
|
+
|
107
|
+
<p>You can see an example in <a href="#example">figure 1</a></p>
|
108
|
+
```
|
109
|
+
|
110
|
+
The word ‘Figure’ in the figcaption is translated according to the `lang` you set in the yaml header of your post. If your language is not supported simple set `figure` to the yaml header of your post to the value you want to use instead of ‘Figure’.
|
111
|
+
|
112
|
+
## Configuration
|
113
|
+
|
114
|
+
Any markdown provided within the `{% figure %}` block is rendered using Jekyll’s Markdown parser, [Kramdown](https://kramdown.gettalong.org). However, this means images and other content will be wrapped within `<p>` tags, like so:
|
115
|
+
|
98
116
|
```html
|
99
117
|
<figure>
|
100
|
-
<p
|
101
|
-
<figcaption>The title of my post</figcaption>
|
118
|
+
<p><img src="/path/to/image.jpg" alt="Image"></p>
|
102
119
|
</figure>
|
103
120
|
```
|
104
121
|
|
122
|
+
To disable this behaviour, in your Jekyll configuration set the `paragraphs` value for this plugin to `false`:
|
123
|
+
|
124
|
+
```yaml
|
125
|
+
plugins:
|
126
|
+
- jekyll-figure
|
127
|
+
|
128
|
+
jekyll-figure:
|
129
|
+
paragraphs: false
|
130
|
+
```
|
131
|
+
|
132
|
+
Note however that this will remove *all* paragraph tags, even those nested within other elements.
|
133
|
+
|
105
134
|
## Testing
|
106
135
|
|
107
|
-
1. `
|
108
|
-
2. `
|
136
|
+
1. `bundle install`
|
137
|
+
2. `bundle exec rake spec`
|
109
138
|
|
110
139
|
## Contributing
|
111
140
|
|
data/jekyll-figure.gemspec
CHANGED
@@ -19,8 +19,8 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_development_dependency "jekyll", [">= 3.0", "<
|
22
|
+
spec.add_development_dependency "jekyll", [">= 3.0", "< 5.0"]
|
23
23
|
spec.add_development_dependency "rspec", "~> 3.0"
|
24
|
-
spec.add_development_dependency 'rake', '~> 0'
|
25
|
-
spec.add_development_dependency "bundler", "~> 1
|
24
|
+
spec.add_development_dependency 'rake', '~> 13.0.1'
|
25
|
+
spec.add_development_dependency "bundler", "~> 2.1"
|
26
26
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'utils'
|
2
|
+
|
3
|
+
module Jekyll
|
4
|
+
module Figure
|
5
|
+
|
6
|
+
class FigRefTag < Liquid::Tag
|
7
|
+
include Utils
|
8
|
+
|
9
|
+
def initialize(tag_name, markup, tokens)
|
10
|
+
@label = markup
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
def render(context)
|
15
|
+
@context = context
|
16
|
+
print_reference(@label)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
Liquid::Template.register_tag("figref", Jekyll::Figure::FigRefTag)
|
data/lib/jekyll-figure.rb
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
+
require 'utils'
|
2
|
+
require 'jekyll-figure-ref'
|
3
|
+
|
1
4
|
module Jekyll
|
2
5
|
module Figure
|
3
6
|
|
4
7
|
class FigureTag < Liquid::Block
|
8
|
+
include Utils
|
9
|
+
|
5
10
|
def initialize(tag_name, markup, tokens)
|
6
11
|
@markup = markup
|
7
12
|
super
|
@@ -21,31 +26,43 @@ module Jekyll
|
|
21
26
|
attributes[key] = value
|
22
27
|
end
|
23
28
|
|
24
|
-
@
|
25
|
-
@
|
29
|
+
@settings = site.config["jekyll-figure"]
|
30
|
+
@caption = attributes["caption"]
|
31
|
+
@class = attributes["class"]
|
32
|
+
@label = attributes["label"]
|
33
|
+
@context = context
|
26
34
|
|
27
35
|
# Caption: convert markdown and remove paragraphs
|
28
36
|
unless @caption.nil?
|
29
|
-
figure_caption = @caption.gsub!(/\A"|"\Z/,
|
30
|
-
figure_caption = converter.convert(figure_caption).gsub(/<\/?p[^>]*>/,
|
37
|
+
figure_caption = @caption.gsub!(/\A"|"\Z/, "")
|
38
|
+
figure_caption = converter.convert(figure_caption).gsub(/<\/?p[^>]*>/, "").chomp
|
39
|
+
figure_caption = print_figure_counter(@label) + figure_caption unless @label.nil? || @label.empty?
|
31
40
|
figure_caption = " <figcaption>#{figure_caption}</figcaption>\n"
|
32
41
|
end
|
33
42
|
|
34
43
|
# Class name(s)
|
35
44
|
unless @class.nil?
|
36
|
-
figure_class = @class.gsub!(/\A"|"\Z/,
|
45
|
+
figure_class = @class.gsub!(/\A"|"\Z/, "")
|
37
46
|
figure_class = " class\=\"#{figure_class}\""
|
38
47
|
end
|
39
48
|
|
40
|
-
|
41
|
-
|
49
|
+
figure_label = @label.nil? || @label.empty? ? "" : ' id="' + @label.gsub(/A"|"\Z/, "") + '"'
|
50
|
+
|
51
|
+
# Content
|
52
|
+
if @settings && @settings["paragraphs"] == false
|
53
|
+
# Strip paragraphs
|
54
|
+
figure_main = converter.convert(super(context)).gsub(/<\/?p[^>]*>/, "")
|
55
|
+
else
|
56
|
+
# Don't strip paragraphs
|
57
|
+
figure_main = converter.convert(super(context))
|
58
|
+
end
|
42
59
|
|
43
60
|
# Used to escape markdown parsing rendering
|
44
61
|
markdown_escape = "\ "
|
45
62
|
|
46
63
|
# Render <figure>
|
47
|
-
figure_tag = "<figure#{figure_class}>"
|
48
|
-
figure_tag += "#{figure_main}
|
64
|
+
figure_tag = "<figure#{figure_class}#{figure_label}>"
|
65
|
+
figure_tag += "#{figure_main}"
|
49
66
|
figure_tag += "#{figure_caption}"
|
50
67
|
figure_tag += "</figure>"
|
51
68
|
end
|
@@ -54,4 +71,4 @@ module Jekyll
|
|
54
71
|
end
|
55
72
|
end
|
56
73
|
|
57
|
-
Liquid::Template.register_tag(
|
74
|
+
Liquid::Template.register_tag("figure", Jekyll::Figure::FigureTag)
|
data/lib/utils.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
module Jekyll
|
2
|
+
module Figure
|
3
|
+
module Utils
|
4
|
+
|
5
|
+
class I18n
|
6
|
+
@figure_i18n = {'en' => "Figure",
|
7
|
+
'de' => "Abbildung",
|
8
|
+
'sv' => "Figur",
|
9
|
+
'fr' => "Figure"}
|
10
|
+
def self.figure(lang)
|
11
|
+
return @figure_i18n[lang] if @figure_i18n.key?(lang)
|
12
|
+
@figure_i18n['en']
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def lang
|
17
|
+
return @context.registers[:page]["lang"].to_s if @context.registers[:page].key?("lang")
|
18
|
+
"en".to_s
|
19
|
+
end
|
20
|
+
|
21
|
+
def figure
|
22
|
+
return @context.registers[:page]["figure"].to_s if @context.registers[:page].key?("figure")
|
23
|
+
I18n.figure(lang)
|
24
|
+
end
|
25
|
+
|
26
|
+
def print_figure_counter(label)
|
27
|
+
label.gsub!(/\s/, '')
|
28
|
+
@context.registers[:page]["figure_labels"] ||= {}
|
29
|
+
|
30
|
+
if @context.registers[:page]["figure_labels"].key?(label)
|
31
|
+
value = @context.registers[:page]["figure_labels"][label]
|
32
|
+
else
|
33
|
+
value = @context.registers[:page]["figure_labels"].length + 1
|
34
|
+
@context.registers[:page]["figure_labels"][label] = value
|
35
|
+
end
|
36
|
+
"<em>" + figure + " " + value.to_s + ":</em> "
|
37
|
+
end
|
38
|
+
|
39
|
+
def print_reference(label)
|
40
|
+
label.gsub!(/\s/, '')
|
41
|
+
"<a href=\"\##{label.to_s}\">" + figure.downcase + " " +
|
42
|
+
@context.registers[:page]["figure_labels"][label.to_s].to_s +
|
43
|
+
"</a>"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe(Jekyll) do
|
4
|
+
Jekyll.logger.log_level = :error
|
5
|
+
|
6
|
+
let(:config_overrides) { {} }
|
7
|
+
let(:config) do
|
8
|
+
Jekyll.configuration(
|
9
|
+
config_overrides.merge(
|
10
|
+
"source" => source_dir,
|
11
|
+
"destination" => dest_dir,
|
12
|
+
"url" => "http://example.org",
|
13
|
+
)
|
14
|
+
)
|
15
|
+
end
|
16
|
+
let(:site) { Jekyll::Site.new(config) }
|
17
|
+
let(:contents) { File.read(dest_dir("index.html")) }
|
18
|
+
before(:each) do
|
19
|
+
site.process
|
20
|
+
end
|
21
|
+
|
22
|
+
it "creates a figref element" do
|
23
|
+
expect(contents).to match /See <a href="#example">figure 1<\/a>/
|
24
|
+
end
|
25
|
+
end
|
data/spec/jekyll-figure_spec.rb
CHANGED
@@ -1,39 +1,61 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe(Jekyll) do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
"destination" => dest_dir,
|
8
|
-
"url" => "http://example.org",
|
9
|
-
}
|
10
|
-
end
|
4
|
+
Jekyll.logger.log_level = :error
|
5
|
+
|
6
|
+
let(:config_overrides) { {} }
|
11
7
|
let(:config) do
|
12
|
-
Jekyll.configuration(
|
13
|
-
|
14
|
-
|
8
|
+
Jekyll.configuration(
|
9
|
+
config_overrides.merge(
|
10
|
+
"source" => source_dir,
|
11
|
+
"destination" => dest_dir,
|
12
|
+
"url" => "http://example.org",
|
13
|
+
)
|
14
|
+
)
|
15
|
+
end
|
16
|
+
let(:site) { Jekyll::Site.new(config) }
|
15
17
|
let(:contents) { File.read(dest_dir("index.html")) }
|
16
18
|
before(:each) do
|
17
19
|
site.process
|
18
20
|
end
|
19
21
|
|
20
22
|
it "creates a figure element" do
|
21
|
-
expect(contents).to match /<figure>\n
|
23
|
+
expect(contents).to match /<figure>\n<p>Content<\/p>\n<\/figure>/
|
22
24
|
end
|
23
25
|
|
24
26
|
it "creates a figure element with image content" do
|
25
|
-
expect(contents).to match /<figure>\n
|
27
|
+
expect(contents).to match /<figure>\n<p><img src="#" alt="Image" \/><\/p>\n<\/figure>/
|
26
28
|
end
|
27
29
|
|
28
30
|
it "creates a figure element with caption" do
|
29
|
-
expect(contents).to match /<figure>\n
|
31
|
+
expect(contents).to match /<figure>\n<p>Content<\/p>\n <figcaption>A caption<\/figcaption>\n<\/figure>/
|
30
32
|
end
|
31
33
|
|
32
34
|
it "creates a figure element with caption and class name" do
|
33
|
-
expect(contents).to match /<figure>\n
|
35
|
+
expect(contents).to match /<figure>\n<p><strong>Markdown<\/strong> content<\/p>\n <figcaption><em>Markdown<\/em> content<\/figcaption>\n<\/figure>/
|
34
36
|
end
|
35
37
|
|
36
38
|
it "creates a figure element with liquid variable for caption" do
|
37
|
-
expect(contents).to match /<figure>\n
|
39
|
+
expect(contents).to match /<figure>\n<p>Content<\/p>\n <figcaption>Page data<\/figcaption>\n<\/figure>/
|
40
|
+
end
|
41
|
+
|
42
|
+
it "creates a figure element with caption and label" do
|
43
|
+
expect(contents).to match /<figure id="example">\n<p>Content<\/p>\n <figcaption><em>Figure 1:<\/em> A caption<\/figcaption>\n<\/figure>/
|
44
|
+
end
|
45
|
+
|
46
|
+
context "with paragraphs stripped" do
|
47
|
+
let(:config_overrides) do
|
48
|
+
{
|
49
|
+
"jekyll-figure" => { "paragraphs" => false },
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
it "creates a figure element" do
|
54
|
+
expect(contents).to match /<figure>\nContent\n<\/figure>/
|
55
|
+
end
|
56
|
+
|
57
|
+
it "creates a figure element with image content" do
|
58
|
+
expect(contents).to match /<figure>\n<img src="#" alt="Image" \/>\n<\/figure>/
|
59
|
+
end
|
38
60
|
end
|
39
61
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
require
|
2
|
-
require File.expand_path(
|
1
|
+
require "jekyll"
|
2
|
+
require File.expand_path("../lib/jekyll-figure", File.dirname(__FILE__))
|
3
3
|
|
4
4
|
Jekyll.logger.log_level = :error
|
5
5
|
|
6
6
|
RSpec.configure do |config|
|
7
7
|
config.run_all_when_everything_filtered = true
|
8
8
|
config.filter_run :focus
|
9
|
-
config.order =
|
9
|
+
config.order = "random"
|
10
10
|
|
11
11
|
SOURCE_DIR = File.expand_path("../fixtures", __FILE__)
|
12
12
|
DEST_DIR = File.expand_path("../dest", __FILE__)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-figure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Robert Lloyd
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '3.0'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '5.0'
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '3.0'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '5.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rspec
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,57 +50,57 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
53
|
+
version: 13.0.1
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
60
|
+
version: 13.0.1
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: bundler
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '1
|
67
|
+
version: '2.1'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '1
|
74
|
+
version: '2.1'
|
75
75
|
description: A liquid tag for Jekyll that generates <figure> elements.
|
76
76
|
email: me+rubygems@paulrobertlloyd.com
|
77
77
|
executables: []
|
78
78
|
extensions: []
|
79
79
|
extra_rdoc_files: []
|
80
80
|
files:
|
81
|
+
- ".github/dependabot.yml"
|
82
|
+
- ".github/workflows/test.yml"
|
81
83
|
- ".gitignore"
|
82
|
-
- ".travis.yml"
|
83
84
|
- Gemfile
|
84
85
|
- LICENSE
|
85
86
|
- README.md
|
86
87
|
- Rakefile
|
87
88
|
- jekyll-figure.gemspec
|
89
|
+
- lib/jekyll-figure-ref.rb
|
88
90
|
- lib/jekyll-figure.rb
|
89
91
|
- lib/jekyll-figure/version.rb
|
90
|
-
-
|
91
|
-
- script/cibuild
|
92
|
-
- script/console
|
93
|
-
- script/release
|
92
|
+
- lib/utils.rb
|
94
93
|
- spec/fixtures/_config.yml
|
95
94
|
- spec/fixtures/_layouts/some_default.html
|
96
95
|
- spec/fixtures/index.html
|
96
|
+
- spec/jekyll-figure-ref_spec.rb
|
97
97
|
- spec/jekyll-figure_spec.rb
|
98
98
|
- spec/spec_helper.rb
|
99
99
|
homepage: https://github.com/paulrobertlloyd/jekyll-figure
|
100
100
|
licenses:
|
101
101
|
- MIT
|
102
102
|
metadata: {}
|
103
|
-
post_install_message:
|
103
|
+
post_install_message:
|
104
104
|
rdoc_options: []
|
105
105
|
require_paths:
|
106
106
|
- lib
|
@@ -115,14 +115,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
|
-
|
119
|
-
|
120
|
-
signing_key:
|
118
|
+
rubygems_version: 3.3.7
|
119
|
+
signing_key:
|
121
120
|
specification_version: 4
|
122
121
|
summary: Jekyll plugin that generates <figure> elements.
|
123
122
|
test_files:
|
124
123
|
- spec/fixtures/_config.yml
|
125
124
|
- spec/fixtures/_layouts/some_default.html
|
126
125
|
- spec/fixtures/index.html
|
126
|
+
- spec/jekyll-figure-ref_spec.rb
|
127
127
|
- spec/jekyll-figure_spec.rb
|
128
128
|
- spec/spec_helper.rb
|
data/.travis.yml
DELETED
data/script/bootstrap
DELETED
data/script/cibuild
DELETED
data/script/console
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
#! /usr/bin/env ruby
|
2
|
-
|
3
|
-
def relative_to_root(path)
|
4
|
-
File.expand_path(path, File.dirname(File.dirname(__FILE__)))
|
5
|
-
end
|
6
|
-
|
7
|
-
require 'jekyll'
|
8
|
-
require relative_to_root('lib/jekyll-figure.rb')
|
9
|
-
require 'pry-debugger'
|
10
|
-
|
11
|
-
SOURCE_DIR = relative_to_root('spec/fixtures')
|
12
|
-
DEST_DIR = relative_to_root('spec/dest')
|
13
|
-
|
14
|
-
def source_dir(*files)
|
15
|
-
File.join(SOURCE_DIR, *files)
|
16
|
-
end
|
17
|
-
|
18
|
-
def dest_dir(*files)
|
19
|
-
File.join(DEST_DIR, *files)
|
20
|
-
end
|
21
|
-
|
22
|
-
def config(overrides = {})
|
23
|
-
Jekyll.configuration({
|
24
|
-
"source" => source_dir,
|
25
|
-
"destination" => dest_dir,
|
26
|
-
"url" => "http://example.org"
|
27
|
-
}).merge(overrides)
|
28
|
-
end
|
29
|
-
|
30
|
-
def site(configuration = config)
|
31
|
-
Jekyll::Site.new(configuration)
|
32
|
-
end
|
33
|
-
|
34
|
-
binding.pry
|