markdown_helper 0.2.1 → 0.2.2
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +73 -6
- data/images/html.png +0 -0
- data/lib/markdown_helper/version.rb +1 -1
- data/markdown_helper.gemspec +7 -1
- data/readme_files/README.template.md +43 -6
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d13b25bca8211a7b125220f43823d929aa063f18
|
4
|
+
data.tar.gz: 5abf171a884b8a945bd5a53b3c20db59eda73079
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d806efe553b5be7c0b029f1010f51a714d92399cd55e42ff54ccf8361cefa5f4daa7614ecfc4ec034aca729dd7248378de2288652947a30e6feda5dd762df865
|
7
|
+
data.tar.gz: c27d30e13ac8eb24b5c95b857c103c3b1c0dfe9c7907c68ecbf47b442b6622173d6ae4d05786821d3a0fb0d182cae09db83b79683b3c69e6886b584ef63c26cd
|
data/Gemfile.lock
CHANGED
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
|
88
|
+
#### Include Descriptions
|
88
89
|
|
89
|
-
Specify each file inclusion via an *include
|
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
|
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
|
158
|
+
#### Image Descriptions
|
158
159
|
|
159
|
-
Specify each image
|
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
|
+

|
175
|
+
|
176
|
+

|
177
|
+
|
178
|
+

|
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
|
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
|
data/markdown_helper.gemspec
CHANGED
@@ -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 =
|
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
|
51
|
+
#### Include Descriptions
|
51
52
|
|
52
|
-
Specify each file inclusion via an *include
|
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
|
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
|
91
|
+
#### Image Descriptions
|
91
92
|
|
92
|
-
Specify each image
|
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
|
+

|
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
|
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.
|
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:
|
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
|