marked-conductor 1.0.22 → 1.0.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/lib/conductor/env.rb +3 -3
- data/lib/conductor/filter.rb +25 -1
- data/lib/conductor/version.rb +1 -1
- 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: 69dbd324dd85fed4c343563e7431920138a99d4968b8aa8af99ba7fcd5c82087
|
4
|
+
data.tar.gz: ae2eb1f5251187fb67498139dae2d73b6fbce62778f2ef0197a01cb57561fe2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 055a623d15c8bb843b97d6f1931342cab64ec596564f812ffb1b473a85dba9547f7091149619952baacc2d5c9b17e44597f9625aa5b7f2818b72c10760b51a66
|
7
|
+
data.tar.gz: 4f998b8b19bca44f0f08ded4ad89f043802f62e4770d692b9b779c93aa8a52e6cd519fc675716f7b7c1dabaff66fbdbf4eea6611f224ac5db7cc61d7e22d704c
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
### 1.0.24
|
2
|
+
|
3
|
+
2024-07-18 11:32
|
4
|
+
|
5
|
+
#### IMPROVED
|
6
|
+
|
7
|
+
- Use Shellwords.shellsplit/join instead of escaping MARKED_INCLUDES environment variable
|
8
|
+
|
9
|
+
### 1.0.23
|
10
|
+
|
11
|
+
2024-07-17 15:51
|
12
|
+
|
13
|
+
#### FIXED
|
14
|
+
|
15
|
+
- Environment variable escaping was hyperactive, only escape includes array
|
16
|
+
|
1
17
|
### 1.0.22
|
2
18
|
|
3
19
|
2024-07-16 12:30
|
data/lib/conductor/env.rb
CHANGED
@@ -14,7 +14,7 @@ module Conductor
|
|
14
14
|
home: ENV["HOME"],
|
15
15
|
css_path: ENV["MARKED_CSS_PATH"],
|
16
16
|
ext: ENV["MARKED_EXT"],
|
17
|
-
includes: ENV["MARKED_INCLUDES"],
|
17
|
+
includes: Shellwords.shellsplit(ENV["MARKED_INCLUDES"]),
|
18
18
|
origin: ENV["MARKED_ORIGIN"],
|
19
19
|
filepath: ENV["MARKED_PATH"],
|
20
20
|
filename: File.basename(ENV["MARKED_PATH"]),
|
@@ -56,12 +56,12 @@ module Conductor
|
|
56
56
|
"MARKED_CSS_PATH" => @env[:css_path],
|
57
57
|
"MARKED_EXT" => @env[:ext],
|
58
58
|
"MARKED_ORIGIN" => @env[:origin],
|
59
|
-
"MARKED_INCLUDES" => @env[:includes],
|
59
|
+
"MARKED_INCLUDES" => Shellwords.join(@env[:includes]),
|
60
60
|
"MARKED_PATH" => @env[:filepath],
|
61
61
|
"MARKED_PHASE" => @env[:phase],
|
62
62
|
"OUTLINE" => @env[:outline],
|
63
63
|
"PATH" => @env[:path]
|
64
|
-
}.map { |k, v| %(#{k}="#{
|
64
|
+
}.map { |k, v| %(#{k}="#{v}") }.join(" ")
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
data/lib/conductor/filter.rb
CHANGED
@@ -2,6 +2,19 @@
|
|
2
2
|
|
3
3
|
# String helpers
|
4
4
|
class ::String
|
5
|
+
def find_file_in(paths, filename, ext)
|
6
|
+
return filename if File.exist?(filename)
|
7
|
+
|
8
|
+
filename = File.basename(filename, ".#{ext}")
|
9
|
+
|
10
|
+
paths.each do |path|
|
11
|
+
exp = File.join(File.expand_path('~/.config/conductor/'), path, "#{filename}.#{ext}")
|
12
|
+
return exp if File.exist?(exp)
|
13
|
+
end
|
14
|
+
|
15
|
+
"#{filename}.#{ext}"
|
16
|
+
end
|
17
|
+
|
5
18
|
def normalize_filter
|
6
19
|
parts = match(/(?<filter>[\w_]+)(?:\((?<paren>.*?)\))?$/i)
|
7
20
|
filter = parts["filter"].downcase.gsub(/_/, "")
|
@@ -9,6 +22,11 @@ class ::String
|
|
9
22
|
[filter, params]
|
10
23
|
end
|
11
24
|
|
25
|
+
##
|
26
|
+
## Determine type of metadata (yaml, mmd, none)
|
27
|
+
##
|
28
|
+
## @return [Symbol] metadata type
|
29
|
+
##
|
12
30
|
def meta_type
|
13
31
|
lines = split(/\n/)
|
14
32
|
case lines[0]
|
@@ -124,7 +142,8 @@ class ::String
|
|
124
142
|
end
|
125
143
|
|
126
144
|
def insert_stylesheet(path)
|
127
|
-
|
145
|
+
path = find_file_in(['css', 'styles'], path, 'css') unless path =~ /^http/
|
146
|
+
inject_after_meta(%(<link rel="stylesheet" href="#{path.strip}">))
|
128
147
|
end
|
129
148
|
|
130
149
|
def insert_css(path)
|
@@ -514,6 +533,11 @@ class Filter < String
|
|
514
533
|
content = Conductor.stdin
|
515
534
|
|
516
535
|
case @filter
|
536
|
+
when /(insert|add|inject)stylesheet/
|
537
|
+
@params.each do |sheet|
|
538
|
+
content = content.insert_stylesheet(sheet)
|
539
|
+
end
|
540
|
+
content
|
517
541
|
when /(insert|add|inject)(css|style)/
|
518
542
|
@params.each do |css|
|
519
543
|
content = content.insert_css(css)
|
data/lib/conductor/version.rb
CHANGED
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.24
|
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-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|