verku 0.8.0.p

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/.document +5 -0
  3. data/.gitignore +49 -0
  4. data/BUILD.md +6 -0
  5. data/Gemfile +14 -0
  6. data/Gemfile.lock +82 -0
  7. data/LICENSE.md +22 -0
  8. data/README.md +149 -0
  9. data/Rakefile +72 -0
  10. data/VERSION +1 -0
  11. data/bin/verku +5 -0
  12. data/lib/verku.rb +56 -0
  13. data/lib/verku/adapters/markdown.rb +44 -0
  14. data/lib/verku/cli.rb +93 -0
  15. data/lib/verku/dependency.rb +19 -0
  16. data/lib/verku/exporter.rb +77 -0
  17. data/lib/verku/extensions/string.rb +19 -0
  18. data/lib/verku/generator.rb +55 -0
  19. data/lib/verku/parser.rb +85 -0
  20. data/lib/verku/parser/epub.rb +187 -0
  21. data/lib/verku/parser/html.rb +245 -0
  22. data/lib/verku/parser/mobi.rb +17 -0
  23. data/lib/verku/parser/pdf.rb +54 -0
  24. data/lib/verku/parser/txt.rb +1 -0
  25. data/lib/verku/stats.rb +114 -0
  26. data/lib/verku/stream.rb +27 -0
  27. data/lib/verku/toc.rb +6 -0
  28. data/lib/verku/toc/epub.rb +41 -0
  29. data/lib/verku/toc/html.rb +78 -0
  30. data/lib/verku/version.rb +10 -0
  31. data/templates/config.erb +80 -0
  32. data/templates/cover.jpg +0 -0
  33. data/templates/dp-logo.png +0 -0
  34. data/templates/epub/back.erb +22 -0
  35. data/templates/epub/copyright.erb +46 -0
  36. data/templates/epub/cover.erb +12 -0
  37. data/templates/epub/cover.html +12 -0
  38. data/templates/epub/page.erb +15 -0
  39. data/templates/epub/user.css +500 -0
  40. data/templates/extras.tex +1 -0
  41. data/templates/html/copyright.erb +46 -0
  42. data/templates/html/layout.css +352 -0
  43. data/templates/html/layout.erb +45 -0
  44. data/templates/html/syntax.css +58 -0
  45. data/templates/html/thanks.erb +21 -0
  46. data/templates/html/user.css +7 -0
  47. data/templates/latex.erb +416 -0
  48. data/templates/merovex-logo.jpg +0 -0
  49. data/templates/merovex-logo.png +0 -0
  50. data/templates/pdf/layout.erb +418 -0
  51. data/templates/rakefile.rb +103 -0
  52. data/templates/readme.erb +3 -0
  53. data/templates/text/01-Getting-Started.md +27 -0
  54. data/templates/text/02-Creating-Chapters.md +22 -0
  55. data/templates/text/03-Generating-Output.md +2 -0
  56. data/templates/text/10-Test-Markdown.md +157 -0
  57. data/test/helper.rb +34 -0
  58. data/test/test_bookmaker.rb +7 -0
  59. data/verku.gemspec +142 -0
  60. metadata +317 -0
