jekyll_quote 0.3.1 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -2
- data/CHANGELOG.md +6 -0
- data/README.md +44 -11
- data/jekyll_quote.gemspec +2 -2
- data/lib/jekyll_quote/version.rb +1 -1
- data/lib/jekyll_quote.rb +17 -7
- data/spec/status_persistence.txt +6 -0
- metadata +10 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48d683c6d402cbef996297da7355523a5708c131fc77acd797558861e83dba61
|
4
|
+
data.tar.gz: 4f0ce53ce3c39b2161d294b311ec6ea9f740a588dcc943fce0a188fecf5e82a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 915baf97a1e221eededdaf5cbcc6c37b60f404250b58c33915c6d2f3a01f527c1566fceabb547c2ee349b9b447e9f3fade4766ae047d5afb294958c4f671df2a
|
7
|
+
data.tar.gz: 45ddb8790cc6f9c85598e13e041036a8cbdaf14621f6fade55cea544d24db83c6d98b39f56484951d418798840995a80bab351420b965da1ffa3073c642d1ec8
|
data/.rubocop.yml
CHANGED
@@ -28,8 +28,7 @@ Layout/InitialIndentation:
|
|
28
28
|
|
29
29
|
Layout/HashAlignment:
|
30
30
|
EnforcedColonStyle: table
|
31
|
-
|
32
|
-
- jekyll_quote.gemspec
|
31
|
+
EnforcedHashRocketStyle: table
|
33
32
|
|
34
33
|
Layout/LineLength:
|
35
34
|
Max: 150
|
@@ -41,6 +40,9 @@ Lint/RedundantCopDisableDirective:
|
|
41
40
|
Exclude:
|
42
41
|
- jekyll_quote.gemspec
|
43
42
|
|
43
|
+
Metrics/AbcSize:
|
44
|
+
Max: 25
|
45
|
+
|
44
46
|
Metrics/BlockLength:
|
45
47
|
Exclude:
|
46
48
|
- jekyll_quote.gemspec
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -8,8 +8,7 @@ See [demo/index.html](demo/index.html) for examples.
|
|
8
8
|
|
9
9
|
|
10
10
|
## Installation
|
11
|
-
|
12
|
-
Add this line to your Jekyll project's Gemfile, within the `jekyll_plugins` group:
|
11
|
+
Add the following line to your Jekyll project's Gemfile, within the `jekyll_plugins` group:
|
13
12
|
|
14
13
|
```ruby
|
15
14
|
group :jekyll_plugins do
|
@@ -17,20 +16,54 @@ group :jekyll_plugins do
|
|
17
16
|
end
|
18
17
|
```
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
And then execute:
|
20
|
+
|
21
|
+
$ bundle
|
22
|
+
|
23
|
+
|
24
|
+
## Syntax
|
25
|
+
```
|
26
|
+
{% quote OPTIONS %}
|
27
|
+
Content of quote goes here.
|
28
|
+
{% endquote %}
|
24
29
|
```
|
25
30
|
|
26
|
-
|
31
|
+
The default preposition is 'From'.
|
32
|
+
|
33
|
+
OPTIONS are:
|
34
|
+
* `break` – Put the citation on a separate line. Ignored if `cite` was not specified.
|
35
|
+
* `by` – Preface the citation with the preposition 'By'. Ignored if `cite` was not specified.
|
36
|
+
* `cite` – Citation text
|
37
|
+
* `class` – Apply additional CSS classes
|
38
|
+
* `noprep` – Do not preface the citation with a preposition. Ignored if `cite` was not specified.
|
39
|
+
* `style` – Apply additional CSS styling
|
40
|
+
* `url` – URL for the citation. Ignored if `cite` was not specified.
|
27
41
|
|
28
|
-
$ bundle install
|
29
42
|
|
30
|
-
|
43
|
+
## Usage Example
|
44
|
+
```
|
45
|
+
{% quote cite="Blaise Pascal, in Lettres provinciales"
|
46
|
+
url="https://en.wikipedia.org/wiki/Lettres_provinciales"
|
47
|
+
%}
|
48
|
+
I have only made this letter longer because
|
49
|
+
I have not had the time to make it shorter.
|
50
|
+
{% endquote %}
|
51
|
+
```
|
52
|
+
|
53
|
+
|
54
|
+
## Attribution
|
55
|
+
See [`jekyll_plugin_support` for `attribution`](https://github.com/mslinn/jekyll_plugin_support#subclass-attribution)
|
31
56
|
|
32
|
-
$ gem install jekyll_quote
|
33
57
|
|
58
|
+
## Demo
|
59
|
+
A demo / test website is provided in the `demo` directory.
|
60
|
+
It can be used to debug the plugin or to run freely.
|
61
|
+
Please examine the HTML files in the demo to see how the plugin works.
|
62
|
+
|
63
|
+
To run the demo freely from the command line, type:
|
64
|
+
```
|
65
|
+
$ demo/_bin/debug -r
|
66
|
+
```
|
34
67
|
|
35
68
|
## Additional Information
|
36
69
|
More information is available on
|
@@ -66,7 +99,7 @@ jekyll_quote (0.1.0)
|
|
66
99
|
Generates Jekyll logger with colored output.
|
67
100
|
```
|
68
101
|
|
69
|
-
###
|
102
|
+
### Demo
|
70
103
|
Examine the output by running:
|
71
104
|
```shell
|
72
105
|
$ demo/_bin/debug -r
|
data/jekyll_quote.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
7
7
|
spec.authors = ['Mike Slinn']
|
8
8
|
spec.email = ['mslinn@mslinn.com']
|
9
9
|
spec.files = Dir['.rubocop.yml', 'LICENSE.*', 'Rakefile', '{lib,spec}/**/*', '*.gemspec', '*.md']
|
10
|
-
spec.homepage = 'https://www.mslinn.com/
|
10
|
+
spec.homepage = 'https://www.mslinn.com/jekyll_plugins/jekyll_quote.html'
|
11
11
|
spec.license = 'MIT'
|
12
12
|
spec.metadata = {
|
13
13
|
'allowed_push_host' => 'https://rubygems.org',
|
@@ -29,5 +29,5 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
29
29
|
spec.version = JekyllQuoteVersion::VERSION
|
30
30
|
|
31
31
|
spec.add_dependency 'jekyll', '>= 3.5.0'
|
32
|
-
spec.add_dependency 'jekyll_plugin_support', '
|
32
|
+
spec.add_dependency 'jekyll_plugin_support', '>= 0.7.0'
|
33
33
|
end
|
data/lib/jekyll_quote/version.rb
CHANGED
data/lib/jekyll_quote.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'jekyll_plugin_support'
|
2
|
-
require '
|
2
|
+
require 'jekyll_plugin_helper'
|
3
3
|
require_relative 'jekyll_quote/version'
|
4
4
|
|
5
5
|
# @author Copyright 2022 Michael Slinn
|
@@ -22,28 +22,38 @@ module Jekyll
|
|
22
22
|
include JekyllQuoteVersion
|
23
23
|
|
24
24
|
def render_impl(text)
|
25
|
+
@helper.gem_file __FILE__ # This enables plugin attribution
|
26
|
+
|
25
27
|
@break = @helper.parameter_specified? 'break' # enforced by CSS if a list ends the body
|
26
28
|
@by = @helper.parameter_specified? 'by'
|
27
29
|
@cite = @helper.parameter_specified? 'cite'
|
30
|
+
@class = @helper.parameter_specified? 'class'
|
28
31
|
@noprep = @helper.parameter_specified? 'noprep'
|
32
|
+
@style = @helper.parameter_specified? 'style'
|
29
33
|
@url = @helper.parameter_specified? 'url'
|
30
|
-
|
31
34
|
preposition = 'From'
|
32
35
|
preposition = 'By' if @by
|
33
36
|
preposition = '' if @noprep
|
34
37
|
if @cite
|
35
|
-
|
38
|
+
cite_markup = if @url && !@url.empty?
|
36
39
|
"<a href='#{@url}' rel='nofollow' target='_blank'>#{@cite}</a>"
|
37
40
|
else
|
38
41
|
"#{@cite}\n"
|
39
42
|
end
|
40
43
|
tag = @break ? 'div' : 'span'
|
41
|
-
|
42
|
-
text = "<div class='quoteText clearfix'>#{text}</div>" if @break
|
44
|
+
@cite_markup = "<#{tag} class='quoteAttribution'> – #{preposition} #{cite_markup}</#{tag}>\n"
|
43
45
|
end
|
46
|
+
@text = @break ? "<div class='quoteText clearfix'>#{text}</div>" : text
|
47
|
+
output
|
48
|
+
end
|
49
|
+
|
50
|
+
def output
|
51
|
+
klass = "#{@class} " if @class
|
52
|
+
styling = " style='#{@style}'" if @style
|
44
53
|
<<~END_HERE
|
45
|
-
<div class='quote'>
|
46
|
-
#{text}#{
|
54
|
+
<div class='#{klass}quote'#{styling}>
|
55
|
+
#{@text}#{@cite_markup}
|
56
|
+
#{@helper.attribute if @helper.attribution}
|
47
57
|
</div>
|
48
58
|
END_HERE
|
49
59
|
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
example_id | status | run_time |
|
2
|
+
-------------------------------- | ------ | --------------- |
|
3
|
+
./spec/jekyll_quote_spec.rb[1:1] | failed | 0.01849 seconds |
|
4
|
+
./spec/jekyll_quote_spec.rb[1:2] | failed | 0.00035 seconds |
|
5
|
+
./spec/jekyll_quote_spec.rb[1:3] | failed | 0.00018 seconds |
|
6
|
+
./spec/jekyll_quote_spec.rb[1:4] | failed | 0.00009 seconds |
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll_quote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Slinn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: jekyll_plugin_support
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.7.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.7.0
|
41
41
|
description:
|
42
42
|
email:
|
43
43
|
- mslinn@mslinn.com
|
@@ -55,14 +55,15 @@ files:
|
|
55
55
|
- lib/jekyll_quote/version.rb
|
56
56
|
- spec/jekyll_quote_spec.rb
|
57
57
|
- spec/spec_helper.rb
|
58
|
-
|
58
|
+
- spec/status_persistence.txt
|
59
|
+
homepage: https://www.mslinn.com/jekyll_plugins/jekyll_quote.html
|
59
60
|
licenses:
|
60
61
|
- MIT
|
61
62
|
metadata:
|
62
63
|
allowed_push_host: https://rubygems.org
|
63
64
|
bug_tracker_uri: https://github.com/mslinn/jekyll_quote/issues
|
64
65
|
changelog_uri: https://github.com/mslinn/jekyll_quote/CHANGELOG.md
|
65
|
-
homepage_uri: https://www.mslinn.com/
|
66
|
+
homepage_uri: https://www.mslinn.com/jekyll_plugins/jekyll_quote.html
|
66
67
|
source_code_uri: https://github.com/mslinn/jekyll_quote
|
67
68
|
post_install_message: |2+
|
68
69
|
|
@@ -89,4 +90,5 @@ summary: Provides a Jekyll filter that creates formatted quotes.
|
|
89
90
|
test_files:
|
90
91
|
- spec/jekyll_quote_spec.rb
|
91
92
|
- spec/spec_helper.rb
|
93
|
+
- spec/status_persistence.txt
|
92
94
|
...
|