marked-conductor 1.0.15 → 1.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +12 -3
- data/html/Array.html +1 -1
- data/html/Conductor/Command.html +1 -1
- data/html/Conductor/Condition.html +1 -1
- data/html/Conductor/Config.html +1 -1
- data/html/Conductor/Env.html +1 -1
- data/html/Conductor/Script.html +1 -1
- data/html/Conductor.html +2 -2
- data/html/FalseClass.html +1 -1
- data/html/Filter.html +8 -3
- data/html/Hash.html +1 -1
- data/html/Object.html +1 -1
- data/html/README_rdoc.html +1 -1
- data/html/String.html +96 -20
- data/html/TrueClass.html +1 -1
- data/html/created.rid +5 -4
- data/html/index.html +5 -1
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search_index.js +1 -1
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +53 -17
- data/lib/conductor/filter.rb +41 -0
- data/lib/conductor/version.rb +1 -1
- data/lib/conductor/yui-compressor.rb +230 -0
- data/lib/conductor.rb +1 -0
- data/src/_README.md +12 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f209ada6b97abd9b51e73fef5c26ef265ebaab7ef534b949fa25ce537735133
|
4
|
+
data.tar.gz: 27ed686709dee1e38e6516170d47243177eded3070744e4110304ed4ce558399
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8699203cb1a9a6338ebea63dc8fbf20ca212dd5e0278127d952fd1975c1cc60f89a38c3c7372a9b298b05be7548a72127291c91f8a6da3e186636ab1f7efdef1
|
7
|
+
data.tar.gz: 2806880345adbe1859d93ffbf6b6dd9b803b30458e4133468f5bf0f8ea0033a9a10891946ec5f259b67171817909ced4015fe1032d064037ba318132ba16fb96
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
# Marked Conductor
|
5
5
|
|
6
|
-
A "train conductor" for [Marked 2](https://marked2app.com). 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.
|
6
|
+
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
7
|
|
8
8
|
## Installation
|
9
9
|
|
@@ -124,12 +124,16 @@ Conditions can be combined with AND or OR (must be uppercase) and simple parenth
|
|
124
124
|
|
125
125
|
The action can be `script`, `command`, or `filter`.
|
126
126
|
|
127
|
+
#### Scripts
|
128
|
+
|
127
129
|
**Scripts** are located in `~/.config/conductor/scripts/` and should be executable files that take input on STDIN (unless `$file` is specified in the `script` definition). If a script is defined starting with `~` or `/`, that will be interpreted as a full path to an alternate location.
|
128
130
|
|
129
131
|
> Example:
|
130
132
|
>
|
131
133
|
> script: github_pre
|
132
134
|
|
135
|
+
#### Commands
|
136
|
+
|
133
137
|
**Commands** are interpreted as shell commands. If a command exists in the `$PATH`, a full path will automatically be determined, so a command can be as simple as just `pandoc`. Add any arguments needed after the command.
|
134
138
|
|
135
139
|
> Example:
|
@@ -139,7 +143,10 @@ The action can be `script`, `command`, or `filter`.
|
|
139
143
|
|
140
144
|
> Using `$file` as an argument to a script or command will bypass processing of STDIN input, and instead use the value of $MARKED_PATH to read the contents of the specified file.
|
141
145
|
|
146
|
+
#### Filters
|
147
|
+
|
142
148
|
**Filters** are simple actions that can be run on the content without having to write a separate script for it. Available filters are:
|
149
|
+
|
143
150
|
| filter | description |
|
144
151
|
| :---- | :---------- |
|
145
152
|
| `setMeta(key, value)` | adds or updates a meta key, aware of YAML and MMD |
|
@@ -155,9 +162,11 @@ The action can be `script`, `command`, or `filter`.
|
|
155
162
|
| `prepend/appendRaw(path)` | insert a file as raw HTML at beginning or end of content |
|
156
163
|
| `prepend/appendCode(path)` | insert a file as a code block at beginning or end of content |
|
157
164
|
|
165
|
+
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`.
|
166
|
+
|
158
167
|
For `insertScript`, if path is just a filename it will look for a match in `~/.config/conductor/javascript` or `~/.config/conductor/scripts` and turn that into an absolute path if the file is found.
|
159
168
|
|
160
|
-
For
|
169
|
+
For all of the prepend/append file filters, you can store files in `~/.config/conductor/files` and reference them with just a filename. Otherwise a full path will be assumed.
|
161
170
|
|
162
171
|
> Example:
|
163
172
|
>
|
@@ -180,7 +189,7 @@ A script run by Conductor already knows it has the right type of file with the e
|
|
180
189
|
- Config file must be valid YAML. Any value containing colons, brackets, or other special characters should be quoted, e.g. (`condition: "text contains my:text"`)
|
181
190
|
- You can see what condition matched in Marked by opening **Help->Show Custom Processor Log** and checking the STDERR output.
|
182
191
|
- To run [a custom processor for Bear](https://brettterpstra.com/2023/10/08/marked-and-bear/), use the condition `"text contains <!-- source: bear.app -->"`. You might consider running a commonmark CLI with Bear to support more of its syntax.
|
183
|
-
- To run a custom processor for Obsidian, use the condition `tree contains .obsidian`
|
192
|
+
- To run a [custom processor for Obsidian](https://brettterpstra.com/2024/05/16/marked-2-and-obsidian/), use the condition `tree contains .obsidian`
|
184
193
|
|
185
194
|
## Testing
|
186
195
|
|
data/html/Array.html
CHANGED
@@ -154,7 +154,7 @@
|
|
154
154
|
|
155
155
|
<footer id="validator-badges" role="contentinfo">
|
156
156
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
157
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
157
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
158
158
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
159
159
|
</footer>
|
160
160
|
|
data/html/Conductor/Command.html
CHANGED
@@ -265,7 +265,7 @@
|
|
265
265
|
|
266
266
|
<footer id="validator-badges" role="contentinfo">
|
267
267
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
268
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
268
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
269
269
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
270
270
|
</footer>
|
271
271
|
|
@@ -785,7 +785,7 @@
|
|
785
785
|
|
786
786
|
<footer id="validator-badges" role="contentinfo">
|
787
787
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
788
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
788
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
789
789
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
790
790
|
</footer>
|
791
791
|
|
data/html/Conductor/Config.html
CHANGED
@@ -164,7 +164,7 @@
|
|
164
164
|
|
165
165
|
<footer id="validator-badges" role="contentinfo">
|
166
166
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
167
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
167
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
168
168
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
169
169
|
</footer>
|
170
170
|
|
data/html/Conductor/Env.html
CHANGED
@@ -214,7 +214,7 @@
|
|
214
214
|
|
215
215
|
<footer id="validator-badges" role="contentinfo">
|
216
216
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
217
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
217
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
218
218
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
219
219
|
</footer>
|
220
220
|
|
data/html/Conductor/Script.html
CHANGED
@@ -282,7 +282,7 @@
|
|
282
282
|
|
283
283
|
<footer id="validator-badges" role="contentinfo">
|
284
284
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
285
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
285
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
286
286
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
287
287
|
</footer>
|
288
288
|
|
data/html/Conductor.html
CHANGED
@@ -264,7 +264,7 @@ sub-tracks.</pre>
|
|
264
264
|
|
265
265
|
|
266
266
|
<div class="method-source-code" id="stdin-source">
|
267
|
-
<pre><span class="ruby-comment"># File lib/conductor.rb, line
|
267
|
+
<pre><span class="ruby-comment"># File lib/conductor.rb, line 28</span>
|
268
268
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">stdin</span>
|
269
269
|
<span class="ruby-identifier">warn</span> <span class="ruby-string">"input on STDIN required"</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">$stdin</span>.<span class="ruby-identifier">stat</span>.<span class="ruby-identifier">size</span>.<span class="ruby-identifier">positive?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">$stdin</span>.<span class="ruby-identifier">fcntl</span>(<span class="ruby-constant">Fcntl</span><span class="ruby-operator">::</span><span class="ruby-constant">F_GETFL</span>, <span class="ruby-value">0</span>).<span class="ruby-identifier">zero?</span>
|
270
270
|
<span class="ruby-ivar">@stdin</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">$stdin</span>.<span class="ruby-identifier">read</span>.<span class="ruby-identifier">force_encoding</span>(<span class="ruby-string">"utf-8"</span>)
|
@@ -357,7 +357,7 @@ sub-tracks.</pre>
|
|
357
357
|
|
358
358
|
<footer id="validator-badges" role="contentinfo">
|
359
359
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
360
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
360
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
361
361
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
362
362
|
</footer>
|
363
363
|
|
data/html/FalseClass.html
CHANGED
@@ -132,7 +132,7 @@
|
|
132
132
|
|
133
133
|
<footer id="validator-badges" role="contentinfo">
|
134
134
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
135
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
135
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
136
136
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
137
137
|
</footer>
|
138
138
|
|
data/html/Filter.html
CHANGED
@@ -145,7 +145,7 @@
|
|
145
145
|
</div>
|
146
146
|
|
147
147
|
<div class="method-source-code" id="new-source">
|
148
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
148
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 324</span>
|
149
149
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">filter</span>)
|
150
150
|
<span class="ruby-ivar">@filter</span>, <span class="ruby-ivar">@params</span> = <span class="ruby-identifier">filter</span>.<span class="ruby-identifier">normalize_filter</span>
|
151
151
|
<span class="ruby-keyword">super</span>
|
@@ -176,11 +176,16 @@
|
|
176
176
|
|
177
177
|
|
178
178
|
<div class="method-source-code" id="process-source">
|
179
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
179
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 329</span>
|
180
180
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">process</span>
|
181
181
|
<span class="ruby-identifier">content</span> = <span class="ruby-constant">Conductor</span>.<span class="ruby-identifier">stdin</span>
|
182
182
|
|
183
183
|
<span class="ruby-keyword">case</span> <span class="ruby-ivar">@filter</span>
|
184
|
+
<span class="ruby-keyword">when</span> <span class="ruby-regexp">/(insert|add|inject)(css|style)/</span>
|
185
|
+
<span class="ruby-ivar">@params</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">css</span><span class="ruby-operator">|</span>
|
186
|
+
<span class="ruby-identifier">content</span> = <span class="ruby-identifier">content</span>.<span class="ruby-identifier">insert_css</span>(<span class="ruby-identifier">css</span>)
|
187
|
+
<span class="ruby-keyword">end</span>
|
188
|
+
<span class="ruby-identifier">content</span>
|
184
189
|
<span class="ruby-keyword">when</span> <span class="ruby-regexp">/(insert|add|inject)title/</span>
|
185
190
|
<span class="ruby-identifier">content</span>.<span class="ruby-identifier">insert_title</span>
|
186
191
|
<span class="ruby-keyword">when</span> <span class="ruby-regexp">/(insert|add|inject)script/</span>
|
@@ -256,7 +261,7 @@
|
|
256
261
|
|
257
262
|
<footer id="validator-badges" role="contentinfo">
|
258
263
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
259
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
264
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
260
265
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
261
266
|
</footer>
|
262
267
|
|
data/html/Hash.html
CHANGED
@@ -154,7 +154,7 @@
|
|
154
154
|
|
155
155
|
<footer id="validator-badges" role="contentinfo">
|
156
156
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
157
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
157
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
158
158
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
159
159
|
</footer>
|
160
160
|
|
data/html/Object.html
CHANGED
@@ -132,7 +132,7 @@
|
|
132
132
|
|
133
133
|
<footer id="validator-badges" role="contentinfo">
|
134
134
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
135
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
135
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
136
136
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
137
137
|
</footer>
|
138
138
|
|
data/html/README_rdoc.html
CHANGED
@@ -80,7 +80,7 @@
|
|
80
80
|
|
81
81
|
<footer id="validator-badges" role="contentinfo">
|
82
82
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
83
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
83
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
84
84
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
85
85
|
</footer>
|
86
86
|
|
data/html/String.html
CHANGED
@@ -86,6 +86,7 @@
|
|
86
86
|
<li ><a href="#method-i-first_h2">#first_h2</a>
|
87
87
|
<li ><a href="#method-i-get_title">#get_title</a>
|
88
88
|
<li ><a href="#method-i-has_comment-3F">#has_comment?</a>
|
89
|
+
<li ><a href="#method-i-insert_css">#insert_css</a>
|
89
90
|
<li ><a href="#method-i-insert_file">#insert_file</a>
|
90
91
|
<li ><a href="#method-i-insert_script">#insert_script</a>
|
91
92
|
<li ><a href="#method-i-insert_title">#insert_title</a>
|
@@ -111,6 +112,7 @@
|
|
111
112
|
<li ><a href="#method-i-to_day">#to_day</a>
|
112
113
|
<li ><a href="#method-i-to_pattern">#to_pattern</a>
|
113
114
|
<li ><a href="#method-i-to_rx">#to_rx</a>
|
115
|
+
<li ><a href="#method-i-wrap_style">#wrap_style</a>
|
114
116
|
<li ><a href="#method-i-yaml-3F">#yaml?</a>
|
115
117
|
</ul>
|
116
118
|
</div>
|
@@ -155,7 +157,7 @@
|
|
155
157
|
|
156
158
|
|
157
159
|
<div class="method-source-code" id="add_comment-source">
|
158
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
160
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 267</span>
|
159
161
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_comment</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
|
160
162
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">has_comment?</span>(<span class="ruby-identifier">key</span>)
|
161
163
|
<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/ *#{key}: .*?$/</span>, <span class="ruby-node">"#{key}: #{value}"</span>)
|
@@ -184,7 +186,7 @@
|
|
184
186
|
|
185
187
|
|
186
188
|
<div class="method-source-code" id="add_mmd-source">
|
187
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
189
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 249</span>
|
188
190
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_mmd</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
|
189
191
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">match</span>(<span class="ruby-regexp">/(\A|\n) *#{key}: *\S+/i</span>)
|
190
192
|
<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/^ *#{key}:.*?\n/i</span>, <span class="ruby-node">"#{key}: #{value}\n"</span>)
|
@@ -213,7 +215,7 @@
|
|
213
215
|
|
214
216
|
|
215
217
|
<div class="method-source-code" id="add_yaml-source">
|
216
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
218
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 231</span>
|
217
219
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_yaml</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
|
218
220
|
<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/^---.*?\n(---|\.\.\.)/m</span>) <span class="ruby-keyword">do</span>
|
219
221
|
<span class="ruby-identifier">m</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">last_match</span>
|
@@ -241,7 +243,7 @@
|
|
241
243
|
|
242
244
|
|
243
245
|
<div class="method-source-code" id="append-source">
|
244
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
246
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 153</span>
|
245
247
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">append</span>(<span class="ruby-identifier">string</span>)
|
246
248
|
<span class="ruby-node">"#{self}\n#{string}"</span>
|
247
249
|
<span class="ruby-keyword">end</span></pre>
|
@@ -346,7 +348,7 @@
|
|
346
348
|
|
347
349
|
|
348
350
|
<div class="method-source-code" id="delete_meta-source">
|
349
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
351
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 277</span>
|
350
352
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">delete_meta</span>(<span class="ruby-identifier">key</span>)
|
351
353
|
<span class="ruby-keyword">case</span> <span class="ruby-identifier">meta_type</span>
|
352
354
|
<span class="ruby-keyword">when</span> <span class="ruby-value">:yaml</span>
|
@@ -374,7 +376,7 @@
|
|
374
376
|
|
375
377
|
|
376
378
|
<div class="method-source-code" id="delete_mmd-source">
|
377
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
379
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 259</span>
|
378
380
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">delete_mmd</span>(<span class="ruby-identifier">key</span>)
|
379
381
|
<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/^ *#{key}:.*?\n/i</span>, <span class="ruby-string">""</span>)
|
380
382
|
<span class="ruby-keyword">end</span></pre>
|
@@ -397,7 +399,7 @@
|
|
397
399
|
|
398
400
|
|
399
401
|
<div class="method-source-code" id="delete_yaml-source">
|
400
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
402
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 240</span>
|
401
403
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">delete_yaml</span>(<span class="ruby-identifier">key</span>)
|
402
404
|
<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/^---.*?\n(---|\.\.\.)/m</span>) <span class="ruby-keyword">do</span>
|
403
405
|
<span class="ruby-identifier">m</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">last_match</span>
|
@@ -485,7 +487,7 @@
|
|
485
487
|
|
486
488
|
|
487
489
|
<div class="method-source-code" id="get_title-source">
|
488
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
490
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 186</span>
|
489
491
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_title</span>
|
490
492
|
<span class="ruby-identifier">title</span> = <span class="ruby-keyword">nil</span>
|
491
493
|
|
@@ -529,7 +531,7 @@
|
|
529
531
|
|
530
532
|
|
531
533
|
<div class="method-source-code" id="has_comment-3F-source">
|
532
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
534
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 263</span>
|
533
535
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">has_comment?</span>(<span class="ruby-identifier">key</span>)
|
534
536
|
<span class="ruby-identifier">match</span>(<span class="ruby-regexp">/^<!--.*?#{key}: \S.*?-->/m</span>)
|
535
537
|
<span class="ruby-keyword">end</span></pre>
|
@@ -537,6 +539,53 @@
|
|
537
539
|
</div>
|
538
540
|
|
539
541
|
|
542
|
+
</div>
|
543
|
+
|
544
|
+
<div id="method-i-insert_css" class="method-detail ">
|
545
|
+
<div class="method-header">
|
546
|
+
<div class="method-heading">
|
547
|
+
<span class="method-name">insert_css</span><span
|
548
|
+
class="method-args">(path)</span>
|
549
|
+
<span class="method-click-advice">click to toggle source</span>
|
550
|
+
</div>
|
551
|
+
</div>
|
552
|
+
|
553
|
+
<div class="method-description">
|
554
|
+
|
555
|
+
|
556
|
+
<div class="method-source-code" id="insert_css-source">
|
557
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 95</span>
|
558
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">insert_css</span>(<span class="ruby-identifier">path</span>)
|
559
|
+
<span class="ruby-identifier">path</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp">/(\.css)?$/</span>, <span class="ruby-string">'.css'</span>)
|
560
|
+
|
561
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">%r{^[~/]}</span>
|
562
|
+
<span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">path</span>)
|
563
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">"~/.config/conductor/css"</span>))
|
564
|
+
<span class="ruby-identifier">new_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-node">"~/.config/conductor/css/#{path}"</span>)
|
565
|
+
<span class="ruby-identifier">path</span> = <span class="ruby-identifier">new_path</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">new_path</span>)
|
566
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">"~/.config/conductor/files"</span>))
|
567
|
+
<span class="ruby-identifier">new_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-node">"~/.config/conductor/files/#{path}"</span>)
|
568
|
+
<span class="ruby-identifier">path</span> = <span class="ruby-identifier">new_path</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">new_path</span>)
|
569
|
+
<span class="ruby-keyword">end</span>
|
570
|
+
|
571
|
+
<span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">path</span>)
|
572
|
+
<span class="ruby-identifier">content</span> = <span class="ruby-constant">IO</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">path</span>)
|
573
|
+
<span class="ruby-identifier">yui</span> = <span class="ruby-constant">YuiCompressor</span><span class="ruby-operator">::</span><span class="ruby-constant">Yui</span>.<span class="ruby-identifier">new</span>
|
574
|
+
<span class="ruby-identifier">content</span> = <span class="ruby-identifier">yui</span>.<span class="ruby-identifier">compress</span>(<span class="ruby-identifier">content</span>)
|
575
|
+
<span class="ruby-identifier">lines</span> = <span class="ruby-identifier">split</span>(<span class="ruby-regexp">/\n/</span>)
|
576
|
+
<span class="ruby-identifier">insert_point</span> = <span class="ruby-identifier">meta_insert_point</span>
|
577
|
+
<span class="ruby-identifier">insert_at</span> = <span class="ruby-identifier">insert_point</span>.<span class="ruby-identifier">positive?</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">insert_point</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">0</span>
|
578
|
+
<span class="ruby-identifier">lines</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-identifier">insert_at</span>, <span class="ruby-node">"#{content.wrap_style}\n\n"</span>)
|
579
|
+
<span class="ruby-identifier">lines</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">"\n"</span>)
|
580
|
+
<span class="ruby-keyword">else</span>
|
581
|
+
<span class="ruby-identifier">warn</span> <span class="ruby-node">"File not found (#{path})"</span>
|
582
|
+
<span class="ruby-keyword">self</span>
|
583
|
+
<span class="ruby-keyword">end</span>
|
584
|
+
<span class="ruby-keyword">end</span></pre>
|
585
|
+
</div>
|
586
|
+
</div>
|
587
|
+
|
588
|
+
|
540
589
|
</div>
|
541
590
|
|
542
591
|
<div id="method-i-insert_file" class="method-detail ">
|
@@ -552,7 +601,7 @@
|
|
552
601
|
|
553
602
|
|
554
603
|
<div class="method-source-code" id="insert_file-source">
|
555
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
604
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 123</span>
|
556
605
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">insert_file</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">type</span> = <span class="ruby-value">:file</span>, <span class="ruby-identifier">position</span> = <span class="ruby-value">:end</span>)
|
557
606
|
<span class="ruby-identifier">path</span>.<span class="ruby-identifier">strip!</span>
|
558
607
|
|
@@ -601,7 +650,7 @@
|
|
601
650
|
|
602
651
|
|
603
652
|
<div class="method-source-code" id="insert_script-source">
|
604
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
653
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 157</span>
|
605
654
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">insert_script</span>(<span class="ruby-identifier">path</span>)
|
606
655
|
<span class="ruby-identifier">path</span>.<span class="ruby-identifier">strip!</span>
|
607
656
|
<span class="ruby-identifier">path</span> = <span class="ruby-node">"#{path}.js"</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/\.js$/</span>
|
@@ -641,7 +690,7 @@
|
|
641
690
|
|
642
691
|
|
643
692
|
<div class="method-source-code" id="insert_title-source">
|
644
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
693
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 211</span>
|
645
694
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">insert_title</span>
|
646
695
|
<span class="ruby-identifier">title</span> = <span class="ruby-identifier">get_title</span>
|
647
696
|
<span class="ruby-identifier">lines</span> = <span class="ruby-identifier">split</span>(<span class="ruby-regexp">/\n/</span>)
|
@@ -915,7 +964,7 @@
|
|
915
964
|
|
916
965
|
|
917
966
|
<div class="method-source-code" id="replace-source">
|
918
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
967
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 300</span>
|
919
968
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">replace</span>(<span class="ruby-identifier">regex</span>, <span class="ruby-identifier">pattern</span>)
|
920
969
|
<span class="ruby-identifier">sub</span>(<span class="ruby-identifier">regex</span>.<span class="ruby-identifier">to_rx</span>, <span class="ruby-identifier">pattern</span>.<span class="ruby-identifier">to_pattern</span>)
|
921
970
|
<span class="ruby-keyword">end</span></pre>
|
@@ -938,7 +987,7 @@
|
|
938
987
|
|
939
988
|
|
940
989
|
<div class="method-source-code" id="replace_all-source">
|
941
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
990
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 296</span>
|
942
991
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">replace_all</span>(<span class="ruby-identifier">regex</span>, <span class="ruby-identifier">pattern</span>)
|
943
992
|
<span class="ruby-identifier">gsub</span>(<span class="ruby-identifier">regex</span>.<span class="ruby-identifier">to_rx</span>, <span class="ruby-identifier">pattern</span>.<span class="ruby-identifier">to_pattern</span>)
|
944
993
|
<span class="ruby-keyword">end</span></pre>
|
@@ -961,7 +1010,7 @@
|
|
961
1010
|
|
962
1011
|
|
963
1012
|
<div class="method-source-code" id="set_meta-source">
|
964
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
1013
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 220</span>
|
965
1014
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_meta</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>, <span class="ruby-value">style:</span> <span class="ruby-value">:comment</span>)
|
966
1015
|
<span class="ruby-keyword">case</span> <span class="ruby-identifier">style</span>
|
967
1016
|
<span class="ruby-keyword">when</span> <span class="ruby-value">:yaml</span>
|
@@ -991,7 +1040,7 @@
|
|
991
1040
|
|
992
1041
|
|
993
1042
|
<div class="method-source-code" id="strip_meta-source">
|
994
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
1043
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 286</span>
|
995
1044
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">strip_meta</span>
|
996
1045
|
<span class="ruby-keyword">case</span> <span class="ruby-identifier">meta_type</span>
|
997
1046
|
<span class="ruby-keyword">when</span> <span class="ruby-value">:yaml</span>
|
@@ -1070,7 +1119,7 @@
|
|
1070
1119
|
|
1071
1120
|
|
1072
1121
|
<div class="method-source-code" id="title_from_slug-source">
|
1073
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
1122
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 178</span>
|
1074
1123
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">title_from_slug</span>
|
1075
1124
|
<span class="ruby-identifier">filename</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-constant">Conductor</span><span class="ruby-operator">::</span><span class="ruby-constant">Env</span>.<span class="ruby-identifier">env</span>[<span class="ruby-value">:filepath</span>]).<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/\.[a-z]+$/i</span>, <span class="ruby-string">""</span>)
|
1076
1125
|
<span class="ruby-identifier">filename</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp">/-?\d{4}-\d{2}-\d{2}-?/</span>, <span class="ruby-string">""</span>)
|
@@ -1229,7 +1278,7 @@
|
|
1229
1278
|
|
1230
1279
|
|
1231
1280
|
<div class="method-source-code" id="to_pattern-source">
|
1232
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
1281
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 315</span>
|
1233
1282
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_pattern</span>
|
1234
1283
|
<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/\$(\d+)/</span>, <span class="ruby-string">'\\\\\1'</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/(^["']|["']$)/</span>, <span class="ruby-string">""</span>)
|
1235
1284
|
<span class="ruby-keyword">end</span></pre>
|
@@ -1252,7 +1301,7 @@
|
|
1252
1301
|
|
1253
1302
|
|
1254
1303
|
<div class="method-source-code" id="to_rx-source">
|
1255
|
-
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line
|
1304
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 304</span>
|
1256
1305
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_rx</span>
|
1257
1306
|
<span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">%r{^/(.*?)/([im]+)?$}</span>
|
1258
1307
|
<span class="ruby-identifier">m</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">last_match</span>
|
@@ -1267,6 +1316,33 @@
|
|
1267
1316
|
</div>
|
1268
1317
|
|
1269
1318
|
|
1319
|
+
</div>
|
1320
|
+
|
1321
|
+
<div id="method-i-wrap_style" class="method-detail ">
|
1322
|
+
<div class="method-header">
|
1323
|
+
<div class="method-heading">
|
1324
|
+
<span class="method-name">wrap_style</span><span
|
1325
|
+
class="method-args">()</span>
|
1326
|
+
<span class="method-click-advice">click to toggle source</span>
|
1327
|
+
</div>
|
1328
|
+
</div>
|
1329
|
+
|
1330
|
+
<div class="method-description">
|
1331
|
+
|
1332
|
+
|
1333
|
+
<div class="method-source-code" id="wrap_style-source">
|
1334
|
+
<pre><span class="ruby-comment"># File lib/conductor/filter.rb, line 87</span>
|
1335
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">wrap_style</span>
|
1336
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">match</span>(<span class="ruby-regexp">%r{<style>.*?</style>}m</span>)
|
1337
|
+
<span class="ruby-keyword">self</span>
|
1338
|
+
<span class="ruby-keyword">else</span>
|
1339
|
+
<span class="ruby-node">"<style>#{self}</style>"</span>
|
1340
|
+
<span class="ruby-keyword">end</span>
|
1341
|
+
<span class="ruby-keyword">end</span></pre>
|
1342
|
+
</div>
|
1343
|
+
</div>
|
1344
|
+
|
1345
|
+
|
1270
1346
|
</div>
|
1271
1347
|
|
1272
1348
|
<div id="method-i-yaml-3F" class="method-detail ">
|
@@ -1302,7 +1378,7 @@
|
|
1302
1378
|
|
1303
1379
|
<footer id="validator-badges" role="contentinfo">
|
1304
1380
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
1305
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
1381
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
1306
1382
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
1307
1383
|
</footer>
|
1308
1384
|
|
data/html/TrueClass.html
CHANGED
@@ -132,7 +132,7 @@
|
|
132
132
|
|
133
133
|
<footer id="validator-badges" role="contentinfo">
|
134
134
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
135
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
135
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
136
136
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
137
137
|
</footer>
|
138
138
|
|
data/html/created.rid
CHANGED
@@ -1,15 +1,16 @@
|
|
1
|
-
|
1
|
+
Fri, 28 Jun 2024 12:41:02 -0500
|
2
2
|
README.rdoc Sun, 28 Apr 2024 13:21:34 -0500
|
3
|
-
lib/conductor.rb Fri,
|
3
|
+
lib/conductor.rb Fri, 28 Jun 2024 12:29:13 -0500
|
4
4
|
lib/conductor/array.rb Sat, 27 Apr 2024 11:54:28 -0500
|
5
5
|
lib/conductor/boolean.rb Thu, 25 Apr 2024 14:25:59 -0500
|
6
6
|
lib/conductor/command.rb Sat, 27 Apr 2024 11:54:28 -0500
|
7
7
|
lib/conductor/condition.rb Mon, 29 Apr 2024 09:19:15 -0500
|
8
8
|
lib/conductor/config.rb Sat, 27 Apr 2024 11:54:28 -0500
|
9
9
|
lib/conductor/env.rb Mon, 29 Apr 2024 09:28:21 -0500
|
10
|
-
lib/conductor/filter.rb
|
10
|
+
lib/conductor/filter.rb Fri, 28 Jun 2024 12:35:15 -0500
|
11
11
|
lib/conductor/hash.rb Sat, 27 Apr 2024 11:54:28 -0500
|
12
12
|
lib/conductor/script.rb Sun, 28 Apr 2024 16:21:49 -0500
|
13
13
|
lib/conductor/string.rb Sat, 25 May 2024 10:58:38 -0500
|
14
|
-
lib/conductor/version.rb Sat, 25 May 2024
|
14
|
+
lib/conductor/version.rb Sat, 25 May 2024 11:14:29 -0500
|
15
|
+
lib/conductor/yui-compressor.rb Fri, 28 Jun 2024 12:35:00 -0500
|
15
16
|
bin/conductor Fri, 24 May 2024 12:39:06 -0500
|
data/html/index.html
CHANGED
@@ -83,6 +83,10 @@
|
|
83
83
|
<li><code><a href="./Object.html">Object</a></code>
|
84
84
|
<li><code><a href="./String.html">String</a></code>
|
85
85
|
<li><code><a href="./TrueClass.html">TrueClass</a></code>
|
86
|
+
<li><details><summary><code><a href="./YuiCompressor.html">YuiCompressor</a></code></summary>
|
87
|
+
<ul class="link-list">
|
88
|
+
<li><code><a href="./YuiCompressor/Yui.html">Yui</a></code>
|
89
|
+
</ul></details>
|
86
90
|
</div>
|
87
91
|
|
88
92
|
</div>
|
@@ -100,7 +104,7 @@
|
|
100
104
|
|
101
105
|
<footer id="validator-badges" role="contentinfo">
|
102
106
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
103
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
107
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
104
108
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
105
109
|
</footer>
|
106
110
|
|
data/html/js/navigation.js.gz
CHANGED
Binary file
|