spiffy 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43fd5e5b92456e74b9d97b8dac1096be1914455b
4
- data.tar.gz: 66efb37287de1218a89d5e38d13f480a1820cb7d
3
+ metadata.gz: 9aa8c6673320640893a3ef6896a38fa5f999ca8a
4
+ data.tar.gz: 59c083efbb20ab796c8482d86579db21da682e70
5
5
  SHA512:
6
- metadata.gz: 2a9b543c47a36190edef4c171ed28db21fb74783d06740ffe24b2926af25bd0a510f6558ce0f9f87e89b016c2f9508147f127b115e3d68d6c5fcce21470fa22f
7
- data.tar.gz: 1fc0976eff9dba1ae7f371116d9cd177d7e80d4814e2fd4aeb13530606bca7cd2332f46978b51ddbd77265460ec5ec44813d8339ba30d34b66ae5cccecfecce5
6
+ metadata.gz: c8240c84269d1f9ca8b41f397a73a2734aeed20e01d87dde9a78a4108533b97762589c4384f96924f03d54dd0ac474b7d695e6e5a84ef176e926c5aae2b9dccd
7
+ data.tar.gz: fc6746c3c3d63c1ae35e0521649b02e3db95b54b771250e45027e7355f1c9f213f081bd99cede110451d3e43ed6a7ea00869270f4d46265c5bd3381b0f5d45c5
data/bin/spiffy CHANGED
@@ -2,15 +2,19 @@
2
2
 
3
3
  require "optparse"
4
4
  require "rubygems"
5
+ require "yaml"
5
6
  require_relative "../lib/spiffy"
6
7
 
7
- DEFAULT_DIR = File.join(File.dirname(__FILE__), "../defaults")
8
- DEFAULT_TEMPLATE_FILE = File.join(DEFAULT_DIR, "template.haml")
9
- DEFAULT_CSS_FILE = File.join(DEFAULT_DIR, "style.css")
8
+ DEFAULT_DIR = File.join(File.dirname(__FILE__), "../templates")
9
+ DEFAULT_TEMPLATE_FILE = File.join(DEFAULT_DIR, "default.haml")
10
+ DEFAULT_CSS_FILE = File.join(DEFAULT_DIR, "default.css")
11
+
12
+ DOT_FILE = ".spiffy.yml"
10
13
 
11
14
  options = {
12
- :template => DEFAULT_TEMPLATE_FILE,
13
- :css => DEFAULT_CSS_FILE
15
+ "template" => DEFAULT_TEMPLATE_FILE,
16
+ "css" => DEFAULT_CSS_FILE,
17
+ "pdf" => false
14
18
  }
15
19
 
16
20
  opt_parser = OptionParser.new do |opt|
@@ -19,12 +23,16 @@ opt_parser = OptionParser.new do |opt|
19
23
  opt.separator("")
20
24
  opt.separator("Options")
21
25
 
22
- opt.on("-C", "--css", String, "CSS to include inline in the HTML file output") do |css|
23
- options[:css] = css
26
+ opt.on("-c", "--css [css]", "CSS to include inline in the HTML file output") do |css|
27
+ options["css_file"] = css
28
+ end
29
+
30
+ opt.on("-t", "--template [template]", "Template to wrap the resulting HTML") do |template|
31
+ options["template_file"] = template
24
32
  end
25
33
 
26
- opt.on("-T", "--template", String, "Template to wrap the resulting HTML") do |template|
27
- options[:template] = template
34
+ opt.on("-p", "--pdf", "Output PDF files (default: off)") do
35
+ options["pdf"] = true
28
36
  end
29
37
 
30
38
  opt.on("-h", "--help", "help") do
@@ -36,13 +44,29 @@ end
36
44
 
37
45
  opt_parser.parse!
38
46
 
39
- if ARGV.empty?
40
- puts opt_parser
47
+ has_dot_file = File.exists?(DOT_FILE)
48
+
49
+ case
50
+ when ARGV.any?
51
+ warn "Ignoring .spiffy.yml as arguments provided." if has_dot_file
52
+ sets = ARGV.map do |arg|
53
+ { "markdown_files" => [arg] }.merge(options)
54
+ end
55
+ when has_dot_file
56
+ sets = YAML.load_file(DOT_FILE)
41
57
  else
