middleman-targets 1.0.3 → 1.0.4

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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +7 -0
  3. data/.yardopts +9 -0
  4. data/CHANGELOG.md +7 -0
  5. data/README.md +21 -4
  6. data/Rakefile +12 -6
  7. data/documentation_project/Gemfile +1 -1
  8. data/documentation_project/config.rb +7 -7
  9. data/documentation_project/source/helpers-resources.html.md.erb +14 -66
  10. data/documentation_project/source/partials/config.erb +326 -0
  11. data/documentation_project/source/partials/helpers.erb +354 -0
  12. data/documentation_project/source/partials/resources.erb +100 -0
  13. data/documentation_project/source/stylesheets/_middlemac_minimal.scss +283 -1
  14. data/documentation_project/source/target-feature-config.html.md.erb +6 -36
  15. data/features/build_target_option.feature +42 -0
  16. data/features/helpers_and_resources.feature +44 -0
  17. data/features/server_target_option.feature +42 -0
  18. data/features/support/env.rb +20 -0
  19. data/fixtures/middleman_targets_app/config.rb +33 -0
  20. data/fixtures/middleman_targets_app/source/all-root-logo.png +0 -0
  21. data/fixtures/middleman_targets_app/source/all-root.png +0 -0
  22. data/fixtures/middleman_targets_app/source/free-root.png +0 -0
  23. data/fixtures/middleman_targets_app/source/images/all-image.png +0 -0
  24. data/fixtures/middleman_targets_app/source/images/all-logo.png +0 -0
  25. data/fixtures/middleman_targets_app/source/images/free-image.png +0 -0
  26. data/fixtures/middleman_targets_app/source/images/pro-image.png +0 -0
  27. data/fixtures/middleman_targets_app/source/index.html.md.erb +35 -0
  28. data/fixtures/middleman_targets_app/source/pro-root.png +0 -0
  29. data/lib/middleman-targets/extension.rb +182 -54
  30. data/lib/middleman-targets/middleman-cli/build_all.rb +5 -6
  31. data/lib/middleman-targets/version.rb +1 -1
  32. data/middleman-targets.gemspec +9 -2
  33. data/yard/readme.md +6 -0
  34. data/yard/templates/default/fulldoc/html/css/common.css +1 -0
  35. data/yard/templates/default/fulldoc/html/css/full_list.css +57 -0
  36. data/yard/templates/default/fulldoc/html/css/style.css +343 -0
  37. data/yard/templates/default/onefile/html/files.erb +5 -0
  38. data/yard/templates/default/onefile/html/headers.erb +6 -0
  39. data/yard/templates/default/onefile/html/layout.erb +17 -0
  40. data/yard/templates/default/onefile/html/readme.erb +3 -0
  41. data/yard/templates/default/onefile/html/setup.rb +61 -0
  42. data/yard/yard_extensions.rb +73 -0
  43. metadata +83 -3
