gmd 1.0.1 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +27 -0
- data/bin/gmd +11 -1
- data/lib/gmd/templates/default/layout.html.erb +79 -0
- data/lib/gmd/templates/github/layout.html.erb +26 -0
- data/lib/gmd/templates/github/style.css +353 -0
- data/lib/gmd/templates/metal/layout.html.erb +40 -0
- data/lib/gmd/version.rb +1 -1
- data/lib/gmd.rb +20 -3
- metadata +9 -6
- data/lib/gmd/templates/default.html.erb +0 -74
data/README.md
CHANGED
@@ -1,7 +1,34 @@
|
|
1
1
|
gmd
|
2
2
|
===
|
3
3
|
|
4
|
+
|
4
5
|
What is it?
|
5
6
|
-----------
|
6
7
|
|
7
8
|
gmd is a small command-line utility to easily generate fancy HTML from Markdown.
|
9
|
+
|
10
|
+
|
11
|
+
Installation
|
12
|
+
------------
|
13
|
+
|
14
|
+
$ [sudo] gem install gmd
|
15
|
+
|
16
|
+
|
17
|
+
Usage
|
18
|
+
-----
|
19
|
+
|
20
|
+
$ gmd text.md
|
21
|
+
|
22
|
+
Will generate HTML from the `text.md` and save it to `text.html`.
|
23
|
+
|
24
|
+
$ gmd text.md -l <layout>
|
25
|
+
|
26
|
+
Will generate and save HTML from the `text.md` using specified layout.
|
27
|
+
|
28
|
+
Built-in layouts:
|
29
|
+
|
30
|
+
+ *default*
|
31
|
+
+ *github* - something similar to new GitHub style
|
32
|
+
+ *metal* - something like older GitHub style
|
33
|
+
|
34
|
+
Actually, the deafult style is also (a very very old) GitHub style ;)
|
data/bin/gmd
CHANGED
@@ -54,7 +54,17 @@ locals = {}
|
|
54
54
|
|
55
55
|
# output = Tilt.new(file).render(self, locals)
|
56
56
|
# Use redcarpet here directly
|
57
|
-
output = Redcarpet::Markdown.new(Redcarpet::Render::HTML
|
57
|
+
output = Redcarpet::Markdown.new(Redcarpet::Render::HTML,
|
58
|
+
:no_intra_emphasis => true,
|
59
|
+
:tables => true,
|
60
|
+
:fenced_code_blocks => true,
|
61
|
+
:autolink => true,
|
62
|
+
:strikethrough => true,
|
63
|
+
:lax_html_blocks => true,
|
64
|
+
:space_after_headers => true,
|
65
|
+
:superscript => true
|
66
|
+
).render(File.read(file))
|
67
|
+
|
58
68
|
output = Tilt.new(layout).render(self, locals) { output } if layout
|
59
69
|
|
60
70
|
File.open(output_file, "wb") { |f| f.write(output) }
|
@@ -0,0 +1,79 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
4
|
+
<%= Gmd.layout_meta_tags %>
|
5
|
+
<script type="text/javascript"><%= File.read(File.dirname(__FILE__) + "/../common/highlight_js/highlight.pack.js") %></script>
|
6
|
+
<style><%= File.read(File.dirname(__FILE__) + "/../common/highlight_js/github.css") %></style>
|
7
|
+
<style>
|
8
|
+
/*
|
9
|
+
Some simple Github-like styles.
|
10
|
+
*/
|
11
|
+
body{
|
12
|
+
font-family: helvetica, arial, freesans, clean, sans-serif;
|
13
|
+
color: #333;
|
14
|
+
background-color: #fff;
|
15
|
+
border: none;
|
16
|
+
line-height: 1.5;
|
17
|
+
margin: 2em 3em;
|
18
|
+
text-align:left;
|
19
|
+
}
|
20
|
+
pre{
|
21
|
+
background-color: #eee;
|
22
|
+
padding: 10px;
|
23
|
+
-webkit-border-radius: 5px;
|
24
|
+
-moz-border-radius: 5px;
|
25
|
+
border-radius: 5px;
|
26
|
+
overflow: auto;
|
27
|
+
}
|
28
|
+
code{
|
29
|
+
background-color: #eee;
|
30
|
+
padding: 1px 3px;
|
31
|
+
-webkit-border-radius: 2px;
|
32
|
+
-moz-border-radius: 2px;
|
33
|
+
border-radius: 2px;
|
34
|
+
}
|
35
|
+
li p{
|
36
|
+
margin: 0.3em;
|
37
|
+
}
|
38
|
+
li{
|
39
|
+
list-style-type: disc;
|
40
|
+
}
|
41
|
+
a:link, a:visited{
|
42
|
+
color: #33e;
|
43
|
+
text-decoration: none;
|
44
|
+
}
|
45
|
+
a:hover{
|
46
|
+
color: #00f;
|
47
|
+
text-shadow:1px 1px 2px #ccf;
|
48
|
+
text-decoration:underline;
|
49
|
+
}
|
50
|
+
h1{
|
51
|
+
color: #999;
|
52
|
+
font-weight: bold;
|
53
|
+
}
|
54
|
+
h2{
|
55
|
+
border-bottom: 1px dotted #aaa;
|
56
|
+
margin-bottom: 1em;
|
57
|
+
color: #333;
|
58
|
+
}
|
59
|
+
h3{
|
60
|
+
color: #666;
|
61
|
+
}
|
62
|
+
.shadow{
|
63
|
+
-webkit-box-shadow:0 5px 15px #000;
|
64
|
+
-moz-box-shadow:0 5px 15px #000;
|
65
|
+
box-shadow:0 5px 15px #000;
|
66
|
+
}
|
67
|
+
pre code {
|
68
|
+
background: #f8f8ff;
|
69
|
+
color: #000;
|
70
|
+
}
|
71
|
+
</style>
|
72
|
+
<script type="text/javascript">
|
73
|
+
hljs.initHighlightingOnLoad();
|
74
|
+
</script>
|
75
|
+
</head>
|
76
|
+
<body>
|
77
|
+
<%= yield %>
|
78
|
+
</body>
|
79
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
4
|
+
<%= Gmd.layout_meta_tags %>
|
5
|
+
<script type="text/javascript"><%= File.read(File.dirname(__FILE__) + "/../common/highlight_js/highlight.pack.js") %></script>
|
6
|
+
<style><%= File.read(File.dirname(__FILE__) + "/../common/highlight_js/github.css") %></style>
|
7
|
+
<style>
|
8
|
+
<%= File.read(File.dirname(__FILE__) + "/style.css") %>
|
9
|
+
</style>
|
10
|
+
</script>
|
11
|
+
<script type="text/javascript">
|
12
|
+
hljs.initHighlightingOnLoad();
|
13
|
+
</script>
|
14
|
+
</head>
|
15
|
+
<body>
|
16
|
+
<div id="wrapper">
|
17
|
+
<div id="content" class="site">
|
18
|
+
<div class="content">
|
19
|
+
|
20
|
+
<%= yield %>
|
21
|
+
|
22
|
+
</div><!-- /.content -->
|
23
|
+
</div><!--/#content .site -->
|
24
|
+
</div><!-- /#wrapper -->
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,353 @@
|
|
1
|
+
/*------------------------------------------------------------------------------
|
2
|
+
Global Documentation Styles
|
3
|
+
------------------------------------------------------------------------------*/
|
4
|
+
|
5
|
+
html {
|
6
|
+
height:100%;
|
7
|
+
}
|
8
|
+
|
9
|
+
body {
|
10
|
+
font: 13px helvetica,arial,freesans,clean,sans-serif;
|
11
|
+
line-height: 1.4em;
|
12
|
+
background-color: #fff;
|
13
|
+
color: #393939;
|
14
|
+
margin: 0px;
|
15
|
+
padding: 0px;
|
16
|
+
height: 100%;
|
17
|
+
}
|
18
|
+
|
19
|
+
p {
|
20
|
+
margin: 1em 0;
|
21
|
+
}
|
22
|
+
|
23
|
+
h1 {
|
24
|
+
font-size: 20px;
|
25
|
+
border-bottom: 1px solid #cccccc;
|
26
|
+
padding: .5em 0;
|
27
|
+
margin: 2em 0 1em;
|
28
|
+
}
|
29
|
+
|
30
|
+
h1:first-child {
|
31
|
+
margin: 0 0 1em;
|
32
|
+
}
|
33
|
+
|
34
|
+
h2 {
|
35
|
+
font-size: 16px;
|
36
|
+
color: #333;
|
37
|
+
margin: 2em auto 1em;
|
38
|
+
}
|
39
|
+
|
40
|
+
body.api .content h2 {
|
41
|
+
background: transparent url(../images/crud-sprite.png) left 2px no-repeat;
|
42
|
+
padding-left: 22px;
|
43
|
+
}
|
44
|
+
|
45
|
+
h2 span.step {
|
46
|
+
color: #666;
|
47
|
+
}
|
48
|
+
|
49
|
+
h3 {
|
50
|
+
font-size: 14px;
|
51
|
+
color: #333;
|
52
|
+
margin: 1.5em 0 .5em;
|
53
|
+
}
|
54
|
+
|
55
|
+
h5 {
|
56
|
+
font-size: 13px;
|
57
|
+
}
|
58
|
+
|
59
|
+
h6 {
|
60
|
+
font-size: 13px;
|
61
|
+
color: #666;
|
62
|
+
}
|
63
|
+
|
64
|
+
a {
|
65
|
+
color: #4183C4;
|
66
|
+
text-decoration: none;
|
67
|
+
}
|
68
|
+
|
69
|
+
a:hover,
|
70
|
+
a:active {
|
71
|
+
text-decoration:underline;
|
72
|
+
}
|
73
|
+
|
74
|
+
blockquote {
|
75
|
+
margin:0 -5px;
|
76
|
+
padding: 0px 20px;
|
77
|
+
}
|
78
|
+
|
79
|
+
ul,
|
80
|
+
ol {
|
81
|
+
margin: 0px;
|
82
|
+
padding: 0px;
|
83
|
+
}
|
84
|
+
|
85
|
+
dt {
|
86
|
+
font-weight: bold;
|
87
|
+
}
|
88
|
+
|
89
|
+
dd {
|
90
|
+
padding-left: 1em;
|
91
|
+
margin-bottom: 1em;
|
92
|
+
}
|
93
|
+
|
94
|
+
dd + dd {
|
95
|
+
margin-bottom: 0;
|
96
|
+
}
|
97
|
+
|
98
|
+
span.attention,
|
99
|
+
p.attention {
|
100
|
+
color: #e98400;
|
101
|
+
font-style: italic;
|
102
|
+
}
|
103
|
+
|
104
|
+
a img {
|
105
|
+
border: 0px;
|
106
|
+
}
|
107
|
+
|
108
|
+
/* @end */
|
109
|
+
|
110
|
+
|
111
|
+
/*------------------------------------------------------------------------------
|
112
|
+
Not Footer
|
113
|
+
------------------------------------------------------------------------------*/
|
114
|
+
#wrapper {
|
115
|
+
padding: 20px 25px;
|
116
|
+
overflow:hidden;
|
117
|
+
height: auto;
|
118
|
+
/*margin: 2em 3em;*/
|
119
|
+
}
|
120
|
+
|
121
|
+
.content {
|
122
|
+
position: relative;
|
123
|
+
float: left;
|
124
|
+
color: #393939;
|
125
|
+
z-index: 2;
|
126
|
+
}
|
127
|
+
|
128
|
+
.content dl {
|
129
|
+
margin-left: 10px;
|
130
|
+
}
|
131
|
+
|
132
|
+
.content dt {
|
133
|
+
color: #666;
|
134
|
+
}
|
135
|
+
|
136
|
+
.content ul,
|
137
|
+
.content ol {
|
138
|
+
margin-left: 1.5em;
|
139
|
+
}
|
140
|
+
|
141
|
+
.content ul {
|
142
|
+
list-style-type: disc;
|
143
|
+
}
|
144
|
+
|
145
|
+
.content img {
|
146
|
+
max-width: 100%;
|
147
|
+
border: 1px solid #dddddd;
|
148
|
+
-webkit-box-shadow: 1px 1px 3px #ddd;
|
149
|
+
-moz-box-shadow: 1px 1px 3px #ddd;
|
150
|
+
box-shadow: 1px 1px 3px #ddd;
|
151
|
+
}
|
152
|
+
|
153
|
+
|
154
|
+
.content .description {
|
155
|
+
margin-left: 20px;
|
156
|
+
}
|
157
|
+
|
158
|
+
.content .verseblock-content {
|
159
|
+
padding: 3px;
|
160
|
+
}
|
161
|
+
|
162
|
+
.content .verseblock-content,
|
163
|
+
.content .sectionbody .dlist dt,
|
164
|
+
.content p > tt,
|
165
|
+
.content dl code,
|
166
|
+
.content ul code,
|
167
|
+
p code {
|
168
|
+
font: 12px Monaco,"Courier New","DejaVu Sans Mono","Bitstream Vera Sans Mono",monospace;
|
169
|
+
color: #52595d;
|
170
|
+
-webkit-border-radius: 3px;
|
171
|
+
-moz-border-radius: 3px;
|
172
|
+
border-radius: 3px;
|
173
|
+
-moz-background-clip: padding;
|
174
|
+
-webkit-background-clip: padding-box;
|
175
|
+
background-clip: padding-box;
|
176
|
+
border: 1px solid #ccc;
|
177
|
+
background-color: #f9f9f9;
|
178
|
+
padding: 0px 3px;
|
179
|
+
display: inline-block;
|
180
|
+
}
|
181
|
+
|
182
|
+
.content .sectionbody .dlist dt {
|
183
|
+
margin-top: 10px;
|
184
|
+
}
|
185
|
+
|
186
|
+
.content .verseblock-content {
|
187
|
+
padding: 3px;
|
188
|
+
}
|
189
|
+
|
190
|
+
.content .intro {
|
191
|
+
color: #868686;
|
192
|
+
}
|
193
|
+
/* @end */
|
194
|
+
|
195
|
+
/*------------------------------------------------------------------------------
|
196
|
+
Pre/Code Styles
|
197
|
+
------------------------------------------------------------------------------*/
|
198
|
+
|
199
|
+
code {white-space: nowrap;}
|
200
|
+
|
201
|
+
pre {
|
202
|
+
border: 1px solid #cacaca;
|
203
|
+
line-height: 1.2em;
|
204
|
+
font: 12px Monaco,"Courier New","DejaVu Sans Mono","Bitstream Vera Sans Mono",monospace;
|
205
|
+
padding: 10px;
|
206
|
+
overflow:auto;
|
207
|
+
-webkit-border-radius: 3px;
|
208
|
+
-moz-border-radius: 3px;
|
209
|
+
border-radius: 3px;
|
210
|
+
-moz-background-clip: padding;
|
211
|
+
-webkit-background-clip: padding-box;
|
212
|
+
background-clip: padding-box;
|
213
|
+
background-color: #FAFAFB;
|
214
|
+
color: #393939;
|
215
|
+
margin: 0px;
|
216
|
+
}
|
217
|
+
|
218
|
+
ul + pre {
|
219
|
+
margin-top: 1em;
|
220
|
+
}
|
221
|
+
|
222
|
+
pre code {white-space: pre;}
|
223
|
+
|
224
|
+
pre code {padding: 0;}
|
225
|
+
|
226
|
+
pre span.comment {color: #aaa;}
|
227
|
+
|
228
|
+
pre.headers {
|
229
|
+
margin-bottom: 0;
|
230
|
+
border-bottom-width: 0;
|
231
|
+
-webkit-border-radius: 3px 3px 0 0;
|
232
|
+
-moz-border-radius: 3px 3px 0 0;
|
233
|
+
border-radius: 3px 3px 0 0;
|
234
|
+
color: #666;
|
235
|
+
background-color: #f1f1f1;
|
236
|
+
background-image: -moz-linear-gradient(top, #f1f1f1, #e1e1e1);
|
237
|
+
background-image: -ms-linear-gradient(top, #f1f1f1, #e1e1e1);
|
238
|
+
background-image: -o-linear-gradient(top, #f1f1f1, #e1e1e1);
|
239
|
+
background-image: -webkit-gradient(linear, left top, left bottom, from(#f1f1f1), to(#e1e1e1));
|
240
|
+
background-image: -webkit-linear-gradient(top, #f1f1f1, #e1e1e1);
|
241
|
+
background-image: linear-gradient(top, #f1f1f1, #e1e1e1);
|
242
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f1f1f1', EndColorStr='#e1e1e1');
|
243
|
+
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
|
244
|
+
}
|
245
|
+
|
246
|
+
pre.no-response {
|
247
|
+
-webkit-border-radius: 3px 3px;
|
248
|
+
-moz-border-radius: 3px 3px;
|
249
|
+
border-radius: 3px 3px;
|
250
|
+
border-bottom: 1px solid #CACACA;
|
251
|
+
}
|
252
|
+
|
253
|
+
pre.headers + pre.highlight {
|
254
|
+
-webkit-border-radius: 0 0 3px 3px;
|
255
|
+
-moz-border-radius: 0 0 3px 3px;
|
256
|
+
border-radius: 0 0 3px 3px;
|
257
|
+
}
|
258
|
+
|
259
|
+
pre.highlight {
|
260
|
+
-webkit-border-radius:3px;
|
261
|
+
-moz-border-radius:3px;
|
262
|
+
border-radius:3px;
|
263
|
+
background-color: #FAFAFB;
|
264
|
+
}
|
265
|
+
|
266
|
+
pre.terminal {
|
267
|
+
background-color: #444;
|
268
|
+
color: #fff;
|
269
|
+
-webkit-border-radius: 3px;
|
270
|
+
-moz-border-radius: 3px;
|
271
|
+
border-radius: 3px;
|
272
|
+
-moz-background-clip: padding;
|
273
|
+
-webkit-background-clip: padding-box;
|
274
|
+
background-clip: padding-box;
|
275
|
+
border: 2px solid #DEDEDE;
|
276
|
+
position: relative;
|
277
|
+
padding: 10px;
|
278
|
+
text-shadow: none;
|
279
|
+
background-image: none;
|
280
|
+
filter: none;
|
281
|
+
}
|
282
|
+
|
283
|
+
pre.terminal em {
|
284
|
+
color: #f9fe64;
|
285
|
+
}
|
286
|
+
|
287
|
+
span.codeline {
|
288
|
+
display: block;
|
289
|
+
position: relative;
|
290
|
+
}
|
291
|
+
|
292
|
+
span.codeline:hover {
|
293
|
+
background-color: #292929;
|
294
|
+
margin: 0px;
|
295
|
+
padding-left: 3px;
|
296
|
+
margin-left: -3px;
|
297
|
+
-webkit-border-radius: 3px;
|
298
|
+
-moz-border-radius: 3px;
|
299
|
+
border-radius: 3px;
|
300
|
+
color: #666666;
|
301
|
+
}
|
302
|
+
|
303
|
+
span.codeline span {
|
304
|
+
display: inline-block;
|
305
|
+
font-size: 10px;
|
306
|
+
color: #fff;
|
307
|
+
padding: 0 0.3em 0.05em;
|
308
|
+
position: absolute;
|
309
|
+
right: 0px;
|
310
|
+
top: 0px;
|
311
|
+
text-indent: -9999px;
|
312
|
+
background-image: url(../images/qmark.png);
|
313
|
+
background-repeat: no-repeat;
|
314
|
+
background-position: 1px 3px;
|
315
|
+
max-width: 8px;
|
316
|
+
min-width: 8px;
|
317
|
+
-moz-user-select: none;
|
318
|
+
-khtml-user-select: none;
|
319
|
+
user-select: none;
|
320
|
+
cursor: default;
|
321
|
+
}
|
322
|
+
|
323
|
+
span.codeline span:hover {
|
324
|
+
display: inline-block;
|
325
|
+
text-indent: 0px;
|
326
|
+
-webkit-border-radius: 3px;
|
327
|
+
-moz-border-radius: 3px;
|
328
|
+
border-radius: 3px;
|
329
|
+
background: #000;
|
330
|
+
border: 1px solid #292929;
|
331
|
+
max-width: 1000px;
|
332
|
+
}
|
333
|
+
|
334
|
+
span.codeline:hover em {
|
335
|
+
color: #666666;
|
336
|
+
}
|
337
|
+
|
338
|
+
pre.bootcamp {
|
339
|
+
white-space: normal;
|
340
|
+
margin-left: -10px;
|
341
|
+
background-image: none;
|
342
|
+
}
|
343
|
+
|
344
|
+
span.bash-output {
|
345
|
+
color: #63e463;
|
346
|
+
display: block;
|
347
|
+
position: relative;
|
348
|
+
-moz-user-select: none;
|
349
|
+
-khtml-user-select: none;
|
350
|
+
user-select: none;
|
351
|
+
}
|
352
|
+
|
353
|
+
/* end */
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
4
|
+
<%= Gmd.layout_meta_tags %>
|
5
|
+
<script type="text/javascript"><%= File.read(File.dirname(__FILE__) + "/../common/highlight_js/highlight.pack.js") %></script>
|
6
|
+
<style><%= File.read(File.dirname(__FILE__) + "/../common/highlight_js/github.css") %></style>
|
7
|
+
<style>
|
8
|
+
body {background-color:#f8f8f8;font-family:Helvetica;}
|
9
|
+
h1,h2,h3,h4,h5,h6{border:0;}
|
10
|
+
h1{font-size:170%;border-top:4px solid #aaa;padding-top:.5em;margin-top:1.5em;}
|
11
|
+
h1:first-child{margin-top:0;padding-top:.25em;border-top:none;}
|
12
|
+
h2{font-size:150%;margin-top:1.5em;border-top:4px solid #e0e0e0;padding-top:.5em;}
|
13
|
+
h3{margin-top:1em;}
|
14
|
+
p{margin:1em 0;line-height:1.5em;}
|
15
|
+
ul{margin:1em 0 1em 2em;}
|
16
|
+
ol{margin:1em 0 1em 2em;}
|
17
|
+
ul li{margin-top:.5em;margin-bottom:.5em;}
|
18
|
+
ul ul,ul ol,ol ol,ol ul,{margin-top:0;margin-bottom:0;}
|
19
|
+
blockquote{margin:1em 0;border-left:5px solid #ddd;padding-left:.6em;color:#555;}
|
20
|
+
dt{font-weight:bold;margin-left:1em;}
|
21
|
+
dd{margin-left:2em;margin-bottom:1em;}
|
22
|
+
table{margin:1em 0;}
|
23
|
+
table th{border-bottom:1px solid #bbb;padding:.2em 1em;}
|
24
|
+
table td{border-bottom:1px solid #ddd;padding:.2em 1em;}
|
25
|
+
pre{margin:1em 0;font-size:12px;background-color:#f8f8ff;border:1px solid #dedede;padding:.5em;line-height:1.5em;color:#444;overflow:auto;}
|
26
|
+
pre code{padding:0;font-size:12px;background-color:#f8f8ff;border:none;}
|
27
|
+
code{font-size:12px;background-color:#f8f8ff;color:#444;padding:0 .2em;border:1px solid #dedede;}
|
28
|
+
a{color:#4183c4;text-decoration:none;}
|
29
|
+
a:hover{text-decoration:underline;}
|
30
|
+
a code,a:link code,a:visited code{color:#4183c4;}
|
31
|
+
img{max-width:100%;}
|
32
|
+
</style>
|
33
|
+
<script type="text/javascript">
|
34
|
+
hljs.initHighlightingOnLoad();
|
35
|
+
</script>
|
36
|
+
</head>
|
37
|
+
<body>
|
38
|
+
<%= yield %>
|
39
|
+
</body>
|
40
|
+
</html>
|
data/lib/gmd/version.rb
CHANGED
data/lib/gmd.rb
CHANGED
@@ -9,15 +9,26 @@ module Gmd
|
|
9
9
|
def get_layout_paths(file)
|
10
10
|
[
|
11
11
|
file,
|
12
|
+
"#{file}.html.erb",
|
13
|
+
"#{file}/layout.html.erb",
|
12
14
|
"layout/#{file}",
|
15
|
+
"layout/#{file}.html.erb",
|
13
16
|
"layouts/#{file}",
|
17
|
+
"layouts/#{file}.html.erb",
|
18
|
+
"layouts/#{file}/layout.html.erb",
|
14
19
|
"~/.gmd/#{file}",
|
15
|
-
|
20
|
+
"~/.gmd/#{file}.html.erb",
|
21
|
+
"~/.gmd/#{file}/layout.html.erb",
|
22
|
+
File.join(default_layouts_dir, file),
|
23
|
+
File.join(default_layouts_dir, file + ".html.erb"),
|
24
|
+
File.join(default_layouts_dir, file + "/layout.html.erb"),
|
25
|
+
"~/.tilt/#{file}",
|
26
|
+
"/etc/tilt/#{file}"
|
16
27
|
]
|
17
28
|
end
|
18
29
|
|
19
30
|
def choose_file_from_paths(paths)
|
20
|
-
paths.map { |p| File.expand_path(p) }.find { |p| File.
|
31
|
+
paths.map { |p| File.expand_path(p) }.find { |p| File.file?(p) }
|
21
32
|
end
|
22
33
|
|
23
34
|
def default_layouts_dir
|
@@ -29,7 +40,13 @@ module Gmd
|
|
29
40
|
end
|
30
41
|
|
31
42
|
def default_layout
|
32
|
-
default_layouts_dir + "/default.html.erb"
|
43
|
+
default_layouts_dir + "/default/layout.html.erb"
|
44
|
+
end
|
45
|
+
|
46
|
+
def layout_meta_tags
|
47
|
+
<<-METATAGS
|
48
|
+
<meta name="generator" content="gmd #{Gmd::VERSION}">
|
49
|
+
METATAGS
|
33
50
|
end
|
34
51
|
|
35
52
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gmd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-01-14 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: redcarpet
|
16
|
-
requirement: &
|
16
|
+
requirement: &79720920 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *79720920
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: tilt
|
27
|
-
requirement: &
|
27
|
+
requirement: &79720560 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *79720560
|
36
36
|
description: gmd is a small command-line utility to easily generate fancy HTML from
|
37
37
|
Markdown.
|
38
38
|
email:
|
@@ -49,7 +49,10 @@ files:
|
|
49
49
|
- bin/gmd
|
50
50
|
- gmd.gemspec
|
51
51
|
- lib/gmd.rb
|
52
|
-
- lib/gmd/templates/default.html.erb
|
52
|
+
- lib/gmd/templates/default/layout.html.erb
|
53
|
+
- lib/gmd/templates/github/layout.html.erb
|
54
|
+
- lib/gmd/templates/github/style.css
|
55
|
+
- lib/gmd/templates/metal/layout.html.erb
|
53
56
|
- lib/gmd/version.rb
|
54
57
|
homepage: ''
|
55
58
|
licenses: []
|
@@ -1,74 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
4
|
-
<script src="http://yandex.st/highlightjs/6.1/highlight.min.js"></script>
|
5
|
-
<link rel="stylesheet" href="http://yandex.st/highlightjs/6.1/styles/default.min.css">
|
6
|
-
<style>
|
7
|
-
/*
|
8
|
-
Some simple Github-like styles.
|
9
|
-
*/
|
10
|
-
body{
|
11
|
-
font-family: helvetica, arial, freesans, clean, sans-serif;
|
12
|
-
color: #333;
|
13
|
-
background-color: #fff;
|
14
|
-
border: none;
|
15
|
-
line-height: 1.5;
|
16
|
-
margin: 2em 3em;
|
17
|
-
text-align:left;
|
18
|
-
}
|
19
|
-
pre{
|
20
|
-
background-color: #eee;
|
21
|
-
padding: 10px;
|
22
|
-
-webkit-border-radius: 5px;
|
23
|
-
-moz-border-radius: 5px;
|
24
|
-
border-radius: 5px;
|
25
|
-
overflow: auto;
|
26
|
-
}
|
27
|
-
code{
|
28
|
-
background-color: #eee;
|
29
|
-
padding: 1px 3px;
|
30
|
-
-webkit-border-radius: 2px;
|
31
|
-
-moz-border-radius: 2px;
|
32
|
-
border-radius: 2px;
|
33
|
-
}
|
34
|
-
li p{
|
35
|
-
margin: 0.3em;
|
36
|
-
}
|
37
|
-
li{
|
38
|
-
list-style-type: disc;
|
39
|
-
}
|
40
|
-
a:link, a:visited{
|
41
|
-
color: #33e;
|
42
|
-
text-decoration: none;
|
43
|
-
}
|
44
|
-
a:hover{
|
45
|
-
color: #00f;
|
46
|
-
text-shadow:1px 1px 2px #ccf;
|
47
|
-
text-decoration:underline;
|
48
|
-
}
|
49
|
-
h1{
|
50
|
-
color: #999;
|
51
|
-
font-weight: bold;
|
52
|
-
}
|
53
|
-
h2{
|
54
|
-
border-bottom: 1px dotted #aaa;
|
55
|
-
margin-bottom: 1em;
|
56
|
-
color: #333;
|
57
|
-
}
|
58
|
-
h3{
|
59
|
-
color: #666;
|
60
|
-
}
|
61
|
-
.shadow{
|
62
|
-
-webkit-box-shadow:0 5px 15px #000;
|
63
|
-
-moz-box-shadow:0 5px 15px #000;
|
64
|
-
box-shadow:0 5px 15px #000;
|
65
|
-
}
|
66
|
-
</style>
|
67
|
-
<script type="text/javascript">
|
68
|
-
hljs.initHighlightingOnLoad();
|
69
|
-
</script>
|
70
|
-
</head>
|
71
|
-
<body>
|
72
|
-
<%= yield %>
|
73
|
-
</body>
|
74
|
-
</html>
|