@@ -0,0 +1 @@
1
+ % Extra LaTeX Commands
@@ -0,0 +1,46 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>Copyright Page</title>
5
+ <style type="text/css"> img { max-width: 100%; } </style>
6
+ </head>
7
+ <body>
8
+ <div class="copyright">
9
+ <h2 class="no-toc"><%= title %></h2>
10
+ <% if type == 'fiction' %>
11
+ <p>This is a work of fiction. Names, characters, places and incidents are either
12
+ the product of the author's imagination or are used fictitiously, and any resemblance to
13
+ actual persons, living or dead, business establishments, events or locales is entirely
14
+ coincidental.</p>
15
+ <% end %>
16
+
17
+ <p><em><%= copyright.gsub("(C)", "&copy;") %></em></p>
18
+
19
+ <% unless designer['cover'].nil? || designer['cover'].empty? %>
20
+ <p> Cover Design by <%= designer['cover'] %></p>
21
+ <% end %>
22
+
23
+ <% unless designer['book'].nil? || designer['book'].empty? %>
24
+ <p> Book Design by <%= designer['book'] %></p>
25
+ <% end %>
26
+
27
+ <% unless editors['text'].nil? || editors['text'].empty? %>
28
+ <p> Edited by <%= editors['text'].join(',') %></p>
29
+ <% end %>
30
+
31
+
32
+ <p> All rights reserved.</p>
33
+
34
+ <p> No part of this publication may be reproduced, stored in a retrieval system, posted on the Internet, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without prior written permission from the author. The only exception is by a reviewer, who may quote short excerpts in a review.</p>
35
+
36
+ <p> Visit my website at <%= "<a href='#{base_url}'>#{base_url}</a>" %></p>
37
+
38
+ <p> Printed in the United States of America</p>
39
+
40
+ <p><em>First Printing, <%= published_at %></em></p>
41
+
42
+ <p> <%= identifier['type'] %> <%= identifier['id'] %></p>
43
+
44
+ </div>
45
+ </body>
46
+ </html>
@@ -0,0 +1,352 @@
1
+ /* ============ */
2
+ /* = DEFAULTS = */
3
+ /* ============ */
4
+ html * {
5
+ font: normal normal normal 12pt/normal Constantia, Palatino, "Palatino Linotype", "Palatino LT STD", Georgia, serif;
6
+ }
7
+
8
+ /* ========= */
9
+ /* = PAGES = */
10
+ /* ========= */
11
+ @page {
12
+ margin: 12mm 16mm 10mm 16mm;
13
+ size: 7in 9.25in landscape;
14
+
15
+ @footnotes {
16
+ border-top: thin solid black;
17
+ margin-left: 30%;
18
+ margin-top: 0.6em;
19
+ padding-top: 0.3em;
20
+ }
21
+
22
+ @bottom-right {
23
+ color: #000;
24
+ content: counter(page);
25
+ font-family: helvetica, arial, sans-serif;
26
+ font-size: 12px;
27
+ margin-top: -10px;
28
+ margin-right: -40px;
29
+ }
30
+ }
31
+
32
+ @page toc {
33
+ margin-right: 6mm;
34
+
35
+ @bottom-right {
36
+ content: "";
37
+ }
38
+ }
39
+
40
+ @page cover {
41
+ margin: 0;
42
+
43
+ @bottom-right {
44
+ content: "";
45
+ }
46
+ }
47
+
48
+ /* ============= */
49
+ /* = BOOKMARKS = */
50
+ /* ============= */
51
+ h1, h2, h3, h4, h5, h6 {
52
+ }
53
+
54
+ .frontcover h1 { }
55
+ .chapter h2 { }
56
+ .chapter h3 { }
57
+ .chapter h4 { }
58
+ .chapter h5 { }
59
+ .chapter h6 { }
60
+
61
+ /* ============= */
62
+ /* = CONTAINER = */
63
+ /* ============= */
64
+ div.container {
65
+ height: 7in;
66
+ left: 0;
67
+ page: cover;
68
+ position: absolute;
69
+ top: 0;
70
+ width: 9.25in;
71
+ z-index: -1;
72
+ }
73
+
74
+ /* ============== */
75
+ /* = FRONTCOVER = */
76
+ /* ============== */
77
+ div.frontcover {
78
+ background: #fff;
79
+ }
80
+
81
+ div.frontcover div {
82
+ left: 1in;
83
+ padding-top: 0.25in;
84
+ position: absolute;
85
+ top: 2.5in;
86
+ width: 7.25in;
87
+ }
88
+
89
+ div.frontcover h1 {
90
+ color: #f00;
91
+ font-size: 46pt;
92
+ }
93
+
94
+ div.frontcover p {
95
+ font-size: 18pt;
96
+ }
97
+
98
+ div.frontcover p.description {
99
+ color: #666;
100
+ font: italic normal normal 14pt/normal Baskerville, "Hoefler Text", Garamond, "Times New Roman", serif;
101
+ margin-top: -.1in;
102
+ }
103
+
104
+ div.frontcover p.authors {
105
+ color: #000;
106
+ font-style: italic;
107
+ position: absolute;
108
+ top: 0;
109
+ }
110
+
111
+ div.frontcover * {
112
+ margin: 0;
113
+ }
114
+
115
+ /* =========== */
116
+ /* = CHAPTER = */
117
+ /* =========== */
118
+ #chapters {
119
+ counter-reset: page 1;
120
+ counter-reset: chapter;
121
+ page-break-before: always;
122
+ }
123
+
124
+ .chapter {
125
+ color: #444;
126
+ counter-reset: footnote 0;
127
+ page-break-after: always;
128
+ }
129
+
130
+ .chapter a {
131
+ color: #0AE;
132
+ text-decoration: none;
133
+ }
134
+
135
+ .chapter h2,
136
+ .chapter h3,
137
+ .chapter h4,
138
+ .chapter h5 {
139
+ margin: 25pt 0 15pt 0;
140
+ }
141
+
142
+ .chapter h2 {
143
+ color: #222;
144
+ counter-increment: chapter;
145
+ font-size: 36pt;
146
+ line-height: 1;
147
+ string-set: header "Chapter " counter(chapter) ": " content();
148
+ }
149
+
150
+ .chapter h2::before {
151
+ content: "Chapter " counter(chapter);
152
+ color: #999;
153
+ display: block;
154
+ font-size: 18pt;
155
+ letter-spacing: 0;
156
+ margin-bottom: .2em;
157
+ white-space: pre;
158
+ }
159
+
160
+ .chapter h3,
161
+ .chapter h5 {
162
+ font-family: "helvetica", arial, sans-serif;
163
+ }
164
+
165
+ .chapter h3 {
166
+ color: #b62f32;
167
+ font-size: 28px;
168
+ }
169
+
170
+ .chapter h4 {
171
+ font-size: 18px;
172
+ font-family: "helvetica neue", "arial narrow", sans-serif;
173
+ }
174
+
175
+ .chapter h5 {
176
+ font-size: 15px;
177
+ }
178
+
179
+ .chapter h6 {
180
+ font-size: 15px;
181
+ font-weight: normal;
182
+ text-transform: uppercase;
183
+ }
184
+
185
+ /* =========== */
186
+ /* = IMPRINT = */
187
+ /* =========== */
188
+ .imprint {
189
+ background: #E2E7E2;
190
+ page: cover;
191
+ string-set: header "";
192
+ }
193
+
194
+ .imprint, .imprint * {
195
+ color: #5b5b5b;
196
+ }
197
+
198
+ .imprint * {
199
+ font-family: "Lucida Grande", arial, sans-serif;
200
+ font-size: 10pt;
201
+ margin: 0 0 2pt 0;
202
+ }
203
+
204
+ .imprint div {
205
+ left: 0.5in;
206
+ position: absolute;
207
+ bottom: 0.3in;
208
+ }
209
+
210
+ /* ========== */
211
+ /* = CODING = */
212
+ /* ========== */
213
+ pre, code {
214
+ color: #090;
215
+ font-family: monaco, monospace;
216
+ font-size: 9pt;
217
+ }
218
+
219
+ pre, pre code {
220
+ font-size: 8pt;
221
+ line-height: 1.4;
222
+ padding-left: 25pt;
223
+ }
224
+
225
+ /* ========= */
226
+ /* = TABLE = */
227
+ /* ========= */
228
+ table {
229
+ border-collapse: collapse;
230
+ }
231
+
232
+ thead th {
233
+ background: #e9e9e9;
234
+ }
235
+
236
+ th, td {
237
+ border: 1px solid #ccc;
238
+ font-size: 11pt;
239
+ padding: 5pt;
240
+ }
241
+
242
+ /* ========= */
243
+ /* = LISTS = */
244
+ /* ========= */
245
+ li {
246
+ margin-bottom: 8pt;
247
+ }
248
+
249
+ li ul,
250
+ li ol {
251
+ margin-left: 15pt;
252
+ }
253
+
254
+ /* ========== */
255
+ /* = FIGURE = */
256
+ /* ========== */
257
+ .figure img:after {
258
+ content: attr("alt");
259
+ display: block;
260
+ font-size: 10pt;
261
+ }
262
+
263
+ img {
264
+ max-width: none;
265
+ prince-image-resolution: 96dpi;
266
+ }
267
+
268
+ .figure {
269
+ float: right;
270
+ margin: 0 0 20pt 20pt;
271
+ overflow: auto;
272
+ text-align: center;
273
+ }
274
+
275
+ /* ===================== */
276
+ /* = TABLE OF CONTENTS = */
277
+ /* ===================== */
278
+ div.table-of-contents {
279
+ page: toc;
280
+ }
281
+
282
+ div.table-of-contents h2 {
283
+ font-size: 36pt;
284
+ }
285
+
286
+ div.table-of-contents a {
287
+ font-size: 11pt;
288
+ text-decoration: none;
289
+ }
290
+
291
+ div.table-of-contents div.level2 a {
292
+ color: #000;
293
+ font-weight: bold;
294
+ }
295
+
296
+ div.table-of-contents #toc {
297
+ column-count: 2;
298
+ column-fill: auto;
299
+ column-gap: 5%;
300
+ column-rule: none;
301
+ column-width: 45%;
302
+ }
303
+
304
+ div.table-of-contents #toc div {
305
+ padding-bottom: 10px;
306
+ }
307
+
308
+ div.table-of-contents div.level3 {
309
+ margin-left: 20px;
310
+ }
311
+
312
+ div.table-of-contents #toc div.level3 a {
313
+ color: #555;
314
+ }
315
+
316
+ div.table-of-contents div a::before {
317
+ color: #888;
318
+ content: target-counter(attr(href), page) " ";
319
+ float: left;
320
+ font-weight: normal;
321
+ font-size: 11pt !important;
322
+ margin-right: 4px;
323
+ width: 40px;
324
+ }
325
+
326
+ div.table-of-contents div.level3 a::before {
327
+ width: 20px;
328
+ }
329
+
330
+ div.table-of-contents div.level4,
331
+ div.table-of-contents div.level5,
332
+ div.table-of-contents div.level6 {
333
+ display: none;
334
+ }
335
+
336
+ /* ===================== */
337
+ /* = OTHER TEXT TWEAKS = */
338
+ /* ===================== */
339
+ acronym:after {
340
+ content: " (" attr(title) ")";
341
+ }
342
+
343
+ /* ============= */
344
+ /* = HIGHLIGHT = */
345
+ /* ============= */
346
+ .highlight {
347
+ font-size: 20pt;
348
+ }
349
+
350
+ .highlight strong {
351
+ color: #b62f32;
352
+ }
@@ -0,0 +1,45 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title><%= title %></title>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <meta name="generator" content="Verku Gem" />
7
+ <meta name="author" content="<%= authors.to_sentence %>" />
8
+ <meta name="subject" content="<%= subject %>" />
9
+ <meta name="keywords" content="<%= keywords %>" />
10
+ <meta name="date" content="<%= published_at %>" />
11
+
12
+ <!-- charset=utf-8,html,xhtml -->
13
+ <meta name="date" content="<%= published_at %>" />
14
+
15
+ <link rel="stylesheet" type="text/css" href="../templates/html/layout.css"/>
16
+ <link rel="stylesheet" type="text/css" href="../templates/html/syntax.css"/>
17
+ <link rel="stylesheet" type="text/css" href="../templates/html/user.css"/>
18
+ </head>
19
+ <body>
20
+ <div class="frontcover container">
21
+ <div>
22
+ <h1><%= title %></h1>
23
+ <p class="description"><%= subject %></p>
24
+ <p class="authors"><%= authors.to_sentence %></p>
25
+ </div>
26
+ </div>
27
+
28
+ <div class="table-of-contents">
29
+ <h2 class="no-toc">Content</h2>
30
+ <div id="toc">
31
+ <%= toc %>
32
+ </div>
33
+ </div>
34
+ <div id='chapters'>
35
+ <%= contents %>
36
+ </div>
37
+ <div class="imprint container">
38
+ <div>
39
+ <h2><%= title %></h2>
40
+ <p><%= authors.to_sentence %></p>
41
+ <p><%= copyright %></p>
42
+ </div>
43
+ </div>
44
+ </body>
45
+ </html>
@@ -0,0 +1,58 @@
1
+ .hll { background-color: #ffffcc }
2
+ .c { color: #aaaaaa; } /* Comment */
3
+ .err { color: #F00000; background-color: #F0A0A0 } /* Error */
4
+ .k { color: #0000aa } /* Keyword */
5
+ .cm { color: #aaaaaa; } /* Comment.Multiline */
6
+ .cp { color: #4c8317 } /* Comment.Preproc */
7
+ .c1 { color: #aaaaaa; } /* Comment.Single */
8
+ .cs { color: #0000aa; } /* Comment.Special */
9
+ .gd { color: #aa0000 } /* Generic.Deleted */
10
+ .ge { } /* Generic.Emph */
11
+ .gr { color: #aa0000 } /* Generic.Error */
12
+ .gh { color: #000080; font-weight: bold } /* Generic.Heading */
13
+ .gi { color: #00aa00 } /* Generic.Inserted */
14
+ .go { color: #888888 } /* Generic.Output */
15
+ .gp { color: #555555 } /* Generic.Prompt */
16
+ .gs { font-weight: bold } /* Generic.Strong */
17
+ .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
18
+ .gt { color: #aa0000 } /* Generic.Traceback */
19
+ .kc { color: #0000aa } /* Keyword.Constant */
20
+ .kd { color: #0000aa } /* Keyword.Declaration */
21
+ .kn { color: #0000aa } /* Keyword.Namespace */
22
+ .kp { color: #0000aa } /* Keyword.Pseudo */
23
+ .kr { color: #0000aa } /* Keyword.Reserved */
24
+ .kt { color: #00aaaa } /* Keyword.Type */
25
+ .m { color: #009999 } /* Literal.Number */
26
+ .s { color: #aa5500 } /* Literal.String */
27
+ .na { color: #1e90ff } /* Name.Attribute */
28
+ .nb { color: #00aaaa } /* Name.Builtin */
29
+ .nc { color: #00aa00; } /* Name.Class */
30
+ .no { color: #aa0000 } /* Name.Constant */
31
+ .nd { color: #888888 } /* Name.Decorator */
32
+ .ni { color: #800000; font-weight: bold } /* Name.Entity */
33
+ .nf { color: #00aa00 } /* Name.Function */
34
+ .nn { color: #00aaaa; } /* Name.Namespace */
35
+ .nt { color: #1e90ff; font-weight: bold } /* Name.Tag */
36
+ .nv { color: #aa0000 } /* Name.Variable */
37
+ .ow { color: #0000aa } /* Operator.Word */
38
+ .w { color: #bbbbbb } /* Text.Whitespace */
39
+ .mf { color: #009999 } /* Literal.Number.Float */
40
+ .mh { color: #009999 } /* Literal.Number.Hex */
41
+ .mi { color: #009999 } /* Literal.Number.Integer */
42
+ .mo { color: #009999 } /* Literal.Number.Oct */
43
+ .sb { color: #aa5500 } /* Literal.String.Backtick */
44
+ .sc { color: #aa5500 } /* Literal.String.Char */
45
+ .sd { color: #aa5500 } /* Literal.String.Doc */
46
+ .s2 { color: #aa5500 } /* Literal.String.Double */
47
+ .se { color: #aa5500 } /* Literal.String.Escape */
48
+ .sh { color: #aa5500 } /* Literal.String.Heredoc */
49
+ .si { color: #aa5500 } /* Literal.String.Interpol */
50
+ .sx { color: #aa5500 } /* Literal.String.Other */
51
+ .sr { color: #009999 } /* Literal.String.Regex */
52
+ .s1 { color: #aa5500 } /* Literal.String.Single */
53
+ .ss { color: #0000aa } /* Literal.String.Symbol */
54
+ .bp { color: #00aaaa } /* Name.Builtin.Pseudo */
55
+ .vc { color: #aa0000 } /* Name.Variable.Class */
56
+ .vg { color: #aa0000 } /* Name.Variable.Global */
57
+ .vi { color: #aa0000 } /* Name.Variable.Instance */
58
+ .il { color: #009999 } /* Literal.Number.Integer.Long */