jekyll_pre 1.3.0 → 1.3.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: bc048288e5f189d4519766b6db9a8807d6f41b4193be5fcd7ea7d39ed1af4a7b
4
- data.tar.gz: 356f768bba6d1bbdb4abe52394a75e6aa387257b4fd1c58d7f9775324382ac6f
3
+ metadata.gz: 16aa76dad7fdc41eac063227ee8463e9bcb77dd1c9893840e05f22a67c08aef0
4
+ data.tar.gz: 9e550133932e9b422a30bdccb813dd0c603870bac9bbb08489256a92be9d27ce
5
5
  SHA512:
6
- metadata.gz: 5e0833a721b44a3f9078d9ae76a70152d516469bb6062424366c3a7dc1171fe78a9407d6195e5ba5ae728224f78a278cff2f8fb145d94c5bc9346bf75bc44435
7
- data.tar.gz: ff46960e6cfd7fd339e9d835e2bcaf0934d29dc7bb14bcf860208ced8bfab349f6bd680ac9b5cab7b426d4af5f0ae1dc10758181e24327e645cbeb0a323f8d63
6
+ metadata.gz: 8f87a17e7dff740d917a248323822a491559ac3bc3223ca4af7a62c261ca213be8f82f61577b7278112534b0ed5af597f01242fba0ba9adb9158a27425893ffa
7
+ data.tar.gz: 1227a44360aae2c913a005223c28e0ef1f3a788e43e7acb0973f960fbc618846d587754e9944f15884f184f73b9ed2bd913eeedc1273ee186e694deef31e5fc5
data/.rubocop.yml CHANGED
@@ -20,7 +20,8 @@ Gemspec/RequireMFA:
20
20
  Enabled: false
21
21
 
22
22
  Layout/HashAlignment:
23
- Enabled: false
23
+ EnforcedColonStyle: table
24
+ EnforcedHashRocketStyle: table
24
25
 
25
26
  Layout/LineLength:
26
27
  Max: 150
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 1.3.1
2
+ * Generates outer `div` with `jekyll_pre` class, like this:
3
+ ```html
4
+ <div class="jekyll_pre">
5
+ ... HTML generated by previous versions of `pre` tag here
6
+ </div>
7
+ ```
8
+ * Added `wrapper_class` and `wrapper_style` name/value options.
9
+
1
10
  ## 1.3.0
2
11
  * Updated to `jekyll_plugin_support` v0.6.0 for attribution support.
3
12
 
data/README.md CHANGED
@@ -47,14 +47,16 @@ This Jekyll plugin provides 3 new Liquid tags that work together:
47
47
 
48
48
  - `cd="relative/or/absolute/directory"` - Change to specified directory before executing shell command.
49
49
  Environment variables in the directory path will be expanded.
50
- - `no_escape` – Do not HTML escape the result of running the shell command.
51
- - `no_strip` – Do not remove leading and trailing whitespace from the result.
52
50
  - `die_if_nonzero` – Set `false` to treat non-zero return codes as non-fatal.
53
51
  Instead of terminating Jekyll with an error message,
54
52
  the message will be displayed as an error by the Jekyll logger,
55
53
  and a red message will appear in place of the result on the web page.
56
54
  - `die_if_error` – Set `false` to treat exceptions generated by this plugin as non-fatal.
57
55
  Instead of terminating Jekyll with an error message, the message will be displayed as an error by the Jekyll logger.
56
+ - `no_escape` – Do not HTML escape the result of running the shell command.
57
+ - `no_strip` – Do not remove leading and trailing whitespace from the result.
58
+ - `wrapper_class` class applied to outer `div`.
59
+ - `wrapper_style` style applied to outer `div`.
58
60
 
59
61
 
60
62
  ## CSS
data/lib/exec_tag.rb CHANGED
@@ -29,7 +29,8 @@ module ExecTag
29
29
  rescue PreError => e
30
30
  raise PreError, e.message, []
31
31
  rescue StandardError => e