42
- inputs = ARGV
43
- inputs.each do |inputs|
44
- Dir[inputs].each do |file|
45
- Spiffy.markup_to_html(file, css_file: options[:css], template_file: options[:template])
58
+ puts opt_parser
59
+ end
60
+
61
+ sets.each do |set|
62
+ set["markdown_files"].each do |input|
63
+ Dir[input].each do |file|
64
+ print "Converting #{file}..."
65
+ Spiffy.markup_to_html(file,
66
+ css_file: set["css_file"],
67
+ template_file: set["template_file"],
68
+ pdf: set["pdf"])
69
+ puts "done"
46
70
  end
47
71
  end
48
72
  end
@@ -1,19 +1,14 @@
1
1
  require "github/markup"
2
2
  require "redcarpet"
3
- require "RedCloth"
4
- require "rdoc"
5
- require "org-ruby"
6
- require "creole"
7
- require "wikicloth"
8
- require "asciidoctor"
9
3
  require "haml"
4
+ require "pdfkit"
10
5
 
11
6
  module Spiffy
12
- def self.markup_to_html(markup_file, css_file: nil, template_file: nil)
7
+ def self.markup_to_html(markup_file, css_file: nil, template_file: nil, pdf: false)
13
8
  markup_file_name = File.basename(markup_file, ".*")
14
9
  markup = File.open(markup_file, "r:UTF-8", &:read)
15
10
 
16
- html = GitHub::Markup.render(markup_file, markup)
11
+ html = Redcarpet::Markdown.new(Redcarpet::Render::HTML, tables: true).render(markup)
17
12
 
18
13
  if css_file
19
14
  css = File.open(css_file, "r:UTF-8", &:read)
@@ -24,15 +19,21 @@ module Spiffy
24
19
  template = File.open(template_file, "r:UTF-8", &:read)
25
20
  html = case template_ext
26
21
  when ".erb"
27
- ERB.new(template).result { |section| case section; when :css; css; when :body; html; end }
22
+ ERB.new(template).result { |section| case section; when :css; css; when :body, nil; html; end }
28
23
  when ".haml"
29
- Haml::Engine.new(template).render { |section| case section; when :css; css; when :body; html; end }
24
+ Haml::Engine.new(template).render { |section| case section; when :css; css; when :body, nil; html; end }
30
25
  else
31
26
  raise "Template file #{template_file} unsupported. Only .erb or .haml are supported."
32
27
  end
33
28
  end
34
29
 
35
- out_file = "#{markup_file_name}.html"
36
- File.open(out_file, "w:UTF-8") { |f| f.write(html) }
30
+ html_file = "#{markup_file_name}.html"
31
+ File.open(html_file, "w:UTF-8") { |f| f.write(html) }
32
+
33
+ return unless pdf
34
+ pdf_file = "#{markup_file_name}.pdf"
35
+ pdf = PDFKit.new(html)
36
+ pdf.stylesheets << css_file if css_file
37
+ pdf.to_file(pdf_file)
37
38
  end
38
39
  end
