jekyll_pre 1.4.7 → 1.4.9
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 +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +70 -60
- data/jekyll_pre.gemspec +12 -13
- data/lib/jekyll_pre/version.rb +1 -1
- data/lib/noselect_tag.rb +5 -1
- data/lib/pre_tag_block.rb +2 -1
- metadata +5 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2aa1ecbdc4cd932e77c94ed9cc2249ba98e7c6ec3ab55a3754aabc8ab23b7999
|
4
|
+
data.tar.gz: 48801d075be0f3a5ea95f006398c5973dbeefb7c746b31535bbba8f4cb809181
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0677f37605fa8a59f6c109126cbe0650775758555a6a3cf1247412a16af8a383baffbaa18cc8e085c7b87f7dd18609933fbf9764d1dd21d835a5fe66db020a28
|
7
|
+
data.tar.gz: 6d3ae36d6d83ccba222256c6a1c8120138938ef79377386f3cf70e3da61fa058dcc7b925d1ee2d859ffecd0291395d25ac074aebc0b41b4d7857cac90131c126
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 1.4.9 / 2025-02-07
|
4
|
+
|
5
|
+
* Added CSS for jekyll_emoji_tag in `demo/assets/css/jekyll_pre.css`.
|
6
|
+
* Added a space after `prompt`, when specified like this: `{% noselect prompt %}`.
|
7
|
+
|
8
|
+
|
9
|
+
## 1.4.8
|
10
|
+
|
11
|
+
* `id` option added.
|
12
|
+
|
13
|
+
|
3
14
|
## 1.4.7
|
4
15
|
|
5
16
|
* `dark` and `bg_yellow` css tags now have black text.
|
data/README.md
CHANGED
@@ -1,79 +1,89 @@
|
|
1
1
|
# Jekyll_pre [](https://badge.fury.io/rb/jekyll_pre)
|
2
2
|
|
3
|
-
This Jekyll plugin provides 3 new Liquid tags that work together:
|
3
|
+
This Jekyll plugin provides 3 new Liquid tags that work together: `pre`, `noselect` and `exec`.
|
4
4
|
|
5
|
-
|
5
|
+
## Provided Tags
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
### `Pre`
|
8
|
+
|
9
|
+
A `pre` block tag can be displayed various ways.
|
10
|
+
|
11
|
+
```html
|
12
|
+
{% pre [Options] [free text label] %}
|
13
|
+
Contents of pre tag
|
14
|
+
{% endpre %}
|
15
|
+
```
|
12
16
|
|
13
|
-
|
17
|
+
`Options` are:
|
14
18
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
* `class="class1 class2"` – Apply CSS classes
|
20
|
+
* `clear` – Line break after floating HTML elements
|
21
|
+
* `copyButton` – Generate a copy button
|
22
|
+
* `dark` – Dark mode
|
23
|
+
* `dedent` – Remove leading spaces common to all lines, like Ruby's <<~ squiggly heredoc (default is false)
|
24
|
+
* `id` ‐ Generate an `id` with the given value for the generated output.
|
25
|
+
* `label='This is a label'` – Apply text above `pre` tag.
|
26
|
+
The `label` parameter value can also be specified in free text.
|
27
|
+
For example, the following produce the same results:
|
23
28
|
|
24
|
-
|
29
|
+
* {% pre label="This is a label" %}<br>Contents of pre tag<br>{% endpre %}
|
25
30
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
31
|
+
* {% pre This is a label %}<br>Contents of pre tag<br>{% endpre %}
|
32
|
+
* `number` – Number the lines
|
33
|
+
* `shell` – Equivalent to `label='Shell'`
|
34
|
+
* `style` – Apply inline CSS styles
|
30
35
|
|
31
|
-
|
32
|
-
|
33
|
-
|
36
|
+
The generated <pre></pre> tag has an `data-lt-active="false"` attribute, so
|
37
|
+
[LanguageTool](https://forum.languagetool.org/t/avoid-spell-check-on-certain-html-inputs-manually/3944)
|
38
|
+
does not check the spelling or grammar of the contents.
|
34
39
|
|
35
|
-
* A `noselect` tag that can renders HTML content passed to it unselectable,
|
36
|
-
and generates a <code>$</code> prompt if no content is provided.
|
37
40
|
|
38
|
-
|
39
|
-
{% pre %}
|
40
|
-
{% noselect [optional text string, defaults to $]%}Command
|
41
|
-
{% noselect unselectable output goes here %}
|
42
|
-
{% endpre %}
|
43
|
-
```
|
41
|
+
### `Noselect`
|
44
42
|
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
A `noselect` tag renders HTML content passed to it unselectable,
|
44
|
+
and generates a <code>$</code> prompt if no content is provided.
|
45
|
+
|
46
|
+
```html
|
47
|
+
{% pre %}
|
48
|
+
{% noselect [optional text string, defaults to $]%}Command
|
49
|
+
{% noselect unselectable output goes here %}
|
50
|
+
{% endpre %}
|
51
|
+
```
|
52
|
+
|
53
|
+
### `Exec`
|
54
|
+
|
55
|
+
An `exec` tag executes shell commands and incorporates the command and its output into the content of the `pre` tag.
|
56
|
+
Environment variables are evaluated,
|
57
|
+
output data is escaped, whitespace is condensed, and wrapped in the same `unselectable` class as does `unselectable`.
|
58
|
+
|
59
|
+
```html
|
60
|
+
{% exec [Options] [shell command] %}
|
61
|
+
```
|
62
|
+
|
63
|
+
`Options` are:
|
64
|
+
|
65
|
+
* `cd="relative/or/absolute/directory"` - Change to specified directory before executing shell command.
|
66
|
+
Environment variables in the directory path will be expanded.
|
67
|
+
* `die_if_nonzero` – Set `false` to treat non-zero return codes as non-fatal.
|
68
|
+
Instead of terminating Jekyll with an error message,
|
69
|
+
the message will be displayed as an error by the Jekyll logger,
|
70
|
+
and a red message will appear in place of the result on the web page.
|
71
|
+
* `die_if_error` – Set `false` to treat exceptions generated by this plugin as non-fatal.
|
72
|
+
Instead of terminating Jekyll with an error message, the message will be displayed as an error by the Jekyll logger.
|
73
|
+
* `no_escape` – Do not HTML escape the result of running the shell command.
|
74
|
+
* `no_stderr` - Discard STDERR output.
|
75
|
+
This is helpful for suppressing annoying `groff` error messages that are emitted when the `exec` subcommand runs `man`.
|
76
|
+
Use it like this:
|
48
77
|
|
49
78
|
```html
|
50
|
-
{%
|
79
|
+
{% pre copyButton dedent shell %}
|
80
|
+
{% noselect %}{% exec no_stderr man netplan %}
|
81
|
+
{% endpre %}
|
51
82
|
```
|
52
83
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
Environment variables in the directory path will be expanded.
|
57
|
-
- `die_if_nonzero` – Set `false` to treat non-zero return codes as non-fatal.
|
58
|
-
Instead of terminating Jekyll with an error message,
|
59
|
-
the message will be displayed as an error by the Jekyll logger,
|
60
|
-
and a red message will appear in place of the result on the web page.
|
61
|
-
- `die_if_error` – Set `false` to treat exceptions generated by this plugin as non-fatal.
|
62
|
-
Instead of terminating Jekyll with an error message, the message will be displayed as an error by the Jekyll logger.
|
63
|
-
- `no_escape` – Do not HTML escape the result of running the shell command.
|
64
|
-
- `no_stderr` - Discard STDERR output.
|
65
|
-
This is helpful for suppressing annoying `groff` error messages that are emitted when the `exec` subcommand runs `man`.
|
66
|
-
Use it like this:
|
67
|
-
|
68
|
-
```html
|
69
|
-
{% pre copyButton dedent shell %}
|
70
|
-
{% noselect %}{% exec no_stderr man netplan %}
|
71
|
-
{% endpre %}
|
72
|
-
```
|
73
|
-
|
74
|
-
- `no_strip` – Do not remove leading and trailing whitespace from the result.
|
75
|
-
- `wrapper_class` class applied to outer `div`.
|
76
|
-
- `wrapper_style` style applied to outer `div`.
|
84
|
+
* `no_strip` – Do not remove leading and trailing whitespace from the result.
|
85
|
+
* `wrapper_class` class applied to outer `div`.
|
86
|
+
* `wrapper_style` style applied to outer `div`.
|
77
87
|
|
78
88
|
|
79
89
|
## Keyword Options
|
data/jekyll_pre.gemspec
CHANGED
@@ -1,18 +1,17 @@
|
|
1
|
-
require 'jekyll'
|
2
1
|
require_relative 'lib/jekyll_pre/version'
|
3
2
|
|
4
3
|
Gem::Specification.new do |spec|
|
5
4
|
github = 'https://github.com/mslinn/jekyll_pre'
|
6
5
|
|
7
|
-
spec.authors
|
8
|
-
spec.bindir
|
6
|
+
spec.authors = ['Mike Slinn']
|
7
|
+
spec.bindir = 'exe'
|
9
8
|
spec.description = <<~END_OF_DESC
|
10
9
|
Jekyll tags pre and noselect, for HTML <pre/> tag, prompts and unselectable text. Can number lines.
|
11
10
|
END_OF_DESC
|
12
|
-
spec.email
|
13
|
-
spec.files
|
11
|
+
spec.email = ['mslinn@mslinn.com']
|
12
|
+
spec.files = Dir['.rubocop.yml', 'LICENSE.*', 'Rakefile', '{lib,spec}/**/*', '*.gemspec', '*.md']
|
14
13
|
spec.homepage = 'https://www.mslinn.com/jekyll_plugins/jekyll_pre.html'
|
15
|
-
spec.license
|
14
|
+
spec.license = 'MIT'
|
16
15
|
spec.metadata = {
|
17
16
|
'allowed_push_host' => 'https://rubygems.org',
|
18
17
|
'bug_tracker_uri' => "#{github}/issues",
|
@@ -20,19 +19,19 @@ Gem::Specification.new do |spec|
|
|
20
19
|
'homepage_uri' => spec.homepage,
|
21
20
|
'source_code_uri' => github,
|
22
21
|
}
|
23
|
-
spec.name
|
22
|
+
spec.name = 'jekyll_pre'
|
23
|
+
spec.platform = Gem::Platform::RUBY
|
24
24
|
spec.post_install_message = <<~END_MESSAGE
|
25
25
|
|
26
26
|
Thanks for installing #{spec.name}!
|
27
27
|
|
28
28
|
END_MESSAGE
|
29
|
-
spec.require_paths
|
29
|
+
spec.require_paths = ['lib']
|
30
30
|
spec.required_ruby_version = '>= 2.6.0'
|
31
|
-
spec.summary
|
32
|
-
spec.test_files
|
33
|
-
spec.version
|
31
|
+
spec.summary = 'Jekyll tags pre and noselect, for HTML <pre/> tag, prompts and unselectable text. Can number lines.'
|
32
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
33
|
+
spec.version = JekyllPreVersion::VERSION
|
34
34
|
|
35
35
|
spec.add_dependency 'jekyll', '>= 3.5.0'
|
36
|
-
spec.add_dependency 'jekyll_plugin_support', '>= 1.0.
|
37
|
-
spec.add_dependency 'rack'
|
36
|
+
spec.add_dependency 'jekyll_plugin_support', '>= 1.0.3'
|
38
37
|
end
|
data/lib/jekyll_pre/version.rb
CHANGED
data/lib/noselect_tag.rb
CHANGED
data/lib/pre_tag_block.rb
CHANGED
@@ -56,6 +56,7 @@ module JekyllPreModule
|
|
56
56
|
@dark = ' dark' if option 'dark'
|
57
57
|
@dedent = option 'dedent'
|
58
58
|
@highlight = option 'highlight'
|
59
|
+
@id = option 'id'
|
59
60
|
@make_copy_button = option 'copyButton'
|
60
61
|
@number_lines = option 'number'
|
61
62
|
@style = option 'style'
|
@@ -106,7 +107,7 @@ module JekyllPreModule
|
|
106
107
|
pre_content = "#{copy_button}#{content}"
|
107
108
|
attribution = @helper.attribute if @helper.attribution
|
108
109
|
<<~END_OUTPUT
|
109
|
-
<div class="jekyll_pre#{@wrapper_class}" #{@wrapper_style}>
|
110
|
+
<div class="jekyll_pre#{@wrapper_class}" #{@wrapper_style}#{" id='#{@id}'" if @id}>
|
110
111
|
#{@label}
|
111
112
|
<pre data-lt-active='false' class='#{classes}'#{@style} id='#{pre_id}'>#{pre_content}</pre>
|
112
113
|
#{attribution}
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll_pre
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Slinn
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-02-07 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: jekyll
|
@@ -30,28 +29,14 @@ dependencies:
|
|
30
29
|
requirements:
|
31
30
|
- - ">="
|
32
31
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.0.
|
32
|
+
version: 1.0.3
|
34
33
|
type: :runtime
|
35
34
|
prerelease: false
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
37
36
|
requirements:
|
38
37
|
- - ">="
|
39
38
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.0.
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rack
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
39
|
+
version: 1.0.3
|
55
40
|
description: 'Jekyll tags pre and noselect, for HTML <pre/> tag, prompts and unselectable
|
56
41
|
text. Can number lines.
|
57
42
|
|
@@ -104,8 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
89
|
- !ruby/object:Gem::Version
|
105
90
|
version: '0'
|
106
91
|
requirements: []
|
107
|
-
rubygems_version: 3.
|
108
|
-
signing_key:
|
92
|
+
rubygems_version: 3.6.3
|
109
93
|
specification_version: 4
|
110
94
|
summary: Jekyll tags pre and noselect, for HTML <pre/> tag, prompts and unselectable
|
111
95
|
text. Can number lines.
|