marked-conductor 1.0.28 → 1.0.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +2 -0
- data/lib/conductor/filter.rb +5 -2
- data/lib/conductor/version.rb +1 -1
- data/src/_README.md +2 -0
- 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: 25fca33d78a755b6ab7b9dc4003d842723ca9b1a5eabb4357f665f91480e08cc
|
4
|
+
data.tar.gz: b75c35f4db0f8d96a8a62e7636ff3f268918f85aa98fd133d30621c16dc58ce1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bdd6b152729410fbd5f6752672169a41cdeab264f9b21ae8796eced90dcff3334817dd51038f8732ff6e9d5856776872b3d9cdcaf87898a74c405e8ce99a3a7
|
7
|
+
data.tar.gz: f26b8b7c39db572313b95b83fce5ac49cbd950171034a1bc99a092c62cc0104b1d28eb78e3dbdfa4c44bd1f54f90a4c0d79e0ea9173020fcc4e7e1ab1131eb0f
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -167,6 +167,8 @@ The action can be `script`, `command`, or `filter`.
|
|
167
167
|
| `insertCSS(path)` | insert custom CSS into document |
|
168
168
|
| `autoLink()` | Turn bare URLs into \<self-linked\> urls |
|
169
169
|
| `fixHeaders()` | Reorganize headline levels to semantic order |
|
170
|
+
| `increaseHeaders(count) | Increase header levels by count (default 1) |
|
171
|
+
| `decreaseHeaders(count) | Decrease header levels by count (default 1) |
|
170
172
|
|
171
173
|
For `replace` and `replaceAll`: If *search* is surrounded with forward slashes followed by optional flags (*i* for case-insensitive, *m* to make dot match newlines), e.g. `/contribut(ing)?/i`, it will be interpreted as a regular expression. The *replace* value can include numeric capture groups, e.g. `Follow$2`.
|
172
174
|
|
data/lib/conductor/filter.rb
CHANGED
@@ -135,7 +135,7 @@ class ::String
|
|
135
135
|
## @param amt [Integer] The amount to decrease
|
136
136
|
##
|
137
137
|
def decrease_headers(amt = 1)
|
138
|
-
gsub(/^(\#{1,6})(?!=#)/) do
|
138
|
+
normalize_headers.gsub(/^(\#{1,6})(?!=#)/) do
|
139
139
|
m = Regexp.last_match
|
140
140
|
level = m[1].size
|
141
141
|
level -= amt
|
@@ -152,7 +152,7 @@ class ::String
|
|
152
152
|
## @return [String] content with headers increased
|
153
153
|
##
|
154
154
|
def increase_headers(amt = 1)
|
155
|
-
gsub(/^#/, "#{"#" * amt}#").gsub(/^\#{7,}/, "######")
|
155
|
+
normalize_headers.gsub(/^#/, "#{"#" * amt}#").gsub(/^\#{7,}/, "######")
|
156
156
|
end
|
157
157
|
|
158
158
|
##
|
@@ -764,6 +764,9 @@ module Conductor
|
|
764
764
|
content.autolink
|
765
765
|
when /fix(head(lines|ers)|hierarchy)/
|
766
766
|
content.fix_hierarchy
|
767
|
+
when /(increase|decrease)headers/
|
768
|
+
count = @params ? @params[0].to_i : 1
|
769
|
+
@filter =~ /^inc/ ? content.increase_headers(count) : content.decrease_headers(count)
|
767
770
|
else
|
768
771
|
content
|
769
772
|
end
|
data/lib/conductor/version.rb
CHANGED
data/src/_README.md
CHANGED
@@ -167,6 +167,8 @@ The action can be `script`, `command`, or `filter`.
|
|
167
167
|
| `insertCSS(path)` | insert custom CSS into document |
|
168
168
|
| `autoLink()` | Turn bare URLs into \<self-linked\> urls |
|
169
169
|
| `fixHeaders()` | Reorganize headline levels to semantic order |
|
170
|
+
| `increaseHeaders(count) | Increase header levels by count (default 1) |
|
171
|
+
| `decreaseHeaders(count) | Decrease header levels by count (default 1) |
|
170
172
|
|
171
173
|
For `replace` and `replaceAll`: If *search* is surrounded with forward slashes followed by optional flags (*i* for case-insensitive, *m* to make dot match newlines), e.g. `/contribut(ing)?/i`, it will be interpreted as a regular expression. The *replace* value can include numeric capture groups, e.g. `Follow$2`.
|
172
174
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marked-conductor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.29
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|