prophecy 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.
Files changed (129) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +19 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/Overview.md +44 -0
  6. data/README.md +35 -0
  7. data/Rakefile +1 -0
  8. data/bin/kindlegen +18 -0
  9. data/bin/kindlegen.exe +0 -0
  10. data/bin/kindlegen_linux +0 -0
  11. data/bin/kindlegen_mac +0 -0
  12. data/bin/prophecy +4 -0
  13. data/docs/licenses/kindlegen/.empty_directory +0 -0
  14. data/docs/licenses/kindlegen/EULA.txt +61 -0
  15. data/docs/licenses/kindlegen/KindleGen Legal Notices 2009-11-10 Linux.txt +21 -0
  16. data/docs/licenses/kindlegen/KindleGen Legal Notices 2009-11-10 Mac.txt +21 -0
  17. data/docs/licenses/kindlegen/KindleGen OSS Notices 2009-07-29-Windows.txt +19 -0
  18. data/features/assets.feature +14 -0
  19. data/features/book.feature +10 -0
  20. data/features/generator.feature +15 -0
  21. data/features/support/hooks.rb +5 -0
  22. data/features/support/setup.rb +3 -0
  23. data/lib/prophecy/assets/.gitignore +2 -0
  24. data/lib/prophecy/assets/config.rb +20 -0
  25. data/lib/prophecy/assets/epub_template/META-INF/com.apple.ibooks.display-options.xml +6 -0
  26. data/lib/prophecy/assets/epub_template/META-INF/container.xml +6 -0
  27. data/lib/prophecy/assets/epub_template/OEBPS/.gitkeep +0 -0
  28. data/lib/prophecy/assets/epub_template/OEBPS/chapters/.gitkeep +0 -0
  29. data/lib/prophecy/assets/epub_template/OEBPS/content.opf.erb +114 -0
  30. data/lib/prophecy/assets/epub_template/OEBPS/toc.ncx.erb +18 -0
  31. data/lib/prophecy/assets/epub_template/mimetype +1 -0
  32. data/lib/prophecy/assets/fonts/Crimson-Bold.otf +0 -0
  33. data/lib/prophecy/assets/fonts/Crimson-BoldItalic.otf +0 -0
  34. data/lib/prophecy/assets/fonts/Crimson-Italic.otf +0 -0
  35. data/lib/prophecy/assets/fonts/Crimson-Roman.otf +0 -0
  36. data/lib/prophecy/assets/fonts/Crimson-Semibold.otf +0 -0
  37. data/lib/prophecy/assets/fonts/Crimson-SemiboldItalic.otf +0 -0
  38. data/lib/prophecy/assets/fonts/GenBasB.ttf +0 -0
  39. data/lib/prophecy/assets/fonts/GenBasBI.ttf +0 -0
  40. data/lib/prophecy/assets/fonts/GenBasI.ttf +0 -0
  41. data/lib/prophecy/assets/fonts/GenBasR.ttf +0 -0
  42. data/lib/prophecy/assets/fonts/GenBkBasB.ttf +0 -0
  43. data/lib/prophecy/assets/fonts/GenBkBasBI.ttf +0 -0
  44. data/lib/prophecy/assets/fonts/GenBkBasI.ttf +0 -0
  45. data/lib/prophecy/assets/fonts/GenBkBasR.ttf +0 -0
  46. data/lib/prophecy/assets/fonts/GentiumPlus-I.ttf +0 -0
  47. data/lib/prophecy/assets/fonts/GentiumPlus-R.ttf +0 -0
  48. data/lib/prophecy/assets/helpers/check_typos.sh +27 -0
  49. data/lib/prophecy/assets/helpers/helpers.rb +0 -0
  50. data/lib/prophecy/assets/helpers/pali_typos +2 -0
  51. data/lib/prophecy/assets/helpers/sed_chars +5 -0
  52. data/lib/prophecy/assets/helpers/sed_dumb_ebook +18 -0
  53. data/lib/prophecy/assets/helpers/sed_tex2uni +62 -0
  54. data/lib/prophecy/assets/helpers/tex2html.sh +112 -0
  55. data/lib/prophecy/assets/helpers/tex2md.sh +10 -0
  56. data/lib/prophecy/assets/helpers/tidy_quotes +1 -0
  57. data/lib/prophecy/assets/helpers/tidy_quotes.sh +8 -0
  58. data/lib/prophecy/assets/helpers/to-html.sh +9 -0
  59. data/lib/prophecy/assets/latex_template/Makefile +37 -0
  60. data/lib/prophecy/assets/latex_template/anecdote.cls +163 -0
  61. data/lib/prophecy/assets/latex_template/book-core-first.sty +673 -0
  62. data/lib/prophecy/assets/latex_template/book-core-last.sty +40 -0
  63. data/lib/prophecy/assets/latex_template/book_main.tex.erb +31 -0
  64. data/lib/prophecy/assets/latex_template/booklet_main.tex +15 -0
  65. data/lib/prophecy/assets/latex_template/chapters/.gitkeep +0 -0
  66. data/lib/prophecy/assets/latex_template/cover_main.tex +48 -0
  67. data/lib/prophecy/assets/latex_template/mylayout.sty +2 -0
  68. data/lib/prophecy/assets/layouts/page.xhtml.erb +20 -0
  69. data/lib/prophecy/assets/sass/_booktheme.sass +3 -0
  70. data/lib/prophecy/assets/sass/_byronic.sass +263 -0
  71. data/lib/prophecy/assets/sass/_colors.sass +7 -0
  72. data/lib/prophecy/assets/sass/_epub-css-starter-kit.sass +734 -0
  73. data/lib/prophecy/assets/sass/_font-existence.scss +12 -0
  74. data/lib/prophecy/assets/sass/_font-source-sans-pro.scss +75 -0
  75. data/lib/prophecy/assets/sass/_fontfaces.scss +11 -0
  76. data/lib/prophecy/assets/sass/_mixins.sass +4 -0
  77. data/lib/prophecy/assets/sass/print.sass +6 -0
  78. data/lib/prophecy/assets/sass/style-epub.sass +7 -0
  79. data/lib/prophecy/assets/sass/style-mobi-kf8.sass +7 -0
  80. data/lib/prophecy/assets/sass/style-mobi.sass +9 -0
  81. data/lib/prophecy/assets/stylesheets/print.css +3 -0
  82. data/lib/prophecy/assets/stylesheets/style-epub.css +401 -0
  83. data/lib/prophecy/assets/stylesheets/style-mobi-kf8.css +401 -0
  84. data/lib/prophecy/assets/stylesheets/style-mobi.css +317 -0
  85. data/lib/prophecy/assets/webfonts/existence-light.ttf +0 -0
  86. data/lib/prophecy/assets/webfonts/sourcesanspro-bold.ttf +0 -0
  87. data/lib/prophecy/assets/webfonts/sourcesanspro-extralight.ttf +0 -0
  88. data/lib/prophecy/assets/webfonts/sourcesanspro-italic.ttf +0 -0
  89. data/lib/prophecy/assets/webfonts/sourcesanspro-light.ttf +0 -0
  90. data/lib/prophecy/assets/webfonts/sourcesanspro-lightitalic.ttf +0 -0
  91. data/lib/prophecy/assets/webfonts/sourcesanspro-regular.ttf +0 -0
  92. data/lib/prophecy/assets/webfonts-extra/sourcesanspro-bolditalic.ttf +0 -0
  93. data/lib/prophecy/assets/webfonts-extra/sourcesanspro-extralightitalic.ttf +0 -0
  94. data/lib/prophecy/assets/webfonts-extra/sourcesanspro-semibold.ttf +0 -0
  95. data/lib/prophecy/assets/webfonts-extra/sourcesanspro-semibolditalic.ttf +0 -0
  96. data/lib/prophecy/book.rb +281 -0
  97. data/lib/prophecy/chapter.rb +359 -0
  98. data/lib/prophecy/cli.rb +144 -0
  99. data/lib/prophecy/generators/assets.rb +29 -0
  100. data/lib/prophecy/generators/book/.gitignore +7 -0
  101. data/lib/prophecy/generators/book/LICENSE.txt +5 -0
  102. data/lib/prophecy/generators/book/README.md.tt +4 -0
  103. data/lib/prophecy/generators/book/book.yml.tt +55 -0
  104. data/lib/prophecy/generators/book/build/epub/.empty_directory +0 -0
  105. data/lib/prophecy/generators/book/build/latex/.empty_directory +0 -0
  106. data/lib/prophecy/generators/book/build/mobi/.empty_directory +0 -0
  107. data/lib/prophecy/generators/book/epub_mobi.yml +26 -0
  108. data/lib/prophecy/generators/book/example-book.yml +78 -0
  109. data/lib/prophecy/generators/book/images/cover.jpg +0 -0
  110. data/lib/prophecy/generators/book/images/cover.xcf +0 -0
  111. data/lib/prophecy/generators/book/images/publisher-logo.jpg +0 -0
  112. data/lib/prophecy/generators/book/manuscript/glossary.md +7 -0
  113. data/lib/prophecy/generators/book/manuscript/nameless-labyrinth.markdown +34 -0
  114. data/lib/prophecy/generators/book/manuscript/preface.md +5 -0
  115. data/lib/prophecy/generators/book/manuscript/the-sway-of-reason.markdown +22 -0
  116. data/lib/prophecy/generators/book/manuscript/unhuman-massiveness.markdown +27 -0
  117. data/lib/prophecy/generators/book/manuscript/xhtml/.gitkeep +0 -0
  118. data/lib/prophecy/generators/book/manuscript/xhtml/cover.xhtml.erb +21 -0
  119. data/lib/prophecy/generators/book/manuscript/xhtml/titlepage.xhtml.erb +31 -0
  120. data/lib/prophecy/generators/book/manuscript/xhtml/toc.xhtml.erb +16 -0
  121. data/lib/prophecy/generators/new.rb +22 -0
  122. data/lib/prophecy/manifest.rb +72 -0
  123. data/lib/prophecy/version.rb +3 -0
  124. data/lib/prophecy.rb +18 -0
  125. data/prophecy.gemspec +36 -0
  126. data/spec/book_spec.rb +9 -0
  127. data/spec/chapter_spec.rb +0 -0
  128. data/spec/manifest_spec.rb +0 -0
  129. metadata +366 -0
