jekyll_pre 1.1.2 → 1.1.3

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: '02751991aafe0decd461b0596ea3b8e06cd537bfe036ed5d2d5851aebf7c1295'
4
- data.tar.gz: b2f326314d48b1752ad40b9c50c4df9c7f39dfb93d80662dddc9bab2ebe7291d
3
+ metadata.gz: 51f9bbd2977f1351443513a10d477800fdf02b59e4b3b0f3a697b446a82a76af
4
+ data.tar.gz: 172429a81bec7fb518a881d517624c0834e9851432e0aa51730ecfc441e78d93
5
5
  SHA512:
6
- metadata.gz: 8f62ab9616720b33cd9598c431501e1ac4de30ed8c0fd9a8afaba076f8f4dde15b8885381f4d2716f48c32b68a0dbda6fd021e1f3d0806a46a28322c4ab34671
7
- data.tar.gz: d28408a99c9a4e465caedb7a71296c6ecdeb5a4e13719e2360039fc8eeb84d378034cd996162dbbc3fae57840b1da5afc4972fc892787161d291ff9dbc06f835
6
+ metadata.gz: 7bfa9fab05be08fc0263b8261e94e859731bbbdc02e9fbfc2d83da11d867257eca908d167d62ce4647ecb7faff9bd3681ff0c5b00b47d7f2e521b0cdbfcf72da
7
+ data.tar.gz: e8d25033d36c4ebbfc35fa7b50ecf234c3edf36d229d8529888e05ee3b77264829ff2649748aeb8b6082d5122dc36a511754796e40b944c522d26e4da07b62fa
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
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
+
1
5
  ## 1.1.2 / 2022-04-05
2
6
  * Updated to `jekyll_plugin_logger` v2.1.0
3
7
 
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] %}
@@ -39,7 +40,7 @@ Below are the CSS declarations that I defined pertaining to the pre and noselect
39
40
  ```
40
41
 
41
42
  ## Additional Information
42
- 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).
43
44
 
44
45
 
45
46
  ## Installation
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllPreVersion
4
- VERSION = "1.1.2"
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)
@@ -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
 
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.2
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-04-06 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