markup-preview-command 0.0.1
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.
- data/.gitignore +4 -0
- data/Gemfile +3 -0
- data/LICENSE +21 -0
- data/README.md +54 -0
- data/Rakefile +1 -0
- data/bin/markup-preview +32 -0
- data/etc/markup-preview.el +86 -0
- data/lib/markup-preview-command.rb +81 -0
- data/lib/markup-preview-command/css/gollum.css +666 -0
- data/lib/markup-preview-command/css/template.css +335 -0
- data/lib/markup-preview-command/util/util.rb +15 -0
- data/lib/markup-preview-command/version.rb +7 -0
- data/lib/markup-preview-command/view/template.erb +24 -0
- data/licenses/gollum/LICENSE.txt +21 -0
- data/licenses/licenses.txt +6 -0
- data/licenses/markup-preview-command/LICENSE.txt +21 -0
- data/markup-preview-command.gemspec +31 -0
- data/test/test.md +60 -0
- data/test/test.org +64 -0
- data/test/test.rst +82 -0
- data/test/test.textile +52 -0
- metadata +167 -0
@@ -0,0 +1,335 @@
|
|
1
|
+
/* This css base on gollum's template.css */
|
2
|
+
/* https://github.com/github/gollum */
|
3
|
+
/* The MIT License */
|
4
|
+
|
5
|
+
#template {
|
6
|
+
font-size: 13px;
|
7
|
+
line-height: 23px;
|
8
|
+
margin-bottom: 10px;
|
9
|
+
}
|
10
|
+
|
11
|
+
/* Link Colors */
|
12
|
+
a.absent {
|
13
|
+
color: #c00;
|
14
|
+
}
|
15
|
+
|
16
|
+
/* Primary Body Copy */
|
17
|
+
|
18
|
+
|
19
|
+
#template p {
|
20
|
+
margin: 1em 0;
|
21
|
+
}
|
22
|
+
|
23
|
+
/* ReST first graf in nested list */
|
24
|
+
#template * li p.first {
|
25
|
+
display: inline-block;
|
26
|
+
}
|
27
|
+
|
28
|
+
/* Headings */
|
29
|
+
#template h1, #template h2, #template h3,
|
30
|
+
#template h4, #template h5, #template h6 {
|
31
|
+
margin: 0;
|
32
|
+
padding: 0;
|
33
|
+
}
|
34
|
+
|
35
|
+
#template h1 {
|
36
|
+
border-top: 4px solid #ccc;
|
37
|
+
font-size: 32px;
|
38
|
+
line-height: normal;
|
39
|
+
padding: 10px 0 0;
|
40
|
+
margin: 20px 0 0;
|
41
|
+
}
|
42
|
+
|
43
|
+
#template h2 {
|
44
|
+
border-top: 4px solid #ccc;
|
45
|
+
font-size: 22px;
|
46
|
+
line-height: normal;
|
47
|
+
margin: 22px 0 0;
|
48
|
+
padding: 7px 0 0;
|
49
|
+
}
|
50
|
+
|
51
|
+
#template h3 {
|
52
|
+
font-size: 16px;
|
53
|
+
line-height: 26px;
|
54
|
+
padding: 26px 0 0;
|
55
|
+
}
|
56
|
+
|
57
|
+
#template h4 {
|
58
|
+
font-size: 14px;
|
59
|
+
line-height: 26px;
|
60
|
+
padding: 18px 0 4px;
|
61
|
+
font-weight: bold;
|
62
|
+
text-transform: uppercase;
|
63
|
+
}
|
64
|
+
|
65
|
+
#template h5 {
|
66
|
+
font-size: 13px;
|
67
|
+
line-height: 26px;
|
68
|
+
margin-bottom: -19px;
|
69
|
+
padding: 14px 0 0;
|
70
|
+
font-weight: bold;
|
71
|
+
text-transform: uppercase;
|
72
|
+
}
|
73
|
+
|
74
|
+
#template h6 {
|
75
|
+
color: #666;
|
76
|
+
font-size: 14px;
|
77
|
+
line-height: 26px;
|
78
|
+
margin-bottom: -19px;
|
79
|
+
padding: 18px 0 0;
|
80
|
+
font-weight: normal;
|
81
|
+
font-variant: italic;
|
82
|
+
}
|
83
|
+
|
84
|
+
#template hr {
|
85
|
+
background-color: #ccc;
|
86
|
+
color: #ccc;
|
87
|
+
border: 2px solid #ccc;
|
88
|
+
margin: 20px 0;
|
89
|
+
padding: 0;
|
90
|
+
}
|
91
|
+
|
92
|
+
/* Border Reset for headers with horizontal rules */
|
93
|
+
#template > h2:first-child,
|
94
|
+
#template > h1:first-child {
|
95
|
+
border: 0;
|
96
|
+
margin: 12px 0 0;
|
97
|
+
padding: 5px 0 0;
|
98
|
+
}
|
99
|
+
|
100
|
+
|
101
|
+
/* Lists, Blockquotes & Such */
|
102
|
+
|
103
|
+
#template blockquote {
|
104
|
+
border-left: 5px solid #DDDDDD !important;
|
105
|
+
color: #555555 !important;
|
106
|
+
margin: 1em 0 !important;
|
107
|
+
padding-left: 0.6em !important;
|
108
|
+
}
|
109
|
+
|
110
|
+
/* #template ul li, */
|
111
|
+
|
112
|
+
#template ul li, #template ol li{
|
113
|
+
margin-bottom: 0.5em;
|
114
|
+
margin-top: 0.5em;
|
115
|
+
}
|
116
|
+
|
117
|
+
/* Nested Lists */
|
118
|
+
#template ul li ul,
|
119
|
+
#template ol li ol,
|
120
|
+
#template ul li ol,
|
121
|
+
#template ol li ul,
|
122
|
+
#template ul ul,
|
123
|
+
#template ol ol {
|
124
|
+
padding: 0 0 0 14px;
|
125
|
+
}
|
126
|
+
|
127
|
+
#template dl {
|
128
|
+
margin: 0;
|
129
|
+
padding: 20px 0 0;
|
130
|
+
}
|
131
|
+
|
132
|
+
#template dl dt {
|
133
|
+
font-size: 14px;
|
134
|
+
font-weight: bold;
|
135
|
+
line-height: normal;
|
136
|
+
margin: 0;
|
137
|
+
padding: 20px 0 0;
|
138
|
+
}
|
139
|
+
|
140
|
+
#template dl dt:first-child {
|
141
|
+
padding: 0;
|
142
|
+
}
|
143
|
+
|
144
|
+
#template dl dd {
|
145
|
+
font-size: 13px;
|
146
|
+
margin: 0;
|
147
|
+
padding: 3px 0 0;
|
148
|
+
}
|
149
|
+
|
150
|
+
/* Tables */
|
151
|
+
#template table {
|
152
|
+
border-collapse: collapse;
|
153
|
+
margin: 20px 0 0;
|
154
|
+
padding: 0;
|
155
|
+
}
|
156
|
+
|
157
|
+
#template table * tr {
|
158
|
+
border-top: 1px solid #ccc;
|
159
|
+
background-color: #fff;
|
160
|
+
margin: 0;
|
161
|
+
padding: 0;
|
162
|
+
}
|
163
|
+
|
164
|
+
#template table * tr:nth-child(2n) {
|
165
|
+
background-color: #f8f8f8;
|
166
|
+
}
|
167
|
+
|
168
|
+
#template table * tr th,
|
169
|
+
#template table * tr td {
|
170
|
+
border: 1px solid #ccc;
|
171
|
+
text-align: left;
|
172
|
+
margin: 0;
|
173
|
+
padding: 6px 13px;
|
174
|
+
}
|
175
|
+
|
176
|
+
/* Images & Stuff */
|
177
|
+
#template img {
|
178
|
+
max-width: 100%;
|
179
|
+
}
|
180
|
+
|
181
|
+
/* Gollum Image Tags */
|
182
|
+
|
183
|
+
/* Framed */
|
184
|
+
#template span.frame {
|
185
|
+
display: block;
|
186
|
+
overflow: hidden;
|
187
|
+
}
|
188
|
+
|
189
|
+
#template span.frame > span {
|
190
|
+
border: 1px solid #ddd;
|
191
|
+
display: block;
|
192
|
+
float: left;
|
193
|
+
overflow: hidden;
|
194
|
+
margin: 13px 0 0;
|
195
|
+
padding: 7px;
|
196
|
+
width: auto;
|
197
|
+
}
|
198
|
+
|
199
|
+
#template span.frame span img {
|
200
|
+
display: block;
|
201
|
+
float: left;
|
202
|
+
}
|
203
|
+
|
204
|
+
#template span.frame span span {
|
205
|
+
clear: both;
|
206
|
+
color: #333;
|
207
|
+
display: block;
|
208
|
+
padding: 5px 0 0;
|
209
|
+
}
|
210
|
+
|
211
|
+
#template span.align-center {
|
212
|
+
display: block;
|
213
|
+
overflow: hidden;
|
214
|
+
clear: both;
|
215
|
+
}
|
216
|
+
|
217
|
+
#template span.align-center > span {
|
218
|
+
display: block;
|
219
|
+
overflow: hidden;
|
220
|
+
margin: 13px auto 0;
|
221
|
+
text-align: center;
|
222
|
+
}
|
223
|
+
|
224
|
+
#template span.align-center span img {
|
225
|
+
margin: 0 auto;
|
226
|
+
text-align: center;
|
227
|
+
}
|
228
|
+
|
229
|
+
#template span.align-right {
|
230
|
+
display: block;
|
231
|
+
overflow: hidden;
|
232
|
+
clear: both;
|
233
|
+
}
|
234
|
+
|
235
|
+
#template span.align-right > span {
|
236
|
+
display: block;
|
237
|
+
overflow: hidden;
|
238
|
+
margin: 13px 0 0;
|
239
|
+
text-align: right;
|
240
|
+
}
|
241
|
+
|
242
|
+
#template span.align-right span img {
|
243
|
+
margin: 0;
|
244
|
+
text-align: right;
|
245
|
+
}
|
246
|
+
|
247
|
+
#template span.float-left {
|
248
|
+
display: block;
|
249
|
+
margin-right: 13px;
|
250
|
+
overflow: hidden;
|
251
|
+
float: left;
|
252
|
+
}
|
253
|
+
|
254
|
+
#template span.float-left span {
|
255
|
+
margin: 13px 0 0;
|
256
|
+
}
|
257
|
+
|
258
|
+
#template span.float-right {
|
259
|
+
display: block;
|
260
|
+
margin-left: 13px;
|
261
|
+
overflow: hidden;
|
262
|
+
float: right;
|
263
|
+
}
|
264
|
+
|
265
|
+
#template span.float-right > span {
|
266
|
+
display: block;
|
267
|
+
overflow: hidden;
|
268
|
+
margin: 13px auto 0;
|
269
|
+
text-align: right;
|
270
|
+
}
|
271
|
+
|
272
|
+
|
273
|
+
/* Code */
|
274
|
+
#template code, #template tt {
|
275
|
+
background-color: #f8f8f8;
|
276
|
+
border: 1px solid #dedede;
|
277
|
+
font-size: 13px;
|
278
|
+
padding: 1px 5px;
|
279
|
+
|
280
|
+
-moz-border-radius: 3px;
|
281
|
+
-webkit-border-radius: 3px;
|
282
|
+
border-radius: 3px;
|
283
|
+
}
|
284
|
+
|
285
|
+
|
286
|
+
#template .highlight pre {
|
287
|
+
background-color: #f8f8f8;
|
288
|
+
border: 1px solid #ccc;
|
289
|
+
font-size: 13px;
|
290
|
+
line-height: 19px;
|
291
|
+
overflow: auto;
|
292
|
+
padding: 6px;
|
293
|
+
|
294
|
+
-moz-border-radius: 3px;
|
295
|
+
-webkit-border-radius: 3px;
|
296
|
+
border-radius: 3px;
|
297
|
+
}
|
298
|
+
|
299
|
+
#template pre {
|
300
|
+
background-color: #EEEEEE;
|
301
|
+
border: 1px solid #DDDDDD;
|
302
|
+
border-radius: 3px 3px 3px 3px;
|
303
|
+
color: #444444;
|
304
|
+
margin: 1em 0;
|
305
|
+
padding: 5px;
|
306
|
+
}
|
307
|
+
|
308
|
+
#template pre code, #template pre tt {
|
309
|
+
border: none;
|
310
|
+
background-color: #EEEEEE;
|
311
|
+
color: #444444;
|
312
|
+
}
|
313
|
+
|
314
|
+
#template .highlight { background: #ffffff; }
|
315
|
+
#template .highlight .c { color: #999988; font-style: italic }
|
316
|
+
#template .highlight .err { color: #a61717; background-color: #e3d2d2 }
|
317
|
+
#template .highlight .k { font-weight: bold }
|
318
|
+
#template .highlight .o { font-weight: bold }
|
319
|
+
#template .highlight .cm { color: #999988; font-style: italic }
|
320
|
+
#template .highlight .cp { color: #999999; font-weight: bold }
|
321
|
+
#template .highlight .c1 { color: #999988; font-style: italic }
|
322
|
+
#template .highlight .cs { color: #999999; font-weight: bold; font-style: italic }
|
323
|
+
#template .highlight .gd { color: #000000; background-color: #ffdddd }
|
324
|
+
#template .highlight .gd .x { color: #000000; background-color: #ffaaaa }
|
325
|
+
#template .highlight .ge { font-style: italic }
|
326
|
+
#template .highlight .gr { color: #aa0000 }
|
327
|
+
#template .highlight .gh { color: #999999 }
|
328
|
+
#template .highlight .gi { color: #000000; background-color: #ddffdd }
|
329
|
+
#template .highlight .gi .x { color: #000000; background-color: #aaffaa }
|
330
|
+
#template .highlight .gc { color: #999; background-color: #EAF2F5 }
|
331
|
+
#template .highlight .go { color: #888888 }
|
332
|
+
#template .highlight .gp { color: #555555 }
|
333
|
+
#template .highlight .gs { font-weight: bold }
|
334
|
+
#template .highlight .gu { color: #aaaaaa }
|
335
|
+
#template .highlight .gt { color: #aa0000 }
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Markup::Preview::Command
|
2
|
+
module Util
|
3
|
+
|
4
|
+
def command_exit? (command)
|
5
|
+
system "which #{command} >/dev/null 2>&1"
|
6
|
+
end
|
7
|
+
|
8
|
+
def browser_command
|
9
|
+
return "gnome-open" if command_exit? "gnome-open"
|
10
|
+
return "open" if command_exit? "open"
|
11
|
+
exit 1
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta content="text/html;charset=utf-8" http-equiv="Content-type">
|
5
|
+
<title>Preview</title>
|
6
|
+
<style>
|
7
|
+
<%= template_css %>
|
8
|
+
<%= gollum_css %>
|
9
|
+
</style>
|
10
|
+
</head>
|
11
|
+
<body>
|
12
|
+
<div class="page" id="wiki-wrapper">
|
13
|
+
<div id="wiki-content">
|
14
|
+
<div class="wrap">
|
15
|
+
<div class="gollum-markdown-content" id="wiki-body">
|
16
|
+
<div id="template">
|
17
|
+
<%= render_result %>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
</body>
|
24
|
+
</html>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
(The MIT License)
|
2
|
+
|
3
|
+
Copyright (c) Tom Preston-Werner, Rick Olson
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the 'Software'), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -0,0 +1,21 @@
|
|
1
|
+
(The MIT License)
|
2
|
+
|
3
|
+
Copyright (c) mori_dev
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the 'Software'), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "markup-preview-command/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "markup-preview-command"
|
7
|
+
s.version = Markup::Preview::Command::VERSION
|
8
|
+
s.authors = ["mori_dev"]
|
9
|
+
s.email = ["mori.dev.asdf@gmail.com"]
|
10
|
+
s.homepage = "https://github.com/wakaran/markup-preview-command"
|
11
|
+
s.summary = %q{Previw your wiki file as local html file.}
|
12
|
+
s.description = %q{Previw your wiki file as local html file. (format: markdown, rest, textile, rdoc and so on.)}
|
13
|
+
|
14
|
+
s.rubyforge_project = "markup-preview-command"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
s.add_dependency('github-markup', '~> 0.7.0')
|
22
|
+
s.add_dependency('creole', '~>0.3.6')
|
23
|
+
s.add_dependency('redcarpet', '2.0.0')
|
24
|
+
s.add_dependency('RedCloth', '~>4.2.0')
|
25
|
+
s.add_dependency('rdoc', '~>3.6.0')
|
26
|
+
s.add_dependency('org-ruby', '~>0.5.0')
|
27
|
+
s.add_dependency('wikicloth', '~>0.7.0')
|
28
|
+
s.add_dependency('rake', '~>0.9.0')
|
29
|
+
s.add_dependency('slop', '~>2.4.0')
|
30
|
+
|
31
|
+
end
|