jekyll_quote 0.4.0 → 0.4.1

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: 410dc88a139c0b1b0769b3896a644e6276f20a45ced9864a01d7f8f540a8e567
4
- data.tar.gz: 79f5d5b5963ad4f062d3fe8bd772698749025388f72f2672133fba63b83fadbd
3
+ metadata.gz: 48d683c6d402cbef996297da7355523a5708c131fc77acd797558861e83dba61
4
+ data.tar.gz: 4f0ce53ce3c39b2161d294b311ec6ea9f740a588dcc943fce0a188fecf5e82a9
5
5
  SHA512:
6
- metadata.gz: 4f3ede950a0fbfefcf9c2731948cd1a3a6b58935ad9cab8b47824a8bfeb4e97d58350c00a61ff52c2bf4ef0f4c2d8df456872015e572a02a94e59f8fbd5f2993
7
- data.tar.gz: e8449f5ea4015b67cd5726b18fb8675ec3fa21901cf6fcb661de1c4bd1c2acc0d092ce06ef13360a21bc49e264b14a54e53a8f3e5a86ad9a1e2c9167727281e0
6
+ metadata.gz: 915baf97a1e221eededdaf5cbcc6c37b60f404250b58c33915c6d2f3a01f527c1566fceabb547c2ee349b9b447e9f3fade4766ae047d5afb294958c4f671df2a
7
+ data.tar.gz: 45ddb8790cc6f9c85598e13e041036a8cbdaf14621f6fade55cea544d24db83c6d98b39f56484951d418798840995a80bab351420b965da1ffa3073c642d1ec8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.4.1 / 2023-06-09
2
+ * Added `style` and `class` options.
3
+
1
4
  ## 0.4.0 / 2023-04-05
2
5
  * Added [`attribution` support](https://github.com/mslinn/jekyll_plugin_support#subclass-attribution).
3
6
 
data/README.md CHANGED
@@ -18,13 +18,53 @@ end
18
18
 
19
19
  And then execute:
20
20
 
21
- $ bundle install
21
+ $ bundle
22
+
23
+
24
+ ## Syntax
25
+ ```
26
+ {% quote OPTIONS %}
27
+ Content of quote goes here.
28
+ {% endquote %}
29
+ ```
30
+
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.
41
+
42
+
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
+ ```
22
52
 
23
53
 
24
54
  ## Attribution
25
55
  See [`jekyll_plugin_support` for `attribution`](https://github.com/mslinn/jekyll_plugin_support#subclass-attribution)
26
56
 
27
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
+ ```
67
+
28
68
  ## Additional Information
29
69
  More information is available on
30
70
  [Mike Slinn’s website](https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html).
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/jekyll/3000-jekyll-plugins.html#jekyll_quote'
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', '~> 0.6.0'
32
+ spec.add_dependency 'jekyll_plugin_support', '>= 0.7.0'
33
33
  end
@@ -1,3 +1,3 @@
1
1
  module JekyllQuoteVersion
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.4.1'.freeze
3
3
  end
data/lib/jekyll_quote.rb CHANGED
@@ -27,25 +27,32 @@ module Jekyll
27
27
  @break = @helper.parameter_specified? 'break' # enforced by CSS if a list ends the body
28
28
  @by = @helper.parameter_specified? 'by'
29
29
  @cite = @helper.parameter_specified? 'cite'
30
+ @class = @helper.parameter_specified? 'class'
30
31
  @noprep = @helper.parameter_specified? 'noprep'
32
+ @style = @helper.parameter_specified? 'style'
31
33
  @url = @helper.parameter_specified? 'url'
32
-
33
34
  preposition = 'From'
34
35
  preposition = 'By' if @by
35
36
  preposition = '' if @noprep
36
37
  if @cite
37
- quote_attribution = if @url && !@url.empty?
38
- "<a href='#{@url}' rel='nofollow' target='_blank'>#{@cite}</a>"
39
- else
40
- "#{@cite}\n"
41
- end
38
+ cite_markup = if @url && !@url.empty?
39
+ "<a href='#{@url}' rel='nofollow' target='_blank'>#{@cite}</a>"
40
+ else
41
+ "#{@cite}\n"
42
+ end
42
43
  tag = @break ? 'div' : 'span'
43
- quote_attribution = "<#{tag} class='quoteAttribution'> &nbsp;&ndash; #{preposition} #{quote_attribution}</#{tag}>\n"
44
- text = "<div class='quoteText clearfix'>#{text}</div>" if @break
44
+ @cite_markup = "<#{tag} class='quoteAttribution'> &nbsp;&ndash; #{preposition} #{cite_markup}</#{tag}>\n"
45
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
46
53
  <<~END_HERE
47
- <div class='quote'>
48
- #{text}#{quote_attribution}
54
+ <div class='#{klass}quote'#{styling}>
55
+ #{@text}#{@cite_markup}
49
56
  #{@helper.attribute if @helper.attribution}
50
57
  </div>
51
58
  END_HERE
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.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-04-13 00:00:00.000000000 Z
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.6.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.6.0
40
+ version: 0.7.0
41
41
  description:
42
42
  email:
43
43
  - mslinn@mslinn.com
@@ -56,14 +56,14 @@ files:
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/3000-jekyll-plugins.html#jekyll_quote
59
+ homepage: https://www.mslinn.com/jekyll_plugins/jekyll_quote.html
60
60
  licenses:
61
61
  - MIT
62
62
  metadata:
63
63
  allowed_push_host: https://rubygems.org
64
64
  bug_tracker_uri: https://github.com/mslinn/jekyll_quote/issues
65
65
  changelog_uri: https://github.com/mslinn/jekyll_quote/CHANGELOG.md
66
- homepage_uri: https://www.mslinn.com/jekyll/3000-jekyll-plugins.html#jekyll_quote
66
+ homepage_uri: https://www.mslinn.com/jekyll_plugins/jekyll_quote.html
67
67
  source_code_uri: https://github.com/mslinn/jekyll_quote
68
68
  post_install_message: |2+
69
69