@@ -0,0 +1,354 @@
1
+ <div class="method_details_list">
2
+ <div class="method_details first">
3
+ <h3 class="signature first" id="image_tag-instance_method">
4
+
5
+ - (<tt>Void</tt>) <strong>image_tag</strong>(path, params = {})
6
+
7
+
8
+
9
+
10
+
11
+ </h3><div class="docstring">
12
+ <div class="discussion">
13
+
14
+ <p>Override the built-in <code>image-tag</code> helper in order to
15
+ support additional features.</p>
16
+
17
+ <ul>
18
+ <li>Automatic target-specific images. Note that this
19
+ only works on local files, and only if enabled
20
+ with the option <code>:target_magic_images</code>.</li>
21
+ <li>Target and feature dependent images using the
22
+ <code>params</code> hash.</li>
23
+ <li>Absolute paths, which Middleman sometimes bungles.</li>
24
+ </ul>
25
+
26
+ <p>Note that in addition to the options described below,
27
+ <code>middleman-targets</code> inherits all of the built-in
28
+ option parameters as well.</p>
29
+
30
+
31
+ </div>
32
+ </div>
33
+ <div class="tags">
34
+ <p class="tag_title">Parameters:</p>
35
+ <ul class="param">
36
+
37
+ <li>
38
+
39
+ <span class='name'>path</span>
40
+
41
+
42
+ <span class='type'>(<tt>String</tt>)</span>
43
+
44
+
45
+
46
+ &mdash;
47
+ <div class='inline'><p>The path to the image file.</p>
48
+ </div>
49
+
50
+ </li>
51
+
52
+ <li>
53
+
54
+ <span class='name'>params</span>
55
+
56
+
57
+ <span class='type'>(<tt>Hash</tt>)</span>
58
+
59
+
60
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
61
+
62
+
63
+ &mdash;
64
+ <div class='inline'><p>Optional parameters to pass to
65
+ the helper.</p>
66
+ </div>
67
+
68
+ </li>
69
+
70
+ </ul>
71
+
72
+
73
+
74
+
75
+
76
+
77
+ <p class="tag_title">Options Hash (<tt>params</tt>):</p>
78
+ <ul class="option">
79
+
80
+ <li>
81
+ <span class="name">:target</span>
82
+ <span class="type">(<tt>String</tt>, <tt>Symbol</tt>)</span>
83
+ <span class="default">
84
+
85
+ </span>
86
+
87
+ &mdash; <div class='inline'><p>This image
88
+ tag will only be applied if the current target is
89
+ <code>target</code>.</p>
90
+ </div>
91
+
92
+ </li>
93
+
94
+ <li>
95
+ <span class="name">:feature</span>
96
+ <span class="type">(<tt>String</tt>, <tt>Symbol</tt>)</span>
97
+ <span class="default">
98
+
99
+ </span>
100
+
101
+ &mdash; <div class='inline'><p>This image
102
+ tag will only be applied if the current target
103
+ enables the feature <code>feature</code>.</p>
104
+ </div>
105
+
106
+ </li>
107
+
108
+ </ul>
109
+
110
+
111
+ <p class="tag_title">Returns:</p>
112
+ <ul class="return">
113
+
114
+ <li>
115
+
116
+
117
+ <span class='type'>(<tt>Void</tt>)</span>
118
+
119
+
120
+
121
+ </li>
122
+
123
+ </ul>
124
+
125
+ </div>
126
+ </div>
127
+
128
+ <div class="method_details ">
129
+ <h3 class="signature " id="target_feature?-instance_method">
130
+
131
+ - (<tt>Boolean</tt>) <strong>target_feature?</strong>(feature)
132
+
133
+
134
+
135
+
136
+
137
+ </h3><div class="docstring">
138
+ <div class="discussion">
139
+
140
+ <p>Does the target have the feature <code>feature</code> enabled?</p>
141
+
142
+
143
+ </div>
144
+ </div>
145
+ <div class="tags">
146
+ <p class="tag_title">Parameters:</p>
147
+ <ul class="param">
148
+
149
+ <li>
150
+
151
+ <span class='name'>feature</span>
152
+
153
+
154
+ <span class='type'>(<tt>String</tt>, <tt>Symbol</tt>)</span>
155
+
156
+
157
+
158
+ &mdash;
159
+ <div class='inline'><p>Specifies a proposed
160
+ feature.</p>
161
+ </div>
162
+
163
+ </li>
164
+
165
+ </ul>
166
+
167
+ <p class="tag_title">Returns:</p>
168
+ <ul class="return">
169
+
170
+ <li>
171
+
172
+
173
+ <span class='type'>(<tt>Boolean</tt>)</span>
174
+
175
+
176
+
177
+ &mdash;
178
+ <div class='inline'><p>Returns <code>true</code> if the current target
179
+ has the features <code>feature</code> and the features is
180
+ enabled.</p>
181
+ </div>
182
+
183
+ </li>
184
+
185
+ </ul>
186
+
187
+ </div>
188
+ </div>
189
+
190
+ <div class="method_details ">
191
+ <h3 class="signature " id="target_name-instance_method">
192
+
193
+ - (<tt>Symbol</tt>) <strong>target_name</strong>
194
+
195
+
196
+
197
+
198
+
199
+ </h3><div class="docstring">
200
+ <div class="discussion">
201
+
202
+ <p>Return the current build target.</p>
203
+
204
+
205
+ </div>
206
+ </div>
207
+ <div class="tags">
208
+
209
+ <p class="tag_title">Returns:</p>
210
+ <ul class="return">
211
+
212
+ <li>
213
+
214
+
215
+ <span class='type'>(<tt>Symbol</tt>)</span>
216
+
217
+
218
+
219
+ &mdash;
220
+ <div class='inline'><p>Returns the current build target.</p>
221
+ </div>
222
+
223
+ </li>
224
+
225
+ </ul>
226
+
227
+ </div>
228
+ </div>
229
+
230
+ <div class="method_details ">
231
+ <h3 class="signature " id="target_name?-instance_method">
232
+
233
+ - (<tt>Boolean</tt>) <strong>target_name?</strong>(proposal)
234
+
235
+
236
+
237
+
238
+
239
+ </h3><div class="docstring">
240
+ <div class="discussion">
241
+
242
+ <p>Is the current target <code>proposal</code>?</p>
243
+
244
+
245
+ </div>
246
+ </div>
247
+ <div class="tags">
248
+ <p class="tag_title">Parameters:</p>
249
+ <ul class="param">
250
+
251
+ <li>
252
+
253
+ <span class='name'>proposal</span>
254
+
255
+
256
+ <span class='type'>(<tt>String</tt>, <tt>Symbol</tt>)</span>
257
+
258
+
259
+
260
+ &mdash;
261
+ <div class='inline'><p>Specifies a proposed
262
+ target.</p>
263
+ </div>
264
+
265
+ </li>
266
+
267
+ </ul>
268
+
269
+ <p class="tag_title">Returns:</p>
270
+ <ul class="return">
271
+
272
+ <li>
273
+
274
+
275
+ <span class='type'>(<tt>Boolean</tt>)</span>
276
+
277
+
278
+
279
+ &mdash;
280
+ <div class='inline'><p>Returns <code>true</code> if the current target
281
+ matches the parameter <code>proposal</code>.</p>
282
+ </div>
283
+
284
+ </li>
285
+
286
+ </ul>
287
+
288
+ </div>
289
+ </div>
290
+
291
+ <div class="method_details ">
292
+ <h3 class="signature " id="target_value-instance_method">
293
+
294
+ - (<tt>String</tt>, <tt>Nil</tt>) <strong>target_value</strong>(key)
295
+
296
+
297
+
298
+
299
+
300
+ </h3><div class="docstring">
301
+ <div class="discussion">
302
+
303
+ <p>Attempts to return arbitrary key values for the key
304
+ <code>key</code> for the current target.</p>
305
+
306
+
307
+ </div>
308
+ </div>
309
+ <div class="tags">
310
+ <p class="tag_title">Parameters:</p>
311
+ <ul class="param">
312
+
313
+ <li>
314
+
315
+ <span class='name'>key</span>
316
+
317
+
318
+ <span class='type'>(<tt>String</tt>, <tt>Symbol</tt>)</span>
319
+
320
+
321
+
322
+ &mdash;
323
+ <div class='inline'><p>Specifies the desired key
324
+ to look up.</p>
325
+ </div>
326
+
327
+ </li>
328
+
329
+ </ul>
330
+
331
+ <p class="tag_title">Returns:</p>
332
+ <ul class="return">
333
+
334
+ <li>
335
+
336
+
337
+ <span class='type'>(<tt>String</tt>, <tt>Nil</tt>)</span>
338
+
339
+
340
+
341
+ &mdash;
342
+ <div class='inline'><p>Returns the value for <code>key</code> in
343
+ the <code>:targets</code> structure, or <code>nil</code> if it doesn’t
344
+ exist.</p>
345
+ </div>
346
+
347
+ </li>
348
+
349
+ </ul>
350
+
351
+ </div>
352
+ </div>
353
+
354
+ </div>
@@ -0,0 +1,100 @@
1
+ <div id="instance_method_details" class="method_details_list">
2
+ <div class="method_details first ">
3
+ <h3 class="signature first" id="resource.targeted?-instance_method">
4
+
5
+ - (<tt>Boolean</tt>) <strong>resource.targeted?</strong>
6
+
7
+
8
+
9
+
10
+
11
+ </h3><div class="docstring">
12
+ <div class="discussion">
13
+
14
+ <p>Determines if the resource is eligible for inclusion
15
+ in the current target based on the front matter data
16
+ <code>target</code> and <code>exclude</code> fields.</p>
17
+
18
+ <ul>
19
+ <li>If <strong>frontmatter:target</strong> is used, the target or
20
+ feature appears in the frontmatter, and</li>
21
+ <li>If <strong>frontmatter:exclude</strong> is used, the target or
22
+ enabled feature does NOT appear in the
23
+ frontmatter</li>
24
+ </ul>
25
+
26
+ <p>In general you won’t use this resource method because
27
+ resources will already be excluded before you have a
28
+ chance to check them, and so any leftover resources
29
+ will always return <code>true</code> for this method.</p>
30
+
31
+
32
+ </div>
33
+ </div>
34
+ <div class="tags">
35
+
36
+ <p class="tag_title">Returns:</p>
37
+ <ul class="return">
38
+
39
+ <li>
40
+
41
+
42
+ <span class='type'>(<tt>Boolean</tt>)</span>
43
+
44
+
45
+
46
+ &mdash;
47
+ <div class='inline'><p>Returns a value indicating whether
48
+ or not this resource belongs in the current target.</p>
49
+ </div>
50
+
51
+ </li>
52
+
53
+ </ul>
54
+
55
+ </div>
56
+ </div>
57
+
58
+ <div class="method_details ">
59
+ <h3 class="signature " id="resource.valid_features-instance_method">
60
+
61
+ - (<tt>Array</tt>) <strong>resource.valid_features</strong>
62
+
63
+
64
+
65
+
66
+
67
+ </h3><div class="docstring">
68
+ <div class="discussion">
69
+
70
+ <p>Returns an array of valid features for a resource
71
+ based on the current target, i.e., features that
72
+ are true for the current target.</p>
73
+
74
+
75
+ </div>
76
+ </div>
77
+ <div class="tags">
78
+
79
+ <p class="tag_title">Returns:</p>
80
+ <ul class="return">
81
+
82
+ <li>
83
+
84
+
85
+ <span class='type'>(<tt>Array</tt>)</span>
86
+
87
+
88
+
89
+ &mdash;
90
+ <div class='inline'><p>Returns an array of features.</p>
91
+ </div>
92
+
93
+ </li>
94
+
95
+ </ul>
96
+
97
+ </div>
98
+ </div>
99
+
100
+ </div>