@@ -0,0 +1,31 @@
1
+ \documentclass[
2
+ final,
3
+ pagePreset=largepage,
4
+ babelLanguage=british,
5
+ ]{anecdote}
6
+
7
+ %\usepackage{mylayout}
8
+
9
+ %% Details of the book
10
+ %% ===================
11
+
12
+ \title{<%= book.title %>}
13
+ \subtitle{<%= book.subtitle %>}
14
+ \author{<%= book.author %>}
15
+ \date{<%= book.date %>}
16
+ \editionInfo{<%= book.edition %>}
17
+ \ISBN{<%= book.isbn %>}
18
+
19
+ %% === Load further packages ===
20
+
21
+ %% === Hyphenation exceptions and corrections ===
22
+
23
+ % \hyphenation{}
24
+
25
+ \begin{document}
26
+
27
+ <% book.chapters.each do |ch| %>
28
+ <%= ch.to_chapterlist %>
29
+ <% end %>
30
+
31
+ \end{document}
@@ -0,0 +1,15 @@
1
+ \documentclass{article}
2
+ \usepackage[
3
+ paperwidth=8in,
4
+ paperheight=10.5in,
5
+ landscape,
6
+ nohead,
7
+ nofoot,
8
+ margin=0pt]{geometry}
9
+ \usepackage{pdfpages}
10
+ \begin{document}
11
+ \includepdf[
12
+ pages=-,
13
+ booklet=true,
14
+ ]{book_main.pdf}
15
+ \end{document}
@@ -0,0 +1,48 @@
1
+ \documentclass{article}
2
+
3
+ \makeatletter
4
+
5
+ \usepackage{calc}
6
+ \newlength\onePageWidth
7
+ \newlength\onePageHeight
8
+ \newlength\spineWidth
9
+
10
+ % pagesize: 5.25in x 8in
11
+ % spinewidth: 9.374mm
12
+ \setlength{\onePageWidth}{5.25in}
13
+ \setlength{\onePageHeight}{8in}
14
+ \setlength{\spineWidth}{9.374mm}
15
+
16
+ \newlength\geoPaperWidth
17
+ \setlength\geoPaperWidth{2\onePageWidth+\spineWidth}
18
+ \newlength\frontCoverX
19
+ \setlength\frontCoverX{\onePageWidth+\spineWidth}
20
+
21
+ \usepackage[
22
+ paperwidth=\geoPaperWidth,
23
+ paperheight=\onePageHeight,
24
+ nohead,
25
+ nofoot,
26
+ margin=0pt]{geometry}
27
+ \usepackage[cmyk]{xcolor}
28
+ \usepackage{graphicx}
29
+ \usepackage{eso-pic}
30
+ \graphicspath{{./}}
31
+
32
+ \makeatother
33
+
34
+ \begin{document}
35
+ \mbox{}
36
+ %\pagecolor[RGB]{137, 101, 82}
37
+ %
38
+ \AddToShipoutPictureFG*{\put(\LenToUnit{0mm},\LenToUnit{0mm})%
39
+ {\includegraphics[keepaspectratio, height=\paperheight]{cover_back.pdf}}}
40
+ %
41
+ \AddToShipoutPictureFG*{\put(\LenToUnit{\onePageWidth},\LenToUnit{0mm})%
42
+ {\includegraphics[keepaspectratio, height=\paperheight]{cover_spine_L.pdf}}}
43
+ %
44
+ \AddToShipoutPictureFG*{\put(\LenToUnit{\frontCoverX},\LenToUnit{0mm})%
45
+ {\includegraphics[keepaspectratio, height=\paperheight]{cover_front.pdf}}}
46
+ %
47
+ \end{document}
48
+
@@ -0,0 +1,2 @@
1
+ \ProvidesPackage{mylayout}
2
+
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="utf-8" standalone="no"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= book.lang_iso_639_2 %>" lang="<%= book.lang_iso_639_2 %>">
4
+ <head>
5
+ <meta http-equiv="content-type" content="text/html;charset=utf-8" />
6
+ <title><%= chapter.title %></title>
7
+ <% if book.mobi? %>
8
+ <link href="../stylesheets/style-mobi.css" media="amzn-mobi" rel="stylesheet" type="text/css" />
9
+ <link href="../stylesheets/style-mobi-kf8.css" media="amzn-kf8" rel="stylesheet" type="text/css" />
10
+ <% elsif book.epub? %>
11
+ <link href="../stylesheets/style-epub.css" media="all, screen" rel="stylesheet" type="text/css" />
12
+ <% end %>
13
+ </head>
14
+ <body id="content" class="<%= chapter.class %>">
15
+ <div id="<%= chapter.id %>" xml:lang="<%= chapter.lang %>">
16
+ <%= content %>
17
+ </div>
18
+ </body>
19
+ </html>
20
+
@@ -0,0 +1,3 @@
1
+
2
+ @import 'byronic'
3
+
@@ -0,0 +1,263 @@
1
+
2
+ /* Byronic Ebook Style
3
+ *
4
+ * https://github.com/profound-labs/byronic
5
+ *
6
+ * Based on the ePub Zen Garden structure elements.
7
+ * http://epubzengarden.com/
8
+ *
9
+ * Released under the Creative Commons Attribution License.
10
+ * http://creativecommons.org/licenses/by/3.0/
11
+
12
+ @import "compass/typography/links/link-colors"
13
+
14
+ $contentPadding: 22px
15
+ $headerRightMargin: 0px
16
+ $titlePageRuleWidth: 40px
17
+
18
+ #content
19
+ font-family: 'SourceSansPro', 'Lucida Grande', 'DejaVu Sans', 'Bitstream Vera Sans', 'Tahoma', 'Palatino', 'Caecilia', sans-serif
20
+ font-weight: normal
21
+ line-height: 1.5em
22
+ padding: $contentPadding
23
+ margin-left: 0
24
+ margin-right: 0
25
+ //vertical-align: baseline
26
+ //color: $textColor
27
+ //background-color: $textBgColor
28
+
29
+ h1, h2, h3, h4, h5, h6
30
+ font-weight: normal
31
+ font-family: 'SourceSansPro', 'Lucida Grande', 'DejaVu Sans', 'Bitstream Vera Sans', 'Tahoma', 'Palatino', 'Caecilia', sans-serif
32
+ page-break-after: avoid
33
+
34
+ h1, h2
35
+ // left-align or center, otherwise multi-line header might be justified with big gaps
36
+ text-align: left
37
+ text-transform: uppercase
38
+ // to make sure that high letters aren't covered by the margin
39
+ padding-top: 10px
40
+
41
+ h1
42
+ font-size: 2em
43
+ margin: 0.5em 0 1em $headerRightMargin
44
+ padding-right: 0
45
+ padding-bottom: 0
46
+ letter-spacing: 1.2pt
47
+ line-height: 0.95em
48
+ //border-bottom: 1px solid $lightGray
49
+ /* The chapter headings contain two spans with these classes:
50
+ * chapter-name (always contains the word "Chapter") and
51
+ * chapter-number (as a roman numeral)
52
+ .chapter-name
53
+ font-weight: normal
54
+ .chapter-number
55
+ font-size: 0.8em
56
+ letter-spacing: 0.1em
57
+
58
+ h2
59
+ font-size: 1.5em
60
+ font-weight: 300
61
+ line-height: 1.05em
62
+ margin-bottom: 0.25em
63
+ letter-spacing: 1pt
64
+
65
+ h3, h4
66
+ font-weight: bold
67
+ text-transform: none
68
+ margin-bottom: 0.1em
69
+
70
+ a
71
+ +link-colors($gray)
72
+
73
+ /* The main title page of the book.
74
+ * h1 - title
75
+ * h2 - subtitle
76
+ * h3 - author
77
+
78
+ /* For pages annoncing "Part I" or "Book VI"
79
+ * h1 - Part I
80
+ * h2 - part title
81
+ * h3 - part subtitle
82
+
83
+ #content.title-page,
84
+ #content.part-page
85
+ p
86
+ text-align: right
87
+ padding-right: $headerRightMargin
88
+ h1, h2, h3
89
+ font-family: 'ExistenceLight'
90
+ text-align: right
91
+ text-transform: none
92
+ h1, h2
93
+ letter-spacing: 1.5pt
94
+ h1
95
+ font-size: 2em
96
+ text-transform: uppercase
97
+ margin-top: 0
98
+ margin-bottom: 0.2em
99
+ padding-top: 2em
100
+ padding-right: $headerRightMargin
101
+ line-height: 1em
102
+ h2
103
+ font-size: 1.5em
104
+ margin-top: 0
105
+ margin-bottom: 0.3em
106
+ padding-top: 0.3em
107
+ padding-right: $headerRightMargin
108
+ h3
109
+ font-size: 1.2em
110
+ margin-bottom: 3em
111
+ padding-right: $headerRightMargin
112
+
113
+ div.title-page-rule
114
+ height: $titlePageRuleWidth
115
+ margin-left: 0
116
+ margin-right: 0
117
+ background-color: lighten($gray, 60%)
118
+ text-align: right
119
+ padding-right: $headerRightMargin
120
+
121
+ div.publisher-logo
122
+ float: right
123
+ clear: right
124
+ margin-top: 5px
125
+ margin-right: 15px
126
+ padding-bottom: 20px
127
+
128
+ table.toc
129
+ td.section
130
+ text-align: right
131
+ color: $gray
132
+ td.title
133
+ a
134
+ text-decoration: none
135
+ +link-colors(lighten(black, 10%))
136
+ &.frontmatter,
137
+ &.backmatter
138
+ font-style: italic
139
+ td.separator
140
+ width: 30px
141
+ text-align: center
142
+ font-size: 2em
143
+ color: lighten($gray, 30%)
144
+
145
+ /* Epigraphs at the beginning of each chapter are in blockquotes
146
+ h1+blockquote,
147
+ blockquote.epigraph,
148
+ //margin-left: 4em
149
+ margin-right: 1em
150
+ margin-top: 0.3em
151
+ margin-bottom: 1em
152
+ font-size: 0.9em
153
+ font-style: italic
154
+ p
155
+ text-indent: 0
156
+ padding-top: 0
157
+ margin-top: 2pt
158
+
159
+ blockquote
160
+ border-left: 1px solid lighten($gray, 40%)
161
+ padding: 0.3em 0 0.3em 1em
162
+
163
+ #content.verse blockquote
164
+ font-style: normal
165
+ font-size: 1em
166
+ border-left-style: none
167
+
168
+ /* The attribution of the blockquote
169
+ span.attribution,
170
+ p.attribution
171
+ display: block
172
+ text-align: left
173
+ text-transform: uppercase
174
+ letter-spacing: 0.1em
175
+ font-size: 0.8em
176
+ font-style: normal
177
+
178
+ /* ...which also contains an attribution-name, wrapping the name of
179
+ * the person who made the quotation
180
+ span.attribution-name,
181
+ p.attribution-name
182
+ text-align: left
183
+ text-transform: uppercase
184
+ letter-spacing: 0.1em
185
+ font-size: 0.8em
186
+ font-style: normal
187
+
188
+ /* Outside of the content area you can address the style of the
189
+ * running book and author headings.
190
+ #content-title
191
+ text-align: right
192
+ font-size: 0.8em
193
+
194
+ // #content-title .title
195
+
196
+ // #content-title .author
197
+
198
+ p
199
+ text-align: justify
200
+ // Unreliable results. The ebook readers mess up parskip and parindent.
201
+ //text-indent: 1.7em
202
+ //margin-top: 2pt
203
+ //padding-top: 0
204
+
205
+ /* The first paragraph in the work has a class called "noindent" which
206
+ * suppresses any paragraph indentation applied by default, but you
207
+ * can override this.
208
+ h1+p, h2+p, h3+p, h4+p,
209
+ h1+blockquote+p,
210
+ blockquote.epigraph+p,
211
+ p.first,
212
+ p.noindent
213
+ text-indent: 0
214
+ //&:first-line
215
+ // font-variant: small-caps
216
+ // font-size: 1.1em
217
+ // letter-spacing: .15em
218
+
219
+ /* The first letter of the text is wrapped in a span with
220
+ * the class 'firstletter', which can be used for dropcaps.
221
+
222
+ // span.firstletter
223
+
224
+ /* Middlemarch contains a number of letters, which can be styled
225
+ * differently.
226
+ #content p.letter
227
+ padding-left: 1.5em
228
+ padding-right: 0.5em
229
+
230
+ /* Found in a letter
231
+ #content p.salutation
232
+ display: block
233
+ font-variant: small-caps
234
+
235
+ #content p.closing
236
+ display: block
237
+ text-indent: 1em
238
+
239
+ div.page-break
240
+ page-break-after: always
241
+
242
+ .page-break-after
243
+ page-break-after: always
244
+
245
+ .page-break-before
246
+ page-break-before: always
247
+
248
+ pre
249
+ margin-top: 1em
250
+ margin-bottom: 1em
251
+
252
+ .small
253
+ font-size: 0.9em
254
+
255
+ .footnotesize
256
+ font-size: 0.8em
257
+
258
+ .tiny
259
+ font-size: 0.7em
260
+
261
+ .noborder
262
+ border: none
263
+
@@ -0,0 +1,7 @@
1
+
2
+ $gray: rgb(50,50,50)
3
+ $lightGray: lighten($gray, 20%)
4
+
5
+ $textColor: black
6
+ $textBgColor: white
7
+