markdown_helper 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95842873d7d0a15fbe01338a241d0e26e8426420
4
- data.tar.gz: f507e95dfbd4cf7ab169d7551d0663e99da5410c
3
+ metadata.gz: d13b25bca8211a7b125220f43823d929aa063f18
4
+ data.tar.gz: 5abf171a884b8a945bd5a53b3c20db59eda73079
5
5
  SHA512:
6
- metadata.gz: eb20e2c5abb5e62e3a02af6286863af515ec2b095c45045445cb36704f61753884144a4ea17612045419fef0a9182436e0f11d2f140d128549f4751410df9715
7
- data.tar.gz: 2e97cdc6a7e3389f8d4f84bda8ae2397885990ee5b8809062cfa30103d4ae6dbf28a3abcdecac7da3facd78969bb6345a218f814962f5d60e023d40127dc2324
6
+ metadata.gz: d806efe553b5be7c0b029f1010f51a714d92399cd55e42ff54ccf8361cefa5f4daa7614ecfc4ec034aca729dd7248378de2288652947a30e6feda5dd762df865
7
+ data.tar.gz: c27d30e13ac8eb24b5c95b857c103c3b1c0dfe9c7907c68ecbf47b442b6622173d6ae4d05786821d3a0fb0d182cae09db83b79683b3c69e6886b584ef63c26cd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- markdown_helper (0.2.1)
4
+ markdown_helper (0.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -6,6 +6,7 @@ Class <code>MarkdownHelper</code> supports:
6
6
 
7
7
  * [File inclusion](#file-inclusion): to include text from other files, as code-block or markdown.
8
8
  * [Image path resolution](#image-path-resolution): to resolve relative image paths to absolute URL paths (so they work even in gem documentation).
9
+ * [Image attributes](#image-attrubutes): image attributes are passed through to an HTML <code>img</code> tag.
9
10
 
10
11
  Next feature:
11
12
 
@@ -84,9 +85,9 @@ markdown_file_path = 'highlighted_ruby.md'
84
85
  markdown_helper.include(template_file_path, markdown_file_path)
85
86
  ```
86
87
 
87
- #### Include Pragmas
88
+ #### Include Descriptions
88
89
 
89
- Specify each file inclusion via an *include pragma*, which has the form:
90
+ Specify each file inclusion via an *include description*, which has the form:
90
91
 
91
92
  <code>@[</code>*format*<code>]\(</code>*relative_file_path*<code>)</code>
92
93
 
@@ -98,7 +99,7 @@ where:
98
99
  * <code>[:verbatim]</code>, to include text verbatim (to be rendered as markdown).
99
100
  * *relative_file_path* points to the file to be included.
100
101
 
101
- ##### Example Include Pragmas
102
+ ##### Example Include Descriptions
102
103
 
103
104
  <code>include.md</code>
104
105
  ```code_block
@@ -154,9 +155,75 @@ markdown_file_path = 'markdown.md'
154
155
  markdown_helper.resolve_image_urls(template_file_path, markdown_file_path)
155
156
  ```
156
157
 
157
- #### Image Pragmas
158
+ #### Image Descriptions
158
159
 
159
- Specify each image file via an *image pragma*, which has the form:
160
+ Specify each image via an *image description*, which has the form:
161
+
162
+ <code>![*alt_text*]\(</code>*relative_file_path* <code>|</code> *attributes*<code>)</code>
163
+
164
+ where:
165
+
166
+ * *alt_text* is the usual alt text for an HTML image.
167
+ * *relative_file_path* points to the file to be included.
168
+ * *attributes* specify image attributes. See [Image Attributes](#image-attributes) below.
169
+
170
+ ##### Example Image Descriptions
171
+
172
+ <code>resolve_image_urls.md</code>
173
+ ```code_block
174
+ ![my_alt](image/image.png)
175
+
176
+ ![my_alt](image/image.png | width=50)
177
+
178
+ ![my_alt](image/image.png| width=50 height=50)
179
+ ```
180
+
181
+ ## Image Attributes
182
+
183
+ <img src="https://raw.githubusercontent.com/BurdetteLamar/MarkdownHelper/master/images/html.png" alt="html_icon" width="50">
184
+
185
+ This markdown helper enables HTML image attributes in GitHub markdown [image descriptions](https://github.github.com/gfm/#image-description).
186
+
187
+ (Actually, this README file itself is built using image attributes.)
188
+
189
+ Use the markdown helper to add image attributes in a markdown (</code>.md</code>) file.
190
+
191
+ ### Usage
192
+
193
+ #### CLI
194
+
195
+ <code>resolve_image_urls.txt</code>
196
+ ```
197
+ Usage:
198
+
199
+ resolve_image_urls template_file_path markdown_file_page
200
+
201
+ where
202
+
203
+ * template_file_path is the path to an existing file.
204
+ * markdown_file_path is the path to a file to be created.
205
+
206
+ Typically:
207
+
208
+ * Both file types are .md.
209
+ * The template file contains image relative file paths. See README.md.
210
+ ```
211
+
212
+ #### API
213
+
214
+ <code>resolve_image_urls_usage.rb</code>
215
+ ```ruby
216
+ require 'markdown_helper'
217
+
218
+ markdown_helper = MarkdownHelper.new
219
+ template_file_path = 'template.md'
220
+ markdown_file_path = 'markdown.md'
221
+ markdown_helper.resolve_image_urls(template_file_path, markdown_file_path)
222
+ ```
223
+
224
+ #### Image Descriptions
225
+
226
+ Specify each image via an *image description*, which has the form:
160
227
 
161
228
  <code>![*alt_text*]\(</code>*relative_file_path* <code>|</code> *attributes*<code>)</code>
162
229
 
@@ -166,7 +233,7 @@ where:
166
233
  * *relative_file_path* points to the file to be included.
167
234
  * *attributes* are whitespace-separated name-value pairs in the form *name*<code>=</code>*value*. These are passed through to the generated <code>img</code> HTML element.
168
235
 
169
- ##### Example Image Pragmas
236
+ ##### Example Image Descriptions
170
237
 
171
238
  <code>resolve_image_urls.md</code>
172
239
  ```code_block
data/images/html.png ADDED
Binary file
@@ -1,3 +1,3 @@
1
1
  class MarkdownHelper
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
@@ -10,7 +10,13 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ['BurdetteLamar@Yahoo.com']
11
11
 
12
12
  spec.summary = 'Class to help with GitHub markdown.'
13
- spec.description = 'Class to help with GitHub markdown. So far: file inclusion.'
13
+ spec.description = <<-EOT
14
+ Class to help with GitHub markdown:
15
+
16
+ * File inclusion
17
+ * Image path resolution
18
+ * Image attributes
19
+ EOT
14
20
  spec.homepage = 'https://github.com/BurdetteLamar/MarkdownHelper'
15
21
  spec.license = 'MIT'
16
22
 
@@ -6,6 +6,7 @@ Class <code>MarkdownHelper</code> supports:
6
6
 
7
7
  * [File inclusion](#file-inclusion): to include text from other files, as code-block or markdown.
8
8
  * [Image path resolution](#image-path-resolution): to resolve relative image paths to absolute URL paths (so they work even in gem documentation).
9
+ * [Image attributes](#image-attrubutes): image attributes are passed through to an HTML <code>img</code> tag.
9
10
 
10
11
  Next feature:
11
12
 
@@ -47,9 +48,9 @@ Verbatim text is included unadorned. Most often, verbatim text is markdown to b
47
48
 
48
49
  @[ruby](include_usage.rb)
49
50
 
50
- #### Include Pragmas
51
+ #### Include Descriptions
51
52
 
52
- Specify each file inclusion via an *include pragma*, which has the form:
53
+ Specify each file inclusion via an *include description*, which has the form:
53
54
 
54
55
  <code>@[</code>*format*<code>]\(</code>*relative_file_path*<code>)</code>
55
56
 
@@ -61,7 +62,7 @@ where:
61
62
  * <code>[:verbatim]</code>, to include text verbatim (to be rendered as markdown).
62
63
  * *relative_file_path* points to the file to be included.
63
64
 
64
- ##### Example Include Pragmas
65
+ ##### Example Include Descriptions
65
66
 
66
67
  @[code_block](include.md)
67
68
 
@@ -87,9 +88,45 @@ This matters because when markdown becomes part of a Ruby gem, its images will h
87
88
 
88
89
  @[ruby](resolve_image_urls_usage.rb)
89
90
 
90
- #### Image Pragmas
91
+ #### Image Descriptions
91
92
 
92
- Specify each image file via an *image pragma*, which has the form:
93
+ Specify each image via an *image description*, which has the form:
94
+
95
+ <code>![*alt_text*]\(</code>*relative_file_path* <code>|</code> *attributes*<code>)</code>
96
+
97
+ where:
98
+
99
+ * *alt_text* is the usual alt text for an HTML image.
100
+ * *relative_file_path* points to the file to be included.
101
+ * *attributes* specify image attributes. See [Image Attributes](#image-attributes) below.
102
+
103
+ ##### Example Image Descriptions
104
+
105
+ @[code_block](resolve_image_urls.md)
106
+
107
+ ## Image Attributes
108
+
109
+ ![html_icon](images/html.png | width=50)
110
+
111
+ This markdown helper enables HTML image attributes in GitHub markdown [image descriptions](https://github.github.com/gfm/#image-description).
112
+
113
+ (Actually, this README file itself is built using image attributes.)
114
+
115
+ Use the markdown helper to add image attributes in a markdown (</code>.md</code>) file.
116
+
117
+ ### Usage
118
+
119
+ #### CLI
120
+
121
+ @[:code_block](../bin/usage/resolve_image_urls.txt)
122
+
123
+ #### API
124
+
125
+ @[ruby](resolve_image_urls_usage.rb)
126
+
127
+ #### Image Descriptions
128
+
129
+ Specify each image via an *image description*, which has the form:
93
130
 
94
131
  <code>![*alt_text*]\(</code>*relative_file_path* <code>|</code> *attributes*<code>)</code>
95
132
 
@@ -99,7 +136,7 @@ where:
99
136
  * *relative_file_path* points to the file to be included.
100
137
  * *attributes* are whitespace-separated name-value pairs in the form *name*<code>=</code>*value*. These are passed through to the generated <code>img</code> HTML element.
101
138
 
102
- ##### Example Image Pragmas
139
+ ##### Example Image Descriptions
103
140
 
104
141
  @[code_block](resolve_image_urls.md)
105
142
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markdown_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - burdettelamar
@@ -66,7 +66,12 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.3'
69
- description: 'Class to help with GitHub markdown. So far: file inclusion.'
69
+ description: |
70
+ Class to help with GitHub markdown:
71
+
72
+ * File inclusion
73
+ * Image path resolution
74
+ * Image attributes
70
75
  email:
71
76
  - BurdetteLamar@Yahoo.com
72
77
  executables: []
@@ -88,6 +93,7 @@ files:
88
93
  - bin/setup
89
94
  - bin/usage/include.txt
90
95
  - bin/usage/resolve_image_urls.txt
96
+ - images/html.png
91
97
  - images/image.png
92
98
  - images/include.png
93
99
  - images_resolved.md