@@ -0,0 +1,660 @@
1
+ @font-face {
2
+ font-family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-webkit-text-size-adjust: 100%;
9
+ color: #333;
10
+ font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif;
11
+ font-size: 16px;
12
+ line-height: 1.6;
13
+ word-wrap: break-word;
14
+ }
15
+
16
+ a {
17
+ background: transparent;
18
+ }
19
+
20
+ a:active,
21
+ a:hover {
22
+ outline: 0;
23
+ }
24
+
25
+ strong {
26
+ font-weight: bold;
27
+ }
28
+
29
+ h1 {
30
+ font-size: 2em;
31
+ margin: 0.67em 0;
32
+ }
33
+
34
+ img {
35
+ border: 0;
36
+ }
37
+
38
+ hr {
39
+ box-sizing: content-box;
40
+ height: 0;
41
+ }
42
+
43
+ pre {
44
+ overflow: auto;
45
+ }
46
+
47
+ code,
48
+ kbd,
49
+ pre {
50
+ font-family: monospace, monospace;
51
+ font-size: 1em;
52
+ }
53
+
54
+ input {
55
+ color: inherit;
56
+ font: inherit;
57
+ margin: 0;
58
+ }
59
+
60
+ html input[disabled] {
61
+ cursor: default;
62
+ }
63
+
64
+ input {
65
+ line-height: normal;
66
+ }
67
+
68
+ input[type="checkbox"] {
69
+ box-sizing: border-box;
70
+ padding: 0;
71
+ }
72
+
73
+ table {
74
+ border-collapse: collapse;
75
+ border-spacing: 0;
76
+ }
77
+
78
+ td,
79
+ th {
80
+ padding: 0;
81
+ }
82
+
83
+ * {
84
+ box-sizing: border-box;
85
+ }
86
+
87
+ input {
88
+ font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
89
+ }
90
+
91
+ a {
92
+ color: #4183c4;
93
+ text-decoration: none;
94
+ }
95
+
96
+ a:hover,
97
+ a:active {
98
+ text-decoration: underline;
99
+ }
100
+
101
+ hr {
102
+ height: 0;
103
+ margin: 15px 0;
104
+ overflow: hidden;
105
+ background: transparent;
106
+ border: 0;
107
+ border-bottom: 1px solid #ddd;
108
+ }
109
+
110
+ hr:before {
111
+ display: table;
112
+ content: "";
113
+ }
114
+
115
+ hr:after {
116
+ display: table;
117
+ clear: both;
118
+ content: "";
119
+ }
120
+
121
+ h1,
122
+ h2,
123
+ h3,
124
+ h4,
125
+ h5,
126
+ h6 {
127
+ margin-top: 15px;
128
+ margin-bottom: 15px;
129
+ line-height: 1.1;
130
+ }
131
+
132
+ h1 {
133
+ font-size: 30px;
134
+ }
135
+
136
+ h2 {
137
+ font-size: 21px;
138
+ }
139
+
140
+ h3 {
141
+ font-size: 16px;
142
+ }
143
+
144
+ h4 {
145
+ font-size: 14px;
146
+ }
147
+
148
+ h5 {
149
+ font-size: 12px;
150
+ }
151
+
152
+ h6 {
153
+ font-size: 11px;
154
+ }
155
+
156
+ blockquote {
157
+ margin: 0;
158
+ }
159
+
160
+ ul,
161
+ ol {
162
+ padding: 0;
163
+ margin-top: 0;
164
+ margin-bottom: 0;
165
+ }
166
+
167
+ ol ol,
168
+ ul ol {
169
+ list-style-type: lower-roman;
170
+ }
171
+
172
+ ul ul ol,
173
+ ul ol ol,
174
+ ol ul ol,
175
+ ol ol ol {
176
+ list-style-type: lower-alpha;
177
+ }
178
+
179
+ dd {
180
+ margin-left: 0;
181
+ }
182
+
183
+ code {
184
+ font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
185
+ font-size: 12px;
186
+ }
187
+
188
+ pre {
189
+ margin-top: 0;
190
+ margin-bottom: 0;
191
+ font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
192
+ }
193
+
194
+ .octicon {
195
+ font: normal normal normal 16px/1 octicons-anchor;
196
+ display: inline-block;
197
+ text-decoration: none;
198
+ text-rendering: auto;
199
+ -webkit-font-smoothing: antialiased;
200
+ -moz-osx-font-smoothing: grayscale;
201
+ -webkit-user-select: none;
202
+ -moz-user-select: none;
203
+ -ms-user-select: none;
204
+ user-select: none;
205
+ }
206
+
207
+ .octicon-link:before {
208
+ content: '\f05c';
209
+ }
210
+
211
+ *:first-child {
212
+ margin-top: 0 !important;
213
+ }
214
+
215
+ *:last-child {
216
+ margin-bottom: 0 !important;
217
+ }
218
+
219
+ .anchor {
220
+ position: absolute;
221
+ top: 0;
222
+ left: 0;
223
+ display: block;
224
+ padding-right: 6px;
225
+ padding-left: 30px;
226
+ margin-left: -30px;
227
+ }
228
+
229
+ .anchor:focus {
230
+ outline: none;
231
+ }
232
+
233
+ h1,
234
+ h2,
235
+ h3,
236
+ h4,
237
+ h5,
238
+ h6 {
239
+ position: relative;
240
+ margin-top: 1em;
241
+ margin-bottom: 16px;
242
+ font-weight: bold;
243
+ line-height: 1.4;
244
+ }
245
+
246
+ h1 .octicon-link,
247
+ h2 .octicon-link,
248
+ h3 .octicon-link,
249
+ h4 .octicon-link,
250
+ h5 .octicon-link,
251
+ h6 .octicon-link {
252
+ display: none;
253
+ color: #000;
254
+ vertical-align: middle;
255
+ }
256
+
257
+ h1:hover .anchor,
258
+ h2:hover .anchor,
259
+ h3:hover .anchor,
260
+ h4:hover .anchor,
261
+ h5:hover .anchor,
262
+ h6:hover .anchor {
263
+ padding-left: 8px;
264
+ margin-left: -30px;
265
+ text-decoration: none;
266
+ }
267
+
268
+ h1:hover .anchor .octicon-link,
269
+ h2:hover .anchor .octicon-link,
270
+ h3:hover .anchor .octicon-link,
271
+ h4:hover .anchor .octicon-link,
272
+ h5:hover .anchor .octicon-link,
273
+ h6:hover .anchor .octicon-link {
274
+ display: inline-block;
275
+ }
276
+
277
+ h1 {
278
+ padding-bottom: 0.3em;
279
+ font-size: 2.25em;
280
+ line-height: 1.2;
281
+ border-bottom: 1px solid #eee;
282
+ }
283
+
284
+ h1 .anchor {
285
+ line-height: 1;
286
+ }
287
+
288
+ h2 {
289
+ padding-bottom: 0.3em;
290
+ font-size: 1.75em;
291
+ line-height: 1.225;
292
+ border-bottom: 1px solid #eee;
293
+ }
294
+
295
+ h2 .anchor {
296
+ line-height: 1;
297
+ }
298
+
299
+ h3 {
300
+ font-size: 1.5em;
301
+ line-height: 1.43;
302
+ }
303
+
304
+ h3 .anchor {
305
+ line-height: 1.2;
306
+ }
307
+
308
+ h4 {
309
+ font-size: 1.25em;
310
+ }
311
+
312
+ h4 .anchor {
313
+ line-height: 1.2;
314
+ }
315
+
316
+ h5 {
317
+ font-size: 1em;
318
+ }
319
+
320
+ h5 .anchor {
321
+ line-height: 1.1;
322
+ }
323
+
324
+ h6 {
325
+ font-size: 1em;
326
+ color: #777;
327
+ }
328
+
329
+ h6 .anchor {
330
+ line-height: 1.1;
331
+ }
332
+
333
+ p,
334
+ blockquote,
335
+ ul,
336
+ ol,
337
+ dl,
338
+ table,
339
+ pre {
340
+ margin-top: 0;
341
+ margin-bottom: 16px;
342
+ }
343
+
344
+ hr {
345
+ height: 4px;
346
+ padding: 0;
347
+ margin: 16px 0;
348
+ background-color: #e7e7e7;
349
+ border: 0 none;
350
+ }
351
+
352
+ ul,
353
+ ol {
354
+ padding-left: 2em;
355
+ }
356
+
357
+ ul ul,
358
+ ul ol,
359
+ ol ol,
360
+ ol ul {
361
+ margin-top: 0;
362
+ margin-bottom: 0;
363
+ }
364
+
365
+ li>p {
366
+ margin-top: 16px;
367
+ }
368
+
369
+ dl {
370
+ padding: 0;
371
+ }
372
+
373
+ dl dt {
374
+ padding: 0;
375
+ margin-top: 16px;
376
+ font-size: 1em;
377
+ font-style: italic;
378
+ font-weight: bold;
379
+ }
380
+
381
+ dl dd {
382
+ padding: 0 16px;
383
+ margin-bottom: 16px;
384
+ }
385
+
386
+ blockquote {
387
+ padding: 0 15px;
388
+ color: #777;
389
+ border-left: 4px solid #ddd;
390
+ }
391
+
392
+ blockquote>:first-child {
393
+ margin-top: 0;
394
+ }
395
+
396
+ blockquote>:last-child {
397
+ margin-bottom: 0;
398
+ }
399
+
400
+ table {
401
+ display: block;
402
+ width: 100%;
403
+ overflow: auto;
404
+ word-break: normal;
405
+ word-break: keep-all;
406
+ }
407
+
408
+ table th {
409
+ font-weight: bold;
410
+ }
411
+
412
+ table th,
413
+ table td {
414
+ padding: 6px 13px;
415
+ border: 1px solid #ddd;
416
+ }
417
+
418
+ table tr {
419
+ background-color: #fff;
420
+ border-top: 1px solid #ccc;
421
+ }
422
+
423
+ table tr:nth-child(2n) {
424
+ background-color: #f8f8f8;
425
+ }
426
+
427
+ img {
428
+ max-width: 100%;
429
+ box-sizing: border-box;
430
+ -moz-box-sizing: border-box;
431
+ }
432
+
433
+ code {
434
+ padding: 0;
435
+ padding-top: 0.2em;
436
+ padding-bottom: 0.2em;
437
+ margin: 0;
438
+ font-size: 85%;
439
+ background-color: rgba(0,0,0,0.04);
440
+ border-radius: 3px;
441
+ }
442
+
443
+ code:before,
444
+ code:after {
445
+ letter-spacing: -0.2em;
446
+ content: "\00a0";
447
+ }
448
+
449
+ pre>code {
450
+ padding: 0;
451
+ margin: 0;
452
+ font-size: 100%;
453
+ word-break: normal;
454
+ white-space: pre;
455
+ background: transparent;
456
+ border: 0;
457
+ }
458
+
459
+ .highlight {
460
+ margin-bottom: 16px;
461
+ }
462
+
463
+ .highlight pre,
464
+ pre {
465
+ padding: 16px;
466
+ overflow: auto;
467
+ font-size: 85%;
468
+ line-height: 1.45;
469
+ background-color: #f7f7f7;
470
+ border-radius: 3px;
471
+ }
472
+
473
+ .highlight pre {
474
+ margin-bottom: 0;
475
+ word-break: normal;
476
+ }
477
+
478
+ pre {
479
+ word-wrap: normal;
480
+ }
481
+
482
+ pre code {
483
+ display: inline;
484
+ max-width: initial;
485
+ padding: 0;
486
+ margin: 0;
487
+ overflow: initial;
488
+ line-height: inherit;
489
+ word-wrap: normal;
490
+ background-color: transparent;
491
+ border: 0;
492
+ }
493
+
494
+ pre code:before,
495
+ pre code:after {
496
+ content: normal;
497
+ }
498
+
499
+ kbd {
500
+ display: inline-block;
501
+ padding: 3px 5px;
502
+ font-size: 11px;
503
+ line-height: 10px;
504
+ color: #555;
505
+ vertical-align: middle;
506
+ background-color: #fcfcfc;
507
+ border: solid 1px #ccc;
508
+ border-bottom-color: #bbb;
509
+ border-radius: 3px;
510
+ box-shadow: inset 0 -1px 0 #bbb;
511
+ }
512
+
513
+ .pl-c {
514
+ color: #969896;
515
+ }
516
+
517
+ .pl-c1,
518
+ .pl-mdh,
519
+ .pl-mm,
520
+ .pl-mp,
521
+ .pl-mr,
522
+ .pl-s1 .pl-v,
523
+ .pl-s3,
524
+ .pl-sc,
525
+ .pl-sv {
526
+ color: #0086b3;
527
+ }
528
+
529
+ .pl-e,
530
+ .pl-en {
531
+ color: #795da3;
532
+ }
533
+
534
+ .pl-s1 .pl-s2,
535
+ .pl-smi,
536
+ .pl-smp,
537
+ .pl-stj,
538
+ .pl-vo,
539
+ .pl-vpf {
540
+ color: #333;
541
+ }
542
+
543
+ .pl-ent {
544
+ color: #63a35c;
545
+ }
546
+
547
+ .pl-k,
548
+ .pl-s,
549
+ .pl-st {
550
+ color: #a71d5d;
551
+ }
552
+
553
+ .pl-pds,
554
+ .pl-s1,
555
+ .pl-s1 .pl-pse .pl-s2,
556
+ .pl-sr,
557
+ .pl-sr .pl-cce,
558
+ .pl-sr .pl-sra,
559
+ .pl-sr .pl-sre,
560
+ .pl-src {
561
+ color: #183691;
562
+ }
563
+
564
+ .pl-v {
565
+ color: #ed6a43;
566
+ }
567
+
568
+ .pl-id {
569
+ color: #b52a1d;
570
+ }
571
+
572
+ .pl-ii {
573
+ background-color: #b52a1d;
574
+ color: #f8f8f8;
575
+ }
576
+
577
+ .pl-sr .pl-cce {
578
+ color: #63a35c;
579
+ font-weight: bold;
580
+ }
581
+
582
+ .pl-ml {
583
+ color: #693a17;
584
+ }
585
+
586
+ .pl-mh,
587
+ .pl-mh .pl-en,
588
+ .pl-ms {
589
+ color: #1d3e81;
590
+ font-weight: bold;
591
+ }
592
+
593
+ .pl-mq {
594
+ color: #008080;
595
+ }
596
+
597
+ .pl-mi {
598
+ color: #333;
599
+ font-style: italic;
600
+ }
601
+
602
+ .pl-mb {
603
+ color: #333;
604
+ font-weight: bold;
605
+ }
606
+
607
+ .pl-md,
608
+ .pl-mdhf {
609
+ background-color: #ffecec;
610
+ color: #bd2c00;
611
+ }
612
+
613
+ .pl-mdht,
614
+ .pl-mi1 {
615
+ background-color: #eaffea;
616
+ color: #55a532;
617
+ }
618
+
619
+ .pl-mdr {
620
+ color: #795da3;
621
+ font-weight: bold;
622
+ }
623
+
624
+ .pl-mo {
625
+ color: #1d3e81;
626
+ }
627
+
628
+ kbd {
629
+ display: inline-block;
630
+ padding: 3px 5px;
631
+ font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
632
+ line-height: 10px;
633
+ color: #555;
634
+ vertical-align: middle;
635
+ background-color: #fcfcfc;
636
+ border: solid 1px #ccc;
637
+ border-bottom-color: #bbb;
638
+ border-radius: 3px;
639
+ box-shadow: inset 0 -1px 0 #bbb;
640
+ }
641
+
642
+ .task-list-item {
643
+ list-style-type: none;
644
+ }
645
+
646
+ .task-list-item+.task-list-item {
647
+ margin-top: 3px;
648
+ }
649
+
650
+ .task-list-item input {
651
+ float: left;
652
+ margin: 0.3em 0 0.25em -1.6em;
653
+ vertical-align: middle;
654
+ }
655
+
656
+ :checked+.radio-label {
657
+ z-index: 1;
658
+ position: relative;
659
+ border-color: #4183c4;
660
+ }
@@ -0,0 +1,13 @@
1
+ %html
2
+ %head
3
+ %meta{ charset: "utf-8" }
4
+ %meta{ name: "print_media_type", content: "true"}
5
+ %meta{ name: "pdfkit-page_size", content: "Letter" }
6
+ %meta{ name: "pdfkit-margin_top", content: "0.5in" }
7
+ %meta{ name: "pdfkit-margin_right", content: "0.5in" }
8
+ %meta{ name: "pdfkit-margin_bottom", content: "0.5in" }
9
+ %meta{ name: "pdfkit-margin_left", content: "0.5in" }
10
+ %style
11
+ = yield :css
12
+ %body
13
+ = yield :body
metadata CHANGED
@@ -1,35 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spiffy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leigh McCulloch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-06 00:00:00.000000000 Z
11
+ date: 2015-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: github-markup
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.3'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 1.3.3
23
- type: :runtime
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '1.3'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 1.3.3
33
13
  - !ruby/object:Gem::Dependency
34
14
  name: redcarpet
35
15
  requirement: !ruby/object:Gem::Requirement
@@ -51,41 +31,27 @@ dependencies:
51
31
  - !ruby/object:Gem::Version
52
32
  version: 3.2.2
53
33
  - !ruby/object:Gem::Dependency
54
- name: RedCloth
34
+ name: pdfkit
55
35
  requirement: !ruby/object:Gem::Requirement
56
36
  requirements:
57
37
  - - "~>"
58
38
  - !ruby/object:Gem::Version
59
- version: '4.2'
39
+ version: '0.6'
60
40
  - - ">="
61
41
  - !ruby/object:Gem::Version
62
- version: 4.2.9
42
+ version: 0.6.2
63
43
  type: :runtime
64
44
  prerelease: false
65
45
  version_requirements: !ruby/object:Gem::Requirement
66
46
  requirements:
67
47
  - - "~>"
68
48
  - !ruby/object:Gem::Version
69
- version: '4.2'
49
+ version: '0.6'
70
50
  - - ">="
71
51
  - !ruby/object:Gem::Version
72
- version: 4.2.9
52
+ version: 0.6.2
73
53
  - !ruby/object:Gem::Dependency
74
- name: rdoc
75
- requirement: !ruby/object:Gem::Requirement
76
- requirements:
77
- - - '='
78
- - !ruby/object:Gem::Version
79
- version: 3.6.1
80
- type: :runtime
81
- prerelease: false
82
- version_requirements: !ruby/object:Gem::Requirement
83
- requirements:
84
- - - '='
85
- - !ruby/object:Gem::Version
86
- version: 3.6.1
87
- - !ruby/object:Gem::Dependency
88
- name: org-ruby
54
+ name: wkhtmltopdf-binary
89
55
  requirement: !ruby/object:Gem::Requirement
90
56
  requirements:
91
57
  - - "~>"
@@ -93,7 +59,7 @@ dependencies:
93
59
  version: '0.9'
94
60
  - - ">="
95
61
  - !ruby/object:Gem::Version
96
- version: 0.9.12
62
+ version: 0.9.9.3
97
63
  type: :runtime
98
64
  prerelease: false
99
65
  version_requirements: !ruby/object:Gem::Requirement
@@ -103,67 +69,7 @@ dependencies:
103
69
  version: '0.9'
104
70
  - - ">="
105
71
  - !ruby/object:Gem::Version
106
- version: 0.9.12
107
- - !ruby/object:Gem::Dependency
108
- name: creole
109
- requirement: !ruby/object:Gem::Requirement
110
- requirements:
111
- - - "~>"
112
- - !ruby/object:Gem::Version
113
- version: '0.5'
114
- - - ">="
115
- - !ruby/object:Gem::Version
116
- version: 0.5.0
117
- type: :runtime
118
- prerelease: false
119
- version_requirements: !ruby/object:Gem::Requirement
120
- requirements:
121
- - - "~>"
122
- - !ruby/object:Gem::Version
123
- version: '0.5'
124
- - - ">="
125
- - !ruby/object:Gem::Version
126
- version: 0.5.0
127
- - !ruby/object:Gem::Dependency
128
- name: wikicloth
129
- requirement: !ruby/object:Gem::Requirement
130
- requirements:
131
- - - "~>"
132
- - !ruby/object:Gem::Version
133
- version: '0.8'
134
- - - ">="
135
- - !ruby/object:Gem::Version
136
- version: 0.8.2
137
- type: :runtime
138
- prerelease: false
139
- version_requirements: !ruby/object:Gem::Requirement
140
- requirements:
141
- - - "~>"
142
- - !ruby/object:Gem::Version
143
- version: '0.8'
144
- - - ">="
145
- - !ruby/object:Gem::Version
146
- version: 0.8.2
147
- - !ruby/object:Gem::Dependency
148
- name: asciidoctor
149
- requirement: !ruby/object:Gem::Requirement
150
- requirements:
151
- - - "~>"
152
- - !ruby/object:Gem::Version
153
- version: '1.5'
154
- - - ">="
155
- - !ruby/object:Gem::Version
156
- version: 1.5.2
157
- type: :runtime
158
- prerelease: false
159
- version_requirements: !ruby/object:Gem::Requirement
160
- requirements:
161
- - - "~>"
162
- - !ruby/object:Gem::Version
163
- version: '1.5'
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: 1.5.2
72
+ version: 0.9.9.3
167
73
  - !ruby/object:Gem::Dependency
168
74
  name: haml
169
75
  requirement: !ruby/object:Gem::Requirement
@@ -193,9 +99,9 @@ extensions: []
193
99
  extra_rdoc_files: []
194
100
  files:
195
101
  - bin/spiffy
196
- - defaults/style.css
197
- - defaults/template.haml
198
102
  - lib/spiffy.rb
103
+ - templates/default.css
104
+ - templates/default.haml
199
105
  homepage: http://rubygems.org/gems/hola
200
106
  licenses:
201
107
  - BSD-3-Clause
@@ -216,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
122
  version: '0'
217
123
  requirements: []
218
124
  rubyforge_project:
219
- rubygems_version: 2.2.2
125
+ rubygems_version: 2.4.3
220
126
  signing_key:
221
127
  specification_version: 4
222
128
  summary: A markup to HTML & PDF converter.
@@ -1,90 +0,0 @@
1
- *{margin:0;padding:0;}
2
- body {
3
- font:13.34px helvetica,arial,freesans,clean,sans-serif;
4
- color:black;
5
- line-height:1.4em;
6
- background-color: #fff;
7
- padding: 0.7em;
8
- }
9
- p {
10
- margin:1em 0;
11
- line-height:1.5em;
12
- }
13
- table {
14
- font-size:inherit;
15
- font:100%;
16
- margin:1em;
17
- }
18
- table th{border-bottom:1px solid #bbb;padding:.2em 1em;}
19
- table td{border-bottom:1px solid #ddd;padding:.2em 1em;}
20
- input[type=text],input[type=password],input[type=image],textarea{font:99% helvetica,arial,freesans,sans-serif;}
21
- select,option{padding:0 .25em;}
22
- optgroup{margin-top:.5em;}
23
- pre,code{font:12px Monaco,"Courier New","DejaVu Sans Mono","Bitstream Vera Sans Mono",monospace;}
24
- pre {
25
- margin:1em 0;
26
- font-size:12px;
27
- background-color:#eee;
28
- border:1px solid #ddd;
29
- padding:5px;
30
- line-height:1.5em;
31
- color:#444;
32
- overflow:auto;
33
- -webkit-box-shadow:rgba(0,0,0,0.07) 0 1px 2px inset;
34
- -webkit-border-radius:3px;
35
- -moz-border-radius:3px;border-radius:3px;
36
- }
37
- pre code {
38
- padding:0;
39
- font-size:12px;
40
- background-color:#eee;
41
- border:none;
42
- }
43
- code {
44
- font-size:12px;
45
- background-color:#f8f8ff;
46
- color:#444;
47
- padding:0 .2em;
48
- border:1px solid #dedede;
49
- }
50
- img{border:0;max-width:100%;}
51
- abbr{border-bottom:none;}
52
- a{color:#4183c4;text-decoration:none;}
53
- a:hover{text-decoration:underline;}
54
- a code,a:link code,a:visited code{color:#4183c4;}
55
- h2,h3{margin:1em 0;}
56
- h1,h2,h3,h4,h5,h6{border:0;}
57
- h1{font-size:170%;border-top:4px solid #aaa;padding-top:.5em;margin-top:1.5em;}
58
- h1:first-child{margin-top:0;padding-top:.25em;border-top:none;}
59
- h2{font-size:150%;margin-top:1.5em;border-top:4px solid #e0e0e0;padding-top:.5em;}
60
- h3{margin-top:1em;}
61
- hr{border:1px solid #ddd;}
62
- ul{margin:1em 0 1em 2em;}
63
- ol{margin:1em 0 1em 2em;}
64
- ul li,ol li{margin-top:.5em;margin-bottom:.5em;}
65
- ul ul,ul ol,ol ol,ol ul{margin-top:0;margin-bottom:0;}
66
- blockquote{margin:1em 0;border-left:5px solid #ddd;padding-left:.6em;color:#555;}
67
- dt{font-weight:bold;margin-left:1em;}
68
- dd{margin-left:2em;margin-bottom:1em;}
69
- sup {
70
- font-size: 0.83em;
71
- vertical-align: super;
72
- line-height: 0;
73
- }
74
- * {
75
- -webkit-print-color-adjust: exact;
76
- }
77
- @media screen and (min-width: 914px) {
78
- body {
79
- width: 854px;
80
- margin:0 auto;
81
- }
82
- }
83
- @media print {
84
- table, pre {
85
- page-break-inside: avoid;
86
- }
87
- pre {
88
- word-wrap: break-word;
89
- }
90
- }
@@ -1,7 +0,0 @@
1
- %html
2
- %head
3
- %meta{ :charset => "utf-8" }
4
- %style
5
- = yield :css
6
- %body
7
- = yield :body