jekyll_todo 0.1.0 → 0.2.0
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 +5 -0
- data/README.md +7 -0
- data/lib/jekyll_todo/version.rb +1 -1
- data/lib/todo.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ff76bc0ad019f049909fb64edc4ec1618aff5d163e21d5a5c58bd4104e4a810
|
4
|
+
data.tar.gz: f58c958d5e77e10f9c8006dcb06a364baa370ea4fc2f38c334c321a33a0e6d01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8e8d60a4461b8f74d9f023690146843d02949fb0615365d1fb1a3bdeaba71239d1476a7d8882a213cf7934e8f61922364f3344598aa3d52d95cc81ed2111852
|
7
|
+
data.tar.gz: 32dbba7205acf5422f3e900ddebc90701fba29322c0c755a8163bc545cbf4f123f7e378a7f5f903704ed97cd85634aa00d750ce1eeced4d91f5e33faeef5709b
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -8,6 +8,13 @@ Generates a TODO block.
|
|
8
8
|
* `block` - Apply `display: block` to the generated HTML wrapper
|
9
9
|
* `class` - Apply the given class to the generated HTML wrapper
|
10
10
|
* `id` - Apply the given HTML id attribute to the generated HTML wrapper
|
11
|
+
* `mode` - Only generate the notice for the given [Jekyll `mode`](https://jekyllrb.com/docs/configuration/environments/).
|
12
|
+
The default is to generate the notice for all Jekyll modes.
|
13
|
+
For example:
|
14
|
+
|
15
|
+
* `mode=development` or `mode=develop` only generates the notice when in `development` mode.
|
16
|
+
* `mode=production` or `mode=prod` only generates the notice when in `production` mode.
|
17
|
+
|
11
18
|
* `span` - Apply `display: inline` to the generated HTML wrapper
|
12
19
|
* `style` - Apply the given CSS style to the generated HTML wrapper
|
13
20
|
|
data/lib/jekyll_todo/version.rb
CHANGED
data/lib/todo.rb
CHANGED
@@ -71,11 +71,17 @@ module JekyllToDo
|
|
71
71
|
@id = @helper.parameter_specified? 'id'
|
72
72
|
@id_option = " id='@id'" if @id
|
73
73
|
|
74
|
+
@mode_specified = @helper.parameter_specified? 'mode'
|
75
|
+
|
74
76
|
@span = @helper.parameter_specified? 'span' unless @block
|
75
77
|
|
76
78
|
@style = @helper.parameter_specified? 'style'
|
77
79
|
@style_option = " style='#{@style}#{@block_option}'" if @style || @block_option
|
78
80
|
|
81
|
+
@mode_specified = 'development' if @mode_specified&.start_with? 'develop'
|
82
|
+
@mode_specified = 'production' if @mode_specified&.start_with? 'prod'
|
83
|
+
return if @mode_specified && @mode_specified != @mode
|
84
|
+
|
79
85
|
if @span
|
80
86
|
<<~END_MSG
|
81
87
|
<span class="todo#{@alert_option}#{@class_option}"#{@id_option}#{@style_option}>#{content}</span>
|