32
- msg = self.class.remove_html_tags(e.message) + " from executing '#{@original_command}' on line #{@line_number} (after front matter) of #{@page['path']}"
32
+ msg = self.class.remove_html_tags(e.message) +
33
+ " from executing '#{@original_command}' on line #{@line_number} (after front matter) of #{@page['path']}"
33
34
  raise PreError, msg.red, [] if @die_if_error
34
35
  end
35
36
 
@@ -87,7 +88,8 @@ module ExecTag
87
88
  @child_status = $CHILD_STATUS
88
89
  result
89
90
  rescue StandardError => e
90
- msg = self.class.remove_html_tags(e.message) + " from executing '#{@original_command}' on line #{@line_number} (after front matter) of #{@page['path']}"
91
+ msg = self.class.remove_html_tags(e.message) +
92
+ " from executing '#{@original_command}' on line #{@line_number} (after front matter) of #{@page['path']}"
91
93
  raise PreError, msg.red, [] if @die_if_error
92
94
  ensure
93
95
  @child_status = $CHILD_STATUS
@@ -1,3 +1,3 @@
1
1
  module JekyllPreVersion
2
- VERSION = '1.3.0'.freeze
2
+ VERSION = '1.3.1'.freeze
3
3
  end
data/lib/pre_tag_block.rb CHANGED
@@ -35,14 +35,21 @@ module PreTagBlock
35
35
  text.strip!
36
36
  @helper.gem_file __FILE__ # Enables plugin attribution
37
37
 
38
- @clear = @helper.parameter_specified? 'clear'
39
38
  @class = @helper.parameter_specified? 'class'
39
+ @clear = @helper.parameter_specified? 'clear'
40
+ @dark = ' dark' if @helper.parameter_specified? 'dark'
40
41
  @highlight = @helper.parameter_specified? 'highlight'
42
+ @label = @helper.parameter_specified? 'label'
41
43
  @make_copy_button = @helper.parameter_specified? 'copyButton'
42
44
  @number_lines = @helper.parameter_specified? 'number'
43
- @dark = ' dark' if @helper.parameter_specified? 'dark'
44
45
  @style = @helper.parameter_specified? 'style'
45
- @label = @helper.parameter_specified? 'label'
46
+ @wrapper_class = @helper.parameter_specified? 'wrapper_class'
47
+ @wrapper_style = @helper.parameter_specified? 'wrapper_style'
48
+
49
+ @class = @class ? " #{@class}" : ''
50
+ @style = @style ? " style='#{@style}'" : ''
51
+ @wrapper_class = @wrapper_class ? " #{@wrapper_class}" : ''
52
+ @wrapper_style = @wrapper_style ? " style='#{@wrapper_style}'" : ''
46
53
 
47
54
  # If a label was specified, use it, otherwise concatenate any dangling parameters and use that as the label
48
55
  @label ||= @helper.argv.join(' ')
@@ -62,8 +69,6 @@ module PreTagBlock
62
69
  label_clear = ' clear'
63
70
  end
64
71
  end
65
- @class = @class ? " #{@class}" : ''
66
- @style = @style ? " style='#{@style}'" : ''
67
72
  dark_label = ' darkLabel' if @dark
68
73
  @label = if @label.to_s.empty?
69
74
  ''
@@ -81,9 +86,11 @@ module PreTagBlock
81
86
  pre_content = "#{copy_button}#{content}"
82
87
  attribution = @helper.attribute if @helper.attribution
83
88
  <<~END_OUTPUT
89
+ <div class="jekyll_pre#{@wrapper_class}" #{@wrapper_style}>
84
90
  #{@label}
85
91
  <pre data-lt-active='false' class='#{classes}'#{@style} id='#{pre_id}'>#{pre_content}</pre>
86
92
  #{attribution}
93
+ </div>
87
94
  END_OUTPUT
88
95
  end
89
96
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll_pre
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.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-06 00:00:00.000000000 Z
11
+ date: 2023-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll