marked-conductor 1.0.15 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d289620d1960ec33f53d30e34fe0b2dda1590f59ab97f6c84dc1051ec59556e6
4
- data.tar.gz: f8f52753f27e15303deaeb3558f9506c944b1d8c8de4883173e19c6ded4b975f
3
+ metadata.gz: 6f209ada6b97abd9b51e73fef5c26ef265ebaab7ef534b949fa25ce537735133
4
+ data.tar.gz: 27ed686709dee1e38e6516170d47243177eded3070744e4110304ed4ce558399
5
5
  SHA512:
6
- metadata.gz: f25710fb5a955089af61f9afd82a6e6c0a7ca2472f81d6063c130e806e92a29ab78b014887421acfc72253e8875b6537146a19cc4cbe2b7957e459725e988818
7
- data.tar.gz: 0d88105def3581ba8c025a090a22d97ef60f89a3eaf5b06c04888a10b5f5470ae2239e5ebebbd65ca46d64a25d069726621698dd0b74f5e77442e4042df5673e
6
+ metadata.gz: 8699203cb1a9a6338ebea63dc8fbf20ca212dd5e0278127d952fd1975c1cc60f89a38c3c7372a9b298b05be7548a72127291c91f8a6da3e186636ab1f7efdef1
7
+ data.tar.gz: 2806880345adbe1859d93ffbf6b6dd9b803b30458e4133468f5bf0f8ea0033a9a10891946ec5f259b67171817909ced4015fe1032d064037ba318132ba16fb96
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ### 1.0.16
2
+
3
+ 2024-06-28 12:40
4
+
5
+ #### NEW
6
+
7
+ - New insertCSS filter to inject a stylesheet
8
+ - YUI compression for injected CSS
9
+
1
10
  ### 1.0.15
2
11
 
3
12
  2024-05-25 11:14
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 `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`.
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.6.2.
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
 
@@ -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.6.2.
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.6.2.
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
 
@@ -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.6.2.
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
 
@@ -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.6.2.
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
 
@@ -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.6.2.
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 27</span>
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">&quot;input on STDIN required&quot;</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">&quot;utf-8&quot;</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.6.2.
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.6.2.
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 288</span>
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 293</span>
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.6.2.
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.6.2.
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.6.2.
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
 
@@ -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.6.2.
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 231</span>
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">&quot;#{key}: #{value}&quot;</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 213</span>
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">&quot;#{key}: #{value}\n&quot;</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 195</span>
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 117</span>
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">&quot;#{self}\n#{string}&quot;</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 241</span>
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 223</span>
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">&quot;&quot;</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 204</span>
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 150</span>
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 227</span>
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">/^&lt;!--.*?#{key}: \S.*?--&gt;/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">&#39;.css&#39;</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">&quot;~/.config/conductor/css&quot;</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">&quot;~/.config/conductor/css/#{path}&quot;</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">&quot;~/.config/conductor/files&quot;</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">&quot;~/.config/conductor/files/#{path}&quot;</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">&quot;#{content.wrap_style}\n\n&quot;</span>)
579
+ <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;\n&quot;</span>)
580
+ <span class="ruby-keyword">else</span>
581
+ <span class="ruby-identifier">warn</span> <span class="ruby-node">&quot;File not found (#{path})&quot;</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 87</span>
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 121</span>
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">&quot;#{path}.js&quot;</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 175</span>
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 264</span>
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 260</span>
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 184</span>
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 250</span>
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 142</span>
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">&quot;&quot;</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">&quot;&quot;</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 279</span>
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">&#39;\\\\\1&#39;</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/(^[&quot;&#39;]|[&quot;&#39;]$)/</span>, <span class="ruby-string">&quot;&quot;</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 268</span>
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{&lt;style&gt;.*?&lt;/style&gt;}m</span>)
1337
+ <span class="ruby-keyword">self</span>
1338
+ <span class="ruby-keyword">else</span>
1339
+ <span class="ruby-node">&quot;&lt;style&gt;#{self}&lt;/style&gt;&quot;</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.6.2.
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.6.2.
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
- Sat, 25 May 2024 11:14:11 -0500
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, 24 May 2024 12:23:17 -0500
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 Sat, 25 May 2024 11:13:46 -0500
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 06:41:33 -0500
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.6.2.
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
 
Binary file