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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +2 -1
- data/lib/jekyll_pre/version.rb +1 -1
- data/lib/jekyll_pre.rb +9 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51f9bbd2977f1351443513a10d477800fdf02b59e4b3b0f3a697b446a82a76af
|
4
|
+
data.tar.gz: 172429a81bec7fb518a881d517624c0834e9851432e0aa51730ecfc441e78d93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bfa9fab05be08fc0263b8261e94e859731bbbdc02e9fbfc2d83da11d867257eca908d167d62ce4647ecb7faff9bd3681ff0c5b00b47d7f2e521b0cdbfcf72da
|
7
|
+
data.tar.gz: e8d25033d36c4ebbfc35fa7b50ecf234c3edf36d229d8529888e05ee3b77264829ff2649748aeb8b6082d5122dc36a511754796e40b944c522d26e4da07b62fa
|
data/CHANGELOG.md
CHANGED
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
|
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
|
data/lib/jekyll_pre/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2022-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|