-
Notifications
You must be signed in to change notification settings - Fork 9
/
README.html
323 lines (254 loc) · 7.24 KB
/
README.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
<!-- Markdown Source -->
<!--
# md2html
My humble tool for converting Markdown files to nicely formatted HTML files without fuss. These can be nicer to use and share than plain text.
Run it using
./md2html README.md
md2html will create a file called *README.html*.
## Features
- Easy-to-use commandline call. Can be used, e.g. in conjuction with a file monitor, a script, or a Quicksilver action.
- One-file HTML output that displays on any computer.
- Preserves the original Markdown source in the generated file.
- Simple, pretty CSS. This is taken from [toland](https://github.com/toland/)'s [QLMarkdown](https://github.com/toland/qlmarkdown), although [most commits to the stylesheet](https://github.com/toland/qlmarkdown/blame/master/styles.css) seem to be by [jiho](https://github.com/jiho). Most of it seems to based on ``ADC'', presumably the [Apple Developer Connection](http://developer.apple.com/). As required by the QLMarkdown license, credits are included at the bottom.
## Dependencies
- [Markdown](http://daringfireball.net/projects/markdown/), of course.
## TODO
- Compile the HTML file from the source portion in-place. This is a bit tricky because the file is commonly being edited at the same time. Some editors don't handle this well.
## Use with Quicksilver
Create an Applescript file at "/Users/lgarron/Library/Application Support/Quicksilver/Actions/Markdown to HTML.scpt" with the code
on open theFile
set the_file to POSIX path of theFile
do shell script "[your path md2html] \"" & the_file & "\""
return null
end open
Make sure that your reference tomarkdown in md2html does not depend on parts of the PATH that are only available in the commandline shell.
## Credits
This product includes software developed by David Loren Parsons <http://www.pell.portland.or.us/~orc>-->
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<title>README.md [Generated]</title>
<style>
/* Taken from QLMarkdown: https://github.com/toland/qlmarkdown */
/* Extracted and interpreted from adcstyle.css and frameset_styles.css */
/* body */
body {
margin: 20px 40px;
background-color: #fff;
color: #000;
font: 13px "Myriad Pro", "Lucida Grande", Lucida, Verdana, sans-serif;
}
/* links */
a:link {
color: #00f;
text-decoration: none;
}
a:visited {
color: #00a;
text-decoration: none;
}
a:hover {
color: #f60;
text-decoration: underline;
}
a:active {
color: #f60;
text-decoration: underline;
}
/* html tags */
/* Work around IE/Win code size bug - courtesy Jesper, waffle.wootest.net */
* html code {
font-size: 101%;
}
* html pre {
font-size: 101%;
}
/* code */
pre, code {
font-size: 11px; font-family: monaco, courier, consolas, monospace;
}
pre {
margin-top: 5px;
margin-bottom: 10px;
border: 1px solid #c7cfd5;
background: #f1f5f9;
margin: 20px 0;
padding: 8px;
text-align: left;
}
hr {
color: #919699;
size: 1;
width: 100%;
noshade: "noshade"
}
/* headers */
h1, h2, h3, h4, h5, h6 {
font-family: "Myriad Pro", "Lucida Grande", Lucida, Verdana, sans-serif;
font-weight: bold;
}
h1 {
margin-top: 1em;
margin-bottom: 25px;
color: #000;
font-weight: bold;
font-size: 30px;
}
h2 {
margin-top: 2.5em;
font-size: 24px;
color: #000;
padding-bottom: 2px;
border-bottom: 1px solid #919699;
}
h3 {
margin-top: 2em;
margin-bottom: .5em;
font-size: 17px;
color: #000;
}
h4 {
margin-top: 2em;
margin-bottom: .5em;
font-size: 15px;
color: #000;
}
h5 {
margin-top: 20px;
margin-bottom: .5em;
padding: 0;
font-size: 13px;
color: #000;
}
h6 {
margin-top: 20px;
margin-bottom: .5em;
padding: 0;
font-size: 11px;
color: #000;
}
p {
margin-top: 0px;
margin-bottom: 10px;
}
/* lists */
ul {
list-style: square outside;
margin: 0 0 0 30px;
padding: 0 0 12px 6px;
}
li {
margin-top: 7px;
}
ol {
list-style-type: decimal;
list-style-position: outside;
margin: 0 0 0 30px;
padding: 0 0 12px 6px;
}
ol ol {
list-style-type: lower-alpha;
list-style-position: outside;
margin: 7px 0 0 30px;
padding: 0 0 0 10px;
}
ul ul {
margin-left: 40px;
padding: 0 0 0 6px;
}
li>p { display: inline }
li>p+p { display: block }
li>a+p { display: block }
/* table */
table {
border-top: 1px solid #919699;
border-left: 1px solid #919699;
border-spacing: 0;
}
table th {
padding: 4px 8px 4px 8px;
background: #E2E2E2;
font-size: 12px;
border-bottom: 1px solid #919699;
border-right: 1px solid #919699;
}
table th p {
font-weight: bold;
margin-bottom: 0px;
}
table td {
padding: 8px;
font-size: 12px;
vertical-align: top;
border-bottom: 1px solid #919699;
border-right: 1px solid #919699;
}
table td p {
margin-bottom: 0px;
}
table td p + p {
margin-top: 5px;
}
table td p + p + p {
margin-top: 5px;
}
/* forms */
form {
margin: 0;
}
button {
margin: 3px 0 10px 0;
}
input {
vertical-align: middle;
padding: 0;
margin: 0 0 5px 0;
}
select {
vertical-align: middle;
padding: 0;
margin: 0 0 3px 0;
}
textarea {
margin: 0 0 10px 0;
width: 100%;
}
</style>
</head>
<body>
<b>README.md</b> - Generated on <b>Wed Mar 26 09:32:46 PDT 2014</b> by <b>lgarron</b> using <a href="http://daringfireball.net/projects/markdown/">Markdown</a>. Source is embedded.
<hr>
<h1>md2html</h1>
<p>My humble tool for converting Markdown files to nicely formatted HTML files without fuss. These can be nicer to use and share than plain text.</p>
<p>Run it using</p>
<pre><code>./md2html README.md
</code></pre>
<p>md2html will create a file called <em>README.html</em>.</p>
<h2>Features</h2>
<ul>
<li>Easy-to-use commandline call. Can be used, e.g. in conjuction with a file monitor, a script, or a Quicksilver action.</li>
<li>One-file HTML output that displays on any computer.</li>
<li>Preserves the original Markdown source in the generated file.</li>
<li>Simple, pretty CSS. This is taken from <a href="https://github.com/toland/">toland</a>'s <a href="https://github.com/toland/qlmarkdown">QLMarkdown</a>, although <a href="https://github.com/toland/qlmarkdown/blame/master/styles.css">most commits to the stylesheet</a> seem to be by <a href="https://github.com/jiho">jiho</a>. Most of it seems to based on ``ADC'', presumably the <a href="http://developer.apple.com/">Apple Developer Connection</a>. As required by the QLMarkdown license, credits are included at the bottom.</li>
</ul>
<h2>Dependencies</h2>
<ul>
<li><a href="http://daringfireball.net/projects/markdown/">Markdown</a>, of course.</li>
</ul>
<h2>TODO</h2>
<ul>
<li>Compile the HTML file from the source portion in-place. This is a bit tricky because the file is commonly being edited at the same time. Some editors don't handle this well.</li>
</ul>
<h2>Use with Quicksilver</h2>
<p>Create an Applescript file at "/Users/lgarron/Library/Application Support/Quicksilver/Actions/Markdown to HTML.scpt" with the code</p>
<pre><code>on open theFile
set the_file to POSIX path of theFile
do shell script "[your path md2html] \"" & the_file & "\""
return null
end open
</code></pre>
<p>Make sure that your reference tomarkdown in md2html does not depend on parts of the PATH that are only available in the commandline shell.</p>
<h2>Credits</h2>
<p>This product includes software developed by David Loren Parsons <a href="http://www.pell.portland.or.us/~orc">http://www.pell.portland.or.us/~orc</a></p>
</body>
</html>