middlemac-extras 1.0.6 → 1.0.11
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 +5 -5
- data/.gitattributes +4 -0
- data/.gitignore +8 -1
- data/.yardopts +7 -0
- data/CHANGELOG.md +55 -9
- data/Rakefile +206 -7
- data/documentation_project/Gemfile +3 -3
- data/documentation_project/config.rb +2 -6
- data/documentation_project/source/api_reference.html.md.erb +38 -0
- data/documentation_project/source/cli.html.md.erb +4 -3
- data/documentation_project/source/config_rb.html.md.erb +1 -2
- data/documentation_project/source/css_image_sizes.html.md.erb +2 -3
- data/documentation_project/source/image_tag.html.md.erb +1 -2
- data/documentation_project/source/index.html.md.erb +8 -7
- data/documentation_project/source/license.html.md.erb +1 -2
- data/documentation_project/source/md_images.html.md.erb +1 -2
- data/documentation_project/source/md_links.html.md.erb +1 -2
- data/documentation_project/source/partials/_yard_config.erb +200 -0
- data/documentation_project/source/partials/_yard_helpers.erb +192 -0
- data/documentation_project/source/partials/_yard_helpers_extended.erb +135 -0
- data/documentation_project/source/stylesheets/_middlemac_minimal.scss +281 -0
- data/features/helpers.feature +39 -0
- data/features/support/env.rb +20 -0
- data/fixtures/middlemac_extras_app/config.rb +7 -0
- data/fixtures/middlemac_extras_app/source/images/middlemac-extras-small.png +0 -0
- data/fixtures/middlemac_extras_app/source/images/middlemac-extras-small@2x.png +0 -0
- data/fixtures/middlemac_extras_app/source/images/middlemac-extras-smaller.png +0 -0
- data/fixtures/middlemac_extras_app/source/index.html.md.erb +31 -0
- data/lib/middlemac-extras/extension.rb +187 -61
- data/lib/middlemac-extras/version.rb +1 -1
- data/middlemac-extras.gemspec +44 -17
- data/yard/readme.md +6 -0
- data/yard/template-grouped/default/module/html/method_details_list.erb +11 -0
- data/yard/template-partials/default/method_details/setup.rb +4 -0
- data/yard/template-partials/default/module/html/attribute_details.erb +9 -0
- data/yard/template-partials/default/module/html/method_details_list.erb +10 -0
- data/yard/template-partials/default/module/setup.rb +6 -0
- data/yard/template-partials/default/onefile/html/layout.erb +1 -0
- data/yard/template-partials/default/onefile/html/setup.rb +4 -0
- data/yard/yard_extensions.rb +109 -0
- metadata +118 -23
@@ -4,8 +4,6 @@ blurb: Use the <code>css_image_sizes</code> helper to specify maximum sizes
|
|
4
4
|
for all of your project’s images without using unsemantic width and
|
5
5
|
height attributes in your HTML code.
|
6
6
|
layout: template-logo-medium
|
7
|
-
order: 40
|
8
|
-
navigate: false
|
9
7
|
---
|
10
8
|
|
11
9
|
<%= md_links %>
|
@@ -16,6 +14,7 @@ navigate: false
|
|
16
14
|
<li><a href="md_images.html">The <code>md_images</code> helper</a></li>
|
17
15
|
<li><a href="md_links.html">The <code>md_links</code> helper</a></li>
|
18
16
|
<li><a href="config_rb.html">Setting up <code>config.rb</code></a></li>
|
17
|
+
<li><a href="api_reference.html">API Reference</a></li>
|
19
18
|
<li><a href="cli.html">Command line interface</a></li>
|
20
19
|
<li><a href="license.html">The MIT License</a></li>
|
21
20
|
</ul>
|
@@ -45,7 +44,7 @@ When called like this:
|
|
45
44
|
|
46
45
|
You could use this in an HTML `<style>` element on each of your pages, or better
|
47
46
|
yet in your layouts. This has the unfortunate effect of including it in every
|
48
|
-
one of your pages, however, and so this sample project uses like this:
|
47
|
+
one of your pages, however, and so this sample project uses it like this:
|
49
48
|
|
50
49
|
Contents of `stylesheets/css_image_sizes.css.erb`:
|
51
50
|
|
@@ -3,8 +3,6 @@ title: The <code>image_tag</code> helper
|
|
3
3
|
blurb: Find out how to use the enhanced <code>image_tag</code> helper so that
|
4
4
|
it can be even more helpful.
|
5
5
|
layout: template-logo-medium
|
6
|
-
order: 40
|
7
|
-
navigate: false
|
8
6
|
---
|
9
7
|
|
10
8
|
<%= md_links %>
|
@@ -15,6 +13,7 @@ navigate: false
|
|
15
13
|
<li><a href="md_images.html">The <code>md_images</code> helper</a></li>
|
16
14
|
<li><a href="md_links.html">The <code>md_links</code> helper</a></li>
|
17
15
|
<li><a href="config_rb.html">Setting up <code>config.rb</code></a></li>
|
16
|
+
<li><a href="api_reference.html">API Reference</a></li>
|
18
17
|
<li><a href="cli.html">Command line interface</a></li>
|
19
18
|
<li><a href="license.html">The MIT License</a></li>
|
20
19
|
</ul>
|
@@ -2,7 +2,6 @@
|
|
2
2
|
title: Welcome to <code>middlemac-extras</code>
|
3
3
|
blurb: <em>middlemac-extras</em> adds several developer conveniences.
|
4
4
|
layout: template-logo-large
|
5
|
-
navigate: false
|
6
5
|
---
|
7
6
|
|
8
7
|
<%= md_links %>
|
@@ -10,12 +9,10 @@ navigate: false
|
|
10
9
|
# <%= current_page.data.title %>
|
11
10
|
|
12
11
|
Although developed for **Middlemac**, the `middlemac-extras` extension for
|
13
|
-
Middleman is a great way to add handy developer conveniences to your
|
14
|
-
project.
|
15
|
-
|
16
|
-
|
17
|
-
**MiddleMac** but are generic enough that they can be used with any Middleman
|
18
|
-
project.
|
12
|
+
**Middleman** is a great way to add handy developer conveniences to your
|
13
|
+
**Middleman** project. It serves as a truly “extra” extension that gathers
|
14
|
+
utilities intended for **MiddleMac** but are generic enough that they can be
|
15
|
+
used with any **Middleman** project.
|
19
16
|
|
20
17
|
This extension currently offers features such as these:
|
21
18
|
|
@@ -48,6 +45,10 @@ This extension currently offers features such as these:
|
|
48
45
|
|
49
46
|
[Setting up `config.rb`][config_rb]
|
50
47
|
: Review the key configuration values for making this extension work.
|
48
|
+
|
49
|
+
[API Reference][api_reference]
|
50
|
+
: Look at the API documentation for the helpers and configuration settings
|
51
|
+
directly.
|
51
52
|
|
52
53
|
[Command Line Interface][cli]
|
53
54
|
: This gem offers a simple command line interface for building its own
|
@@ -2,8 +2,6 @@
|
|
2
2
|
title: The MIT License
|
3
3
|
blurb: Describes your legal rights and obligations for using these materials.
|
4
4
|
layout: template-logo-medium
|
5
|
-
order: 40
|
6
|
-
navigate: false
|
7
5
|
---
|
8
6
|
|
9
7
|
<%= md_links %>
|
@@ -15,6 +13,7 @@ navigate: false
|
|
15
13
|
<li><a href="md_images.html">The <code>md_images</code> helper</a></li>
|
16
14
|
<li><a href="md_links.html">The <code>md_links</code> helper</a></li>
|
17
15
|
<li><a href="config_rb.html">Setting up <code>config.rb</code></a></li>
|
16
|
+
<li><a href="api_reference.html">API Reference</a></li>
|
18
17
|
<li><a href="cli.html">Command line interface</a></li>
|
19
18
|
</ul>
|
20
19
|
<% end %>
|
@@ -3,8 +3,6 @@ title: The <code>md_images</code> helper
|
|
3
3
|
blurb: Automatic Markdown reference style links for every image in your site
|
4
4
|
are available by using this helper.
|
5
5
|
layout: template-logo-medium
|
6
|
-
order: 40
|
7
|
-
navigate: false
|
8
6
|
---
|
9
7
|
|
10
8
|
<%= md_links %>
|
@@ -16,6 +14,7 @@ navigate: false
|
|
16
14
|
<li><a href="image_tag.html">The <code>image_tag</code> helper</a></li>
|
17
15
|
<li><a href="md_links.html">The <code>md_links</code> helper</a></li>
|
18
16
|
<li><a href="config_rb.html">Setting up <code>config.rb</code></a></li>
|
17
|
+
<li><a href="api_reference.html">API Reference</a></li>
|
19
18
|
<li><a href="cli.html">Command line interface</a></li>
|
20
19
|
<li><a href="license.html">The MIT License</a></li>
|
21
20
|
</ul>
|
@@ -4,8 +4,6 @@ blurb: The <code>md_links</code> helper can help you by providing Markdown
|
|
4
4
|
reference-style links (including title attributes) to every page in
|
5
5
|
your site.
|
6
6
|
layout: template-logo-medium
|
7
|
-
order: 40
|
8
|
-
navigate: false
|
9
7
|
---
|
10
8
|
|
11
9
|
<%= md_links %>
|
@@ -16,6 +14,7 @@ navigate: false
|
|
16
14
|
<li><a href="image_tag.html">The <code>image_tag</code> helper</a></li>
|
17
15
|
<li><a href="md_images.html">The <code>md_images</code> helper</a></li>
|
18
16
|
<li><a href="config_rb.html">Setting up <code>config.rb</code></a></li>
|
17
|
+
<li><a href="api_reference.html">API Reference</a></li>
|
19
18
|
<li><a href="cli.html">Command line interface</a></li>
|
20
19
|
<li><a href="license.html">The MIT License</a></li>
|
21
20
|
</ul>
|
@@ -0,0 +1,200 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
<div id="instance_attr_details" class="attr_details">
|
6
|
+
|
7
|
+
|
8
|
+
<span id="options[:img_auto_extensions]=-instance_method"></span>
|
9
|
+
<div class="method_details first">
|
10
|
+
<h3 class="signature first" id="options[:img_auto_extensions]=-instance_method">
|
11
|
+
|
12
|
+
#<strong>options[:img_auto_extensions]=</strong>(value) ⇒ <tt>Boolean</tt>
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
</h3><div class="docstring">
|
19
|
+
<div class="discussion">
|
20
|
+
<p>This option determines whether or not to support specifying images without
|
21
|
+
using a file name extension. If set to <code>true</code> then the <code>image_tag</code> helper
|
22
|
+
will work for images even if you don’t specify an extension, but only if a
|
23
|
+
file exists on disk that has one of the extensions in
|
24
|
+
<code>:img_auto_extensions_order</code>.</p>
|
25
|
+
|
26
|
+
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
<div class="tags">
|
30
|
+
<p class="tag_title">Parameters:</p>
|
31
|
+
<ul class="param">
|
32
|
+
|
33
|
+
<li>
|
34
|
+
|
35
|
+
<span class='name'>value</span>
|
36
|
+
|
37
|
+
|
38
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
—
|
43
|
+
<div class='inline'><p><code>true</code> or <code>false</code> to enable or disable this feature.</p>
|
44
|
+
</div>
|
45
|
+
|
46
|
+
</li>
|
47
|
+
|
48
|
+
</ul>
|
49
|
+
|
50
|
+
<p class="tag_title">Returns:</p>
|
51
|
+
<ul class="return">
|
52
|
+
|
53
|
+
<li>
|
54
|
+
|
55
|
+
|
56
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
—
|
61
|
+
<div class='inline'><p>Returns the current value of this option.</p>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
</li>
|
65
|
+
|
66
|
+
</ul>
|
67
|
+
|
68
|
+
</div>
|
69
|
+
</div>
|
70
|
+
|
71
|
+
|
72
|
+
<span id="options[:img_auto_extensions_order]=-instance_method"></span>
|
73
|
+
<div class="method_details ">
|
74
|
+
<h3 class="signature " id="options[:img_auto_extensions_order]=-instance_method">
|
75
|
+
|
76
|
+
#<strong>options[:img_auto_extensions_order]=</strong>(value) ⇒ <tt>Array<String></tt>
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
</h3><div class="docstring">
|
83
|
+
<div class="discussion">
|
84
|
+
<p>This option defines the eligible file name extensions and their precedence
|
85
|
+
when you specify an image without an extension using the <code>image_tag</code> helper.
|
86
|
+
Set this to an array of image file extensions in your desired order of
|
87
|
+
of precedence.</p>
|
88
|
+
|
89
|
+
|
90
|
+
</div>
|
91
|
+
</div>
|
92
|
+
<div class="tags">
|
93
|
+
<p class="tag_title">Parameters:</p>
|
94
|
+
<ul class="param">
|
95
|
+
|
96
|
+
<li>
|
97
|
+
|
98
|
+
<span class='name'>value</span>
|
99
|
+
|
100
|
+
|
101
|
+
<span class='type'>(<tt>Array<String></tt>)</span>
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
—
|
106
|
+
<div class='inline'><p>Set to an array of image extensions.</p>
|
107
|
+
</div>
|
108
|
+
|
109
|
+
</li>
|
110
|
+
|
111
|
+
</ul>
|
112
|
+
|
113
|
+
<p class="tag_title">Returns:</p>
|
114
|
+
<ul class="return">
|
115
|
+
|
116
|
+
<li>
|
117
|
+
|
118
|
+
|
119
|
+
<span class='type'>(<tt>Array<String></tt>)</span>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
—
|
124
|
+
<div class='inline'><p>Returns the current value of this option.</p>
|
125
|
+
</div>
|
126
|
+
|
127
|
+
</li>
|
128
|
+
|
129
|
+
</ul>
|
130
|
+
|
131
|
+
</div>
|
132
|
+
</div>
|
133
|
+
|
134
|
+
|
135
|
+
<span id="options[:retina_srcset]=-instance_method"></span>
|
136
|
+
<div class="method_details ">
|
137
|
+
<h3 class="signature " id="options[:retina_srcset]=-instance_method">
|
138
|
+
|
139
|
+
#<strong>options[:retina_srcset]=</strong>(value) ⇒ <tt>Boolean</tt>
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
</h3><div class="docstring">
|
146
|
+
<div class="discussion">
|
147
|
+
<p>This option determines whether or not the enhanced <code>image_tag</code> helper will
|
148
|
+
be used to include an @2x <code>srcset</code> attribute automatically. This automatic
|
149
|
+
behavior will only be applied if the image asset exists on disk and this
|
150
|
+
option is set to <code>true</code>.</p>
|
151
|
+
|
152
|
+
|
153
|
+
</div>
|
154
|
+
</div>
|
155
|
+
<div class="tags">
|
156
|
+
<p class="tag_title">Parameters:</p>
|
157
|
+
<ul class="param">
|
158
|
+
|
159
|
+
<li>
|
160
|
+
|
161
|
+
<span class='name'>value</span>
|
162
|
+
|
163
|
+
|
164
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
—
|
169
|
+
<div class='inline'><p><code>true</code> or <code>false</code> to enable or disable this feature.</p>
|
170
|
+
</div>
|
171
|
+
|
172
|
+
</li>
|
173
|
+
|
174
|
+
</ul>
|
175
|
+
|
176
|
+
<p class="tag_title">Returns:</p>
|
177
|
+
<ul class="return">
|
178
|
+
|
179
|
+
<li>
|
180
|
+
|
181
|
+
|
182
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
—
|
187
|
+
<div class='inline'><p>Returns the current value of this option.</p>
|
188
|
+
</div>
|
189
|
+
|
190
|
+
</li>
|
191
|
+
|
192
|
+
</ul>
|
193
|
+
|
194
|
+
</div>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
</div>
|
198
|
+
|
199
|
+
|
200
|
+
|
@@ -0,0 +1,192 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
<div class="method_details_list">
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
<div class="method_details first">
|
11
|
+
<h3 class="signature first" id="css_image_sizes-instance_method">
|
12
|
+
|
13
|
+
#<strong>css_image_sizes</strong> ⇒ <tt>String</tt>
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
</h3><div class="docstring">
|
20
|
+
<div class="discussion">
|
21
|
+
<p>This helper provides CSS for every image in your
|
22
|
+
project. Each image will have a declaration that sets
|
23
|
+
<code>max-width</code> and <code>max-height</code> to the actual size of the
|
24
|
+
image. Proper @2x image support is included. It’s most
|
25
|
+
useful to use this helper in a <code>some_file.css.erb</code>
|
26
|
+
file.</p>
|
27
|
+
|
28
|
+
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
<div class="tags">
|
32
|
+
|
33
|
+
<p class="tag_title">Returns:</p>
|
34
|
+
<ul class="return">
|
35
|
+
|
36
|
+
<li>
|
37
|
+
|
38
|
+
|
39
|
+
<span class='type'>(<tt>String</tt>)</span>
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
—
|
44
|
+
<div class='inline'><p>Returns a string with the CSS markup
|
45
|
+
for every image found in your project.</p>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
</li>
|
49
|
+
|
50
|
+
</ul>
|
51
|
+
|
52
|
+
</div>
|
53
|
+
</div>
|
54
|
+
|
55
|
+
<div class="method_details ">
|
56
|
+
<h3 class="signature " id="md_hblinks-instance_method">
|
57
|
+
|
58
|
+
#<strong>md_hblinks</strong> ⇒ <tt>String</tt>
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
</h3><div class="docstring">
|
65
|
+
<div class="discussion">
|
66
|
+
<p>This helper provides access to <code>middlemac-extras</code>’
|
67
|
+
index of links in Markdown reference format, enabling
|
68
|
+
you to use reference-style links in documents. Because
|
69
|
+
this helper includes literal Markdown, it’s only useful
|
70
|
+
in Markdown documents. This is only useful when using
|
71
|
+
Middlemac 3.0.0 or newer, which includes support for
|
72
|
+
helpbook style links.</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>String</tt>)</span>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
—
|
90
|
+
<div class='inline'><p>Returns a string with the Markdown
|
91
|
+
index of every page in your project.</p>
|
92
|
+
</div>
|
93
|
+
|
94
|
+
</li>
|
95
|
+
|
96
|
+
</ul>
|
97
|
+
|
98
|
+
</div>
|
99
|
+
</div>
|
100
|
+
|
101
|
+
<div class="method_details ">
|
102
|
+
<h3 class="signature " id="md_images-instance_method">
|
103
|
+
|
104
|
+
#<strong>md_images</strong> ⇒ <tt>String</tt>
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
</h3><div class="docstring">
|
111
|
+
<div class="discussion">
|
112
|
+
<p>This helper provides access to <code>middlemac-extras</code>’
|
113
|
+
index of images in Markdown reference format, enabling
|
114
|
+
you to use reference-style images in documents. Because
|
115
|
+
this helper includes literal Markdown, it’s only useful
|
116
|
+
in Markdown documents.</p>
|
117
|
+
|
118
|
+
|
119
|
+
</div>
|
120
|
+
</div>
|
121
|
+
<div class="tags">
|
122
|
+
|
123
|
+
<p class="tag_title">Returns:</p>
|
124
|
+
<ul class="return">
|
125
|
+
|
126
|
+
<li>
|
127
|
+
|
128
|
+
|
129
|
+
<span class='type'>(<tt>String</tt>)</span>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
—
|
134
|
+
<div class='inline'><p>Returns a string with the Markdown
|
135
|
+
index of every image in your project.</p>
|
136
|
+
</div>
|
137
|
+
|
138
|
+
</li>
|
139
|
+
|
140
|
+
</ul>
|
141
|
+
|
142
|
+
</div>
|
143
|
+
</div>
|
144
|
+
|
145
|
+
<div class="method_details ">
|
146
|
+
<h3 class="signature " id="md_links-instance_method">
|
147
|
+
|
148
|
+
#<strong>md_links</strong> ⇒ <tt>String</tt>
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
</h3><div class="docstring">
|
155
|
+
<div class="discussion">
|
156
|
+
<p>This helper provides access to <code>middlemac-extras</code>’
|
157
|
+
index of links in Markdown reference format, enabling
|
158
|
+
you to use reference-style links in documents. Because
|
159
|
+
this helper includes literal Markdown, it’s only useful
|
160
|
+
in Markdown documents.</p>
|
161
|
+
|
162
|
+
|
163
|
+
</div>
|
164
|
+
</div>
|
165
|
+
<div class="tags">
|
166
|
+
|
167
|
+
<p class="tag_title">Returns:</p>
|
168
|
+
<ul class="return">
|
169
|
+
|
170
|
+
<li>
|
171
|
+
|
172
|
+
|
173
|
+
<span class='type'>(<tt>String</tt>)</span>
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
—
|
178
|
+
<div class='inline'><p>Returns a string with the Markdown
|
179
|
+
index of every page in your project.</p>
|
180
|
+
</div>
|
181
|
+
|
182
|
+
</li>
|
183
|
+
|
184
|
+
</ul>
|
185
|
+
|
186
|
+
</div>
|
187
|
+
</div>
|
188
|
+
|
189
|
+
|
190
|
+
</div>
|
191
|
+
|
192
|
+
|