jekyll_pre 1.1.0 → 1.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a4c55485eec7e53914d0be22bc4fcd6701e0ec9fa2137193953e4cf8b1013d5
4
- data.tar.gz: 9a150916aff92e21ac2ed5bd378018dc864cbeaeb5dd1792bcec58fd47bed40c
3
+ metadata.gz: 51f9bbd2977f1351443513a10d477800fdf02b59e4b3b0f3a697b446a82a76af
4
+ data.tar.gz: 172429a81bec7fb518a881d517624c0834e9851432e0aa51730ecfc441e78d93
5
5
  SHA512:
6
- metadata.gz: 26b7a66d9bb2ed68f8f0d4f9e5e1f9bb8a07f21bc414abb8daa2ae50fa3206ad7a0942d395b67b1c50bf946c80be007c387f8492ed250e6ca32c16363e9f561c
7
- data.tar.gz: 4e6a7e59158589373a8a4701d0985a948c16c9f5fbd6b9c940329df52c65bea6596108fa6ddb14e0aa50495ba10b522fb61b15b9a86e100da6ad307a38d2ad33
6
+ metadata.gz: 7bfa9fab05be08fc0263b8261e94e859731bbbdc02e9fbfc2d83da11d867257eca908d167d62ce4647ecb7faff9bd3681ff0c5b00b47d7f2e521b0cdbfcf72da
7
+ data.tar.gz: e8d25033d36c4ebbfc35fa7b50ecf234c3edf36d229d8529888e05ee3b77264829ff2649748aeb8b6082d5122dc36a511754796e40b944c522d26e4da07b62fa
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 1.1.3
2
+ * Documented the `data-lt-active="false"` attribute.
3
+ * Added the `dark` option, and [provided CSS](https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html#pre_css).
4
+
5
+ ## 1.1.2 / 2022-04-05
6
+ * Updated to `jekyll_plugin_logger` v2.1.0
7
+
8
+ ## 1.1.1 / 2022-03-31
9
+ * Added `numbered_line` CSS class for unselectable line numbers
10
+
1
11
  ## 1.1.0 / 2022-03-31
2
12
  * Added `number` option, which generates unselectable line numbers for contents
3
13
 
data/README.md CHANGED
@@ -10,6 +10,7 @@ This Jekyll plugin provides 2 new Liquid tags that work together:
10
10
  Contents of pre tag
11
11
  {% endpre %}
12
12
  ```
13
+ The generated <pre></pre> tag has an `data-lt-active="false"` attribute, so [LanguageTool](https://forum.languagetool.org/t/avoid-spell-check-on-certain-html-inputs-manually/3944) does not check the spelling or grammar of the contents.
13
14
  * A `noselect` tag that can renders HTML content passed to it unselectable.
14
15
  ```
15
16
  {% pre [copyButton] %}
@@ -24,8 +25,10 @@ Below are the CSS declarations that I defined pertaining to the pre and noselect
24
25
  max-height: 500px;
25
26
  }
26
27
 
