marked-conductor 1.0.38 → 1.0.39
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/Gemfile.lock +104 -0
- data/README.md +7 -0
- data/lib/conductor/filter.rb +38 -37
- data/lib/conductor/version.rb +1 -1
- data/src/_README.md +8 -1
- metadata +4 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afa046834bd1aa489d0b5e30a4a20e954c958d01fec5a825ede7f6bd4160c926
|
4
|
+
data.tar.gz: 13c549beca3c2a1034a37275c7aa5254df2ea86a348d1f24b39bf826b6a51045
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0350024a2c2481624e537b2b75f30d5b70b957d68ef1664050d2211412fbb0ff4d20c69d314e702b1592ae9024126dd0218d647c74d4147ab9bb726a54023dc9
|
7
|
+
data.tar.gz: ea0c11aa9377089252cb71e1efeb0c863f0c08d89d99cd5596b206e2deb8e4dde222869f53452bcd2919d4546b29a665375fdd5fff2dc82a8098d90d43f4161d
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
marked-conductor (1.0.39)
|
5
|
+
chronic (~> 0.10.2)
|
6
|
+
tty-which (~> 0.5.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
ansi (1.5.0)
|
12
|
+
ast (2.4.2)
|
13
|
+
awesome_print (1.9.2)
|
14
|
+
chronic (0.10.2)
|
15
|
+
coderay (1.1.3)
|
16
|
+
diff-lcs (1.5.1)
|
17
|
+
docile (1.4.0)
|
18
|
+
gem-release (2.2.2)
|
19
|
+
json (2.7.2)
|
20
|
+
language_server-protocol (3.17.0.3)
|
21
|
+
method_source (1.1.0)
|
22
|
+
multi_json (1.15.0)
|
23
|
+
parallel (1.24.0)
|
24
|
+
parse_gemspec (1.0.0)
|
25
|
+
parse_gemspec-cli (1.0.0)
|
26
|
+
multi_json
|
27
|
+
parse_gemspec
|
28
|
+
thor
|
29
|
+
parser (3.3.1.0)
|
30
|
+
ast (~> 2.4.1)
|
31
|
+
racc
|
32
|
+
pry (0.14.2)
|
33
|
+
coderay (~> 1.1)
|
34
|
+
method_source (~> 1.0)
|
35
|
+
racc (1.7.3)
|
36
|
+
rainbow (3.1.1)
|
37
|
+
rake (13.2.1)
|
38
|
+
regexp_parser (2.9.0)
|
39
|
+
rexml (3.2.6)
|
40
|
+
rspec (3.13.0)
|
41
|
+
rspec-core (~> 3.13.0)
|
42
|
+
rspec-expectations (~> 3.13.0)
|
43
|
+
rspec-mocks (~> 3.13.0)
|
44
|
+
rspec-core (3.13.0)
|
45
|
+
rspec-support (~> 3.13.0)
|
46
|
+
rspec-expectations (3.13.1)
|
47
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
48
|
+
rspec-support (~> 3.13.0)
|
49
|
+
rspec-mocks (3.13.1)
|
50
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
51
|
+
rspec-support (~> 3.13.0)
|
52
|
+
rspec-support (3.13.1)
|
53
|
+
rubocop (1.62.1)
|
54
|
+
json (~> 2.3)
|
55
|
+
language_server-protocol (>= 3.17.0)
|
56
|
+
parallel (~> 1.10)
|
57
|
+
parser (>= 3.3.0.2)
|
58
|
+
rainbow (>= 2.2.2, < 4.0)
|
59
|
+
regexp_parser (>= 1.8, < 3.0)
|
60
|
+
rexml (>= 3.2.5, < 4.0)
|
61
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
62
|
+
ruby-progressbar (~> 1.7)
|
63
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
64
|
+
rubocop-ast (1.31.2)
|
65
|
+
parser (>= 3.3.0.4)
|
66
|
+
ruby-progressbar (1.13.0)
|
67
|
+
simplecov (0.22.0)
|
68
|
+
docile (~> 1.1)
|
69
|
+
simplecov-html (~> 0.11)
|
70
|
+
simplecov_json_formatter (~> 0.1)
|
71
|
+
simplecov-console (0.9.1)
|
72
|
+
ansi
|
73
|
+
simplecov
|
74
|
+
terminal-table
|
75
|
+
simplecov-html (0.12.3)
|
76
|
+
simplecov_json_formatter (0.1.4)
|
77
|
+
terminal-table (3.0.2)
|
78
|
+
unicode-display_width (>= 1.1.1, < 3)
|
79
|
+
thor (1.3.1)
|
80
|
+
tty-which (0.5.0)
|
81
|
+
unicode-display_width (2.5.0)
|
82
|
+
yard (0.9.36)
|
83
|
+
|
84
|
+
PLATFORMS
|
85
|
+
arm64-darwin-20
|
86
|
+
arm64-darwin-24
|
87
|
+
x86_64-darwin-20
|
88
|
+
|
89
|
+
DEPENDENCIES
|
90
|
+
awesome_print (~> 1.9.2)
|
91
|
+
bundler (~> 2.0)
|
92
|
+
gem-release (~> 2.2)
|
93
|
+
marked-conductor!
|
94
|
+
parse_gemspec-cli (~> 1.0)
|
95
|
+
pry (~> 0.14.2)
|
96
|
+
rake (~> 13.0)
|
97
|
+
rspec (~> 3.0)
|
98
|
+
rubocop (~> 1.21)
|
99
|
+
simplecov (~> 0.21)
|
100
|
+
simplecov-console (~> 0.9)
|
101
|
+
yard (~> 0.9, >= 0.9.26)
|
102
|
+
|
103
|
+
BUNDLED WITH
|
104
|
+
2.2.29
|
data/README.md
CHANGED
@@ -1,10 +1,17 @@
|
|
1
1
|
|
2
|
+
|
2
3
|
[![RubyGems.org](https://img.shields.io/gem/v/marked-conductor)](https://rubygems.org/gems/marked-conductor)
|
3
4
|
|
4
5
|
# Marked Conductor
|
5
6
|
|
6
7
|
A "train conductor" for [Marked 2](https://marked2app.com) (Mac only). Conductor can be set up as a Custom Preprocessor or Custom Processor for Marked, and can run different commands and scripts based on conditions in a YAML configuration file, allowing you to have multiple processors that run based on predicates.
|
7
8
|
|
9
|
+
Conductor configuration uses "natural language," allowing for complex
|
10
|
+
operations without having to write any code. A condition can look like
|
11
|
+
"name contains work-" to match a file named `work-project1.md`. The
|
12
|
+
actions you can take include scripts, commands, and built in filters for
|
13
|
+
an array of common operations.
|
14
|
+
|
8
15
|
## Installation
|
9
16
|
|
10
17
|
$ gem install marked-conductor
|
data/lib/conductor/filter.rb
CHANGED
@@ -12,13 +12,14 @@ class ::String
|
|
12
12
|
def find_file_in(paths, filename, ext)
|
13
13
|
return filename if File.exist?(filename)
|
14
14
|
|
15
|
+
ext = ext.sub(/^\./, "")
|
16
|
+
|
15
17
|
filename = File.basename(filename, ".#{ext}")
|
16
18
|
|
17
19
|
paths.each do |path|
|
18
20
|
exp = File.join(File.expand_path("~/.config/conductor/"), path, "#{filename}.#{ext}")
|
19
21
|
return exp if File.exist?(exp)
|
20
22
|
end
|
21
|
-
|
22
23
|
"#{filename}.#{ext}"
|
23
24
|
end
|
24
25
|
|
@@ -180,13 +181,13 @@ class ::String
|
|
180
181
|
lines = utf8.split(/\n/)
|
181
182
|
max = max.to_i&.positive? ? " max#{max}" : ""
|
182
183
|
line = case after.to_sym
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
184
|
+
when :h2
|
185
|
+
first_h2.nil? ? 0 : first_h2 + 1
|
186
|
+
when :h1
|
187
|
+
first_h1.nil? ? 0 : first_h1 + 1
|
188
|
+
else
|
189
|
+
meta_insert_point.positive? ? meta_insert_point + 1 : 0
|
190
|
+
end
|
190
191
|
|
191
192
|
lines.insert(line, "\n<!--toc#{max}-->\n").join("\n")
|
192
193
|
end
|
@@ -272,21 +273,21 @@ class ::String
|
|
272
273
|
path = path.strip
|
273
274
|
|
274
275
|
path = if path =~ %r{^[.~/]}
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
276
|
+
File.expand_path(path)
|
277
|
+
else
|
278
|
+
find_file_in(%w[files], path, File.extname(path))
|
279
|
+
end
|
279
280
|
|
280
281
|
warn "File not found: #{path}" unless File.exist?(path)
|
281
282
|
|
282
283
|
out = case type
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
284
|
+
when :code
|
285
|
+
"<<(#{path})"
|
286
|
+
when :raw
|
287
|
+
"<<{#{path}}"
|
288
|
+
else
|
289
|
+
"<<[#{path}]"
|
290
|
+
end
|
290
291
|
out = "\n#{out}\n"
|
291
292
|
|
292
293
|
case position
|
@@ -363,10 +364,10 @@ class ::String
|
|
363
364
|
return insert_raw_javascript(path) if path =~ /\(.*?\)/
|
364
365
|
|
365
366
|
path = if path =~ %r{^[~/.]}
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
367
|
+
File.expand_path(path)
|
368
|
+
else
|
369
|
+
find_file_in(%w[javascript javascripts js scripts], path.sub(/(\.js)?$/, ".js"), "js")
|
370
|
+
end
|
370
371
|
|
371
372
|
if File.exist?(path)
|
372
373
|
insert_javascript(path)
|
@@ -381,7 +382,7 @@ class ::String
|
|
381
382
|
filename.sub!(/-?\d{4}-\d{2}-\d{2}-?/, "")
|
382
383
|
filename.sub!(/\bdot\b/, ".")
|
383
384
|
filename.sub!(/ dash /, "-")
|
384
|
-
filename.gsub(/-/,
|
385
|
+
filename.gsub(/-/, " ")
|
385
386
|
end
|
386
387
|
|
387
388
|
def read_title
|
@@ -512,7 +513,7 @@ class ::String
|
|
512
513
|
lines = utf8.split(/\n/)
|
513
514
|
lines[meta_insert_point..].join("\n")
|
514
515
|
else
|
515
|
-
gsub(/(\n|^)<!--\n[\w\d\s]+: ([\w\d\s]+)\n-->\n/m,
|
516
|
+
gsub(/(\n|^)<!--\n[\w\d\s]+: ([\w\d\s]+)\n-->\n/m, "")
|
516
517
|
end
|
517
518
|
end
|
518
519
|
|
@@ -697,10 +698,10 @@ module Conductor
|
|
697
698
|
amt = 0
|
698
699
|
if @params
|
699
700
|
amt = if @params[0] =~ /^[yts]/
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
701
|
+
1
|
702
|
+
else
|
703
|
+
@params[0].to_i
|
704
|
+
end
|
704
705
|
end
|
705
706
|
content.insert_title(shift: amt)
|
706
707
|
when /(insert|add|inject)script/
|
@@ -713,19 +714,19 @@ module Conductor
|
|
713
714
|
m = Regexp.last_match
|
714
715
|
|
715
716
|
position = if @params.count == 2
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
717
|
+
@params[1].normalize_position
|
718
|
+
else
|
719
|
+
m[1].normalize_position
|
720
|
+
end
|
720
721
|
content.insert_file(@params[0], m[2].normalize_include_type, position)
|
721
722
|
when /inserttoc/
|
722
723
|
max = @params.nil? || @params.empty? ? nil : @params[0]
|
723
724
|
|
724
725
|
after = if @params && @params.count == 2
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
726
|
+
@params[1] =~ /2/ ? :h2 : :h1
|
727
|
+
else
|
728
|
+
:start
|
729
|
+
end
|
729
730
|
|
730
731
|
content.insert_toc(max, after)
|
731
732
|
when /(add|set)meta/
|
data/lib/conductor/version.rb
CHANGED
data/src/_README.md
CHANGED
@@ -1,10 +1,17 @@
|
|
1
1
|
<!--README-->
|
2
|
+
<!--GITHUB-->
|
2
3
|
[![RubyGems.org](https://img.shields.io/gem/v/marked-conductor)](https://rubygems.org/gems/marked-conductor)
|
3
4
|
|
4
5
|
# Marked Conductor
|
5
|
-
|
6
|
+
<!--END GITHUB-->
|
6
7
|
A "train conductor" for [Marked 2](https://marked2app.com) (Mac only). Conductor can be set up as a Custom Preprocessor or Custom Processor for Marked, and can run different commands and scripts based on conditions in a YAML configuration file, allowing you to have multiple processors that run based on predicates.
|
7
8
|
|
9
|
+
<!--JEKYLL {% img alignright /images/projecticons/conductor.png 146 174 "Conductor icon" %}-->Conductor configuration uses "natural language," allowing for complex
|
10
|
+
operations without having to write any code. A condition can look like
|
11
|
+
"name contains work-" to match a file named `work-project1.md`. The
|
12
|
+
actions you can take include scripts, commands, and built in filters for
|
13
|
+
an array of common operations.
|
14
|
+
|
8
15
|
## Installation
|
9
16
|
|
10
17
|
$ gem install marked-conductor
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
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.39
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-01 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: awesome_print
|
@@ -212,6 +211,7 @@ files:
|
|
212
211
|
- CHANGELOG.md
|
213
212
|
- CODE_OF_CONDUCT.md
|
214
213
|
- Gemfile
|
214
|
+
- Gemfile.lock
|
215
215
|
- LICENSE.txt
|
216
216
|
- README.md
|
217
217
|
- README.rdoc
|
@@ -242,7 +242,6 @@ metadata:
|
|
242
242
|
homepage_uri: https://github.com/ttscoff/marked-conductor
|
243
243
|
source_code_uri: https://github.com/ttscoff/marked-conductor
|
244
244
|
changelog_uri: https://github.com/ttscoff/marked-conductor/CHANGELOG.md
|
245
|
-
post_install_message:
|
246
245
|
rdoc_options: []
|
247
246
|
require_paths:
|
248
247
|
- lib
|
@@ -257,8 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
257
256
|
- !ruby/object:Gem::Version
|
258
257
|
version: '0'
|
259
258
|
requirements: []
|
260
|
-
rubygems_version: 3.2
|
261
|
-
signing_key:
|
259
|
+
rubygems_version: 3.6.2
|
262
260
|
specification_version: 4
|
263
261
|
summary: A custom processor manager for Marked 2 (Mac)
|
264
262
|
test_files: []
|