marked-conductor 1.0.18 → 1.0.19
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/lib/conductor/config.rb +24 -24
- data/lib/conductor/filter.rb +6 -0
- data/lib/conductor/version.rb +1 -1
- 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: b36eba533a0b58958b2a4a9cb9c1a4ec2e9d93a1f57fb91524fead2ef93f55a5
|
4
|
+
data.tar.gz: 37897dda228ea0b7f8e84c233fb5703c4ed2e9573fe412ae54b724f7d0c6ef4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15a5ec6f5a56f5def420bddbd26c4c644f0ce37e3b32a430d13ba51d35957811f882778ce5f9cd396bde255607ef6697b6c07ce7b64a7a3191548f3302705a76
|
7
|
+
data.tar.gz: 73472bc3cb6add78f1566d79e7b5c032da312af0021fc7ccebb17523ba719ca1e7f65f5ab478d05a4e5f29782a62141c169c74136997085230be45c23f2f607f
|
data/CHANGELOG.md
CHANGED
data/lib/conductor/config.rb
CHANGED
@@ -14,34 +14,34 @@ module Conductor
|
|
14
14
|
|
15
15
|
@tracks = @config["tracks"].symbolize_keys
|
16
16
|
end
|
17
|
-
end
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
18
|
+
def create_config(config_file)
|
19
|
+
config_dir = File.dirname(config_file)
|
20
|
+
scripts_dir = File.dirname(File.join(config_dir, "scripts"))
|
21
|
+
FileUtils.mkdir_p(config_dir) unless File.directory?(config_dir)
|
22
|
+
FileUtils.mkdir_p(scripts_dir) unless File.directory?(scripts_dir)
|
23
|
+
File.open(config_file, "w") { |f| f.puts sample_config }
|
24
|
+
puts "Sample config created at #{config_file}"
|
26
25
|
|
27
|
-
|
28
|
-
|
26
|
+
Process.exit 0
|
27
|
+
end
|
29
28
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
tracks:
|
35
|
-
- condition: tree contains .obsidian
|
29
|
+
def sample_config
|
30
|
+
<<~EOCONFIG
|
31
|
+
tracks:
|
32
|
+
- condition: phase is pre
|
36
33
|
tracks:
|
34
|
+
- condition: tree contains .obsidian
|
35
|
+
tracks:
|
36
|
+
- condition: extension is md
|
37
|
+
script: obsidian-md-filter
|
37
38
|
- condition: extension is md
|
38
|
-
|
39
|
-
- condition:
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
EOCONFIG
|
39
|
+
command: rdiscount $file
|
40
|
+
- condition: yaml includes comments
|
41
|
+
script: blog-processor
|
42
|
+
- condition: any
|
43
|
+
command: echo 'NOCUSTOM'
|
44
|
+
EOCONFIG
|
45
|
+
end
|
46
46
|
end
|
47
47
|
end
|
data/lib/conductor/filter.rb
CHANGED
@@ -172,10 +172,16 @@ class ::String
|
|
172
172
|
%(#{self}\n<script type="javascript" src="#{path.strip}"></script>\n)
|
173
173
|
end
|
174
174
|
|
175
|
+
def insert_raw_javascript(content)
|
176
|
+
%(#{self}\n<script>#{content}</script>)
|
177
|
+
end
|
178
|
+
|
175
179
|
def insert_script(path)
|
176
180
|
path.strip!
|
177
181
|
return insert_javascript(path) if path =~ /^http/
|
178
182
|
|
183
|
+
return insert_raw_javascript(path) if path =~ /\(.*?\)/
|
184
|
+
|
179
185
|
path.sub!(/(\.js)?$/, '.js')
|
180
186
|
|
181
187
|
if path =~ %r{^[~/]}
|
data/lib/conductor/version.rb
CHANGED