27
- .numbered_line {
28
- color: rgb(65, 77, 65);
28
+ .numbered_line,
29
+ .unselectable.numbered_line,
30
+ .numbered_line.unselectable {
31
+ color: #5fb25f;
29
32
  }
30
33
 
31
34
  .unselectable {
@@ -37,7 +40,7 @@ Below are the CSS declarations that I defined pertaining to the pre and noselect
37
40
  ```
38
41
 
39
42
  ## Additional Information
40
- More information is available on my web site about [my Jekyll plugins](https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html).
43
+ More information is available on [my web site](https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html#jekyll_pre).
41
44
 
42
45
 
43
46
  ## Installation
data/jekyll_pre.gemspec CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.required_ruby_version = ">= 2.6.0"
33
33
  spec.summary = "Jekyll tags pre and noselect, for HTML <pre/> tag, prompts and unselectable text. Can number lines."
34
34
  spec.test_files = spec.files.grep(%r!^(test|spec|features)/!)
35
- spec.version = JekyllPre::VERSION
35
+ spec.version = JekyllPreVersion::VERSION
36
36
 
37
37
  spec.add_dependency "jekyll", ">= 3.5.0"
38
38
  spec.add_dependency "jekyll_plugin_logger"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module JekyllPre
4
- VERSION = "1.1.0"
3
+ module JekyllPreVersion
4
+ VERSION = "1.1.3"
5
5
  end
data/lib/jekyll_pre.rb CHANGED
@@ -37,18 +37,19 @@ class PreTagBlock < Liquid::Block
37
37
  "#{@@prefix}'##{pre_id}'#{@@suffix}"
38
38
  end
39
39
 
40
- def self.make_pre(make_copy_button, number_lines, label, content)
40
+ def self.make_pre(make_copy_button, number_lines, label, dark, content) # rubocop:disable Metrics/ParameterLists
41
+ dark_label = " darkLabel" if dark
41
42
  label = if label.to_s.empty?
42
43
  ""
43
44
  elsif label.to_s.downcase.strip == "shell"
44
- "<div class='codeLabel unselectable' data-lt-active='false'>Shell</div>"
45
+ "<div class='codeLabel unselectable#{dark_label}' data-lt-active='false'>Shell</div>"
45
46
  else
46
- "<div class='codeLabel unselectable' data-lt-active='false'>#{label}</div>"
47
+ "<div class='codeLabel unselectable#{dark_label}' data-lt-active='false'>#{label}</div>"
47
48
  end
48
49
  pre_id = "id#{SecureRandom.hex(6)}"
49
50
  copy_button = make_copy_button ? PreTagBlock.make_copy_button(pre_id) : ""
50
51
  content = PreTagBlock.number_content(content) if number_lines
51
- "#{label}<pre data-lt-active='false' class='maxOneScreenHigh copyContainer' id='#{pre_id}'>#{copy_button}#{content.strip}</pre>"
52
+ "#{label}<pre data-lt-active='false' class='maxOneScreenHigh copyContainer#{dark}' id='#{pre_id}'>#{copy_button}#{content.strip}</pre>"
52
53
  end
53
54
 
54
55
  def self.number_content(content)
@@ -74,7 +75,7 @@ class PreTagBlock < Liquid::Block
74
75
  argument_string = "" if argument_string.nil?
75
76
  argument_string.strip!
76
77
 
77
- @logger = PluginMetaLogger.instance.new_logger(self)
78
+ @logger = PluginMetaLogger.instance.new_logger(self, PluginMetaLogger.instance.config)
78
79
 
79
80
  @make_copy_button = argument_string.include? "copyButton"
80
81
  remaining_text = argument_string.sub("copyButton", "").strip
@@ -82,6 +83,9 @@ class PreTagBlock < Liquid::Block
82
83
  @number_lines = remaining_text.include? "number"
83
84
  remaining_text = remaining_text.sub("number", "").strip
84
85
 
86
+ @dark = " dark" if remaining_text.include? "dark"
87
+ remaining_text = remaining_text.sub("dark", "").strip
88
+
85
89
  @label = remaining_text
86
90
 
87
91
  @logger.debug { "@make_copy_button = '#{@make_copy_button}'; argument_string = '#{argument_string}'; remaining_text = '#{remaining_text}'" }
@@ -92,7 +96,7 @@ class PreTagBlock < Liquid::Block
92
96
  def render(context)
93
97
  content = super
94
98
  @logger.debug { "@make_copy_button = '#{@make_copy_button}'; @label = '#{@label}'" }
95
- PreTagBlock.make_pre(@make_copy_button, @number_lines, @label, content)
99
+ PreTagBlock.make_pre(@make_copy_button, @number_lines, @label, @dark, content)
96
100
  end
97
101
  end
98
102
 
@@ -117,6 +121,6 @@ class UnselectableTag < Liquid::Tag
117
121
  end
118
122
  end
119
123
 
120
- PluginMetaLogger.instance.info { "Loaded #{JekyllPluginPreName::PLUGIN_NAME} v#{JekyllPre::VERSION} plugin." }
124
+ PluginMetaLogger.instance.info { "Loaded #{JekyllPluginPreName::PLUGIN_NAME} v#{JekyllPreVersion::VERSION} plugin." }
121
125
  Liquid::Template.register_tag("pre", PreTagBlock)
122
126
  Liquid::Template.register_tag("noselect", UnselectableTag)
@@ -1,4 +1,4 @@
1
1
  example_id | status | run_time |
2
2
  ----------------------- | ------ | --------------- |
3
- ./spec/pre_spec.rb[1:1] | passed | 0.00253 seconds |
4
- ./spec/pre_spec.rb[1:2] | passed | 0.00203 seconds |
3
+ ./spec/pre_spec.rb[1:1] | passed | 0.00366 seconds |
4
+ ./spec/pre_spec.rb[1:2] | passed | 0.00288 seconds |
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.1.0
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Slinn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-31 00:00:00.000000000 Z
11
+ date: 2022-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll