bookmaker 0.5.2 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -48,10 +48,13 @@ To create a new Bookmaker project, execute the following on the command line:
48
48
 
49
49
  $ bookmaker new mybook
50
50
 
51
- This command creates a directory <tt>mybook</tt> with the following structure:
51
+ This command creates a directory <tt>mybook</tt> with the following structure (may be slightly different in production):
52
52
 
53
53
  mybook
54
54
  ├── _bookmaker.yml
55
+ ├── images
56
+ │ ├── cover.jpg
57
+ │ └── dp-logo.png
55
58
  ├── output
56
59
  ├── templates
57
60
  │ ├── epub
@@ -66,7 +69,7 @@ This command creates a directory <tt>mybook</tt> with the following structure:
66
69
  │ └── user.css
67
70
  └── text
68
71
  └── 01_Chapter
69
- └──01_Welcome.md
72
+ └──01_Welcome.tex
70
73
 
71
74
  The <tt>_bookmaker.yml</tt> file holds the project's metadata. Update the relevant fields.
72
75
 
@@ -109,7 +112,7 @@ To create valid Mobi for Kindle, you need an appropriate cover image. **Bookmake
109
112
 
110
113
  **Bookmaker** needs the following dependencies satisfied:
111
114
 
112
- * [xelatex](en.wikipedia.org/wiki/XeTeX), available on via MacTeX (Mac) and MiKTex (Windows, unconfirmed).
115
+ * [xelatex](http://en.wikipedia.org/wiki/XeTeX), available on via MacTeX (Mac) and MiKTex (Windows, unconfirmed).
113
116
  * LaTex to HTML conversion done within the gem itself.
114
117
  * HTML to EPUB via [Merovex-EeePub](https://github.com/Merovex/eeepub). Install it directly from Github
115
118
  * EPUB to Mobi via [Kindlegen](http://kindlegen.s3.amazonaws.com)
@@ -146,4 +149,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
146
149
  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
147
150
  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
148
151
  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
149
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
152
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,6 +1,6 @@
1
1
  # require "bookmaker/version"
2
2
  require "active_support/all"
3
- require "awesome_print"
3
+ #require "awesome_print"
4
4
  require "eeepub"
5
5
  require "erb"
6
6
  require "logger"
@@ -10,7 +10,7 @@ module Bookmaker
10
10
  true
11
11
  end
12
12
  def initialize(args = [], options = {}, config = {})
13
- if config[:current_task].name == "new" && args.empty?
13
+ if (config[:current_task] || config[:current_command]).name == "new" && args.empty?
14
14
  raise Error, "The e-Book path is required. For details run: bookmaker help new"
15
15
  end
16
16
  super
@@ -37,6 +37,12 @@ module Bookmaker
37
37
  Bookmaker::Exporter.run(root_dir, options)
38
38
  end
39
39
 
40
+ desc "pdf", "Export PDF only"
41
+ def pdf
42
+ inside_ebook!
43
+ Bookmaker::Exporter.run(root_dir, {:only => 'pdf'})
44
+ end
45
+
40
46
  desc "version", "Prints the Bookmaker's version information"
41
47
  map %w(-v --version) => :version
42
48
  def version
@@ -1,3 +1,3 @@
1
1
  module Bookmaker
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.5"
3
3
  end
@@ -2,7 +2,12 @@
2
2
  title: "<%= @title %>"
3
3
 
4
4
  # The book's language.
5
- language: en
5
+ language: "en"
6
+
7
+ # Type: 'fiction' or 'nonfiction'
8
+ type: 'fiction'
9
+ # Status: 'draft' or 'final'
10
+ status: "draft"
6
11
 
7
12
  # Your book copyright info.
8
13
  # Here's some examples:
@@ -43,6 +48,23 @@ authors:
43
48
  # The base URL from your source code.
44
49
  base_url: http://example.com
45
50
 
51
+ series:
52
+ title:
53
+ books:
54
+ - "Bellicose"
55
+ #
56
+ fonts:
57
+ serif: "Garamond"
58
+ sans: "Tahoma"
59
+ mono: "Courier"
60
+
61
+ designer:
62
+ book: "Ben Wilson"
63
+ cover: "<%= @name %>"
64
+
65
+ editors:
66
+ text:
67
+
46
68
  #==========
47
69
  # Book Manifest
48
70
  sections:
@@ -1,7 +1,7 @@
1
1
  \NeedsTeXFormat{LaTeX2e}[1996/06/01]
2
2
  \documentclass[12pt,twoside,makeidx,hidelinks]{memoir}
3
3
  \usepackage{layouts}[2001/04/29]
4
- \def\isfinal{<%= is_final %>}
4
+ \def\isfinal{<%= (status == 'final') ? 1 : 0 %>}
5
5
 
6
6
  % Packages
7
7
  %=========
@@ -33,11 +33,22 @@
33
33
 
34
34
  % Page Layout
35
35
  %============
36
- \setstocksize{9in}{6in}
37
- \settrimmedsize{9in}{6in}{*} % Use entire page
36
+ <%
37
+ if status == 'final'
38
+ stock_size = %w(9in 6in)
39
+ ul_margin = %w(0.8in 0.5in)
40
+ trim_size = %w(9in 6in)
41
+ else
42
+ stock_size = %w(11in 8.5in)
43
+ ul_margin = %w(1.8in 1.5in)
44
+ trim_size = %w(11in 6in)
45
+ end
46
+ %>
47
+ \setstocksize{<%=stock_size[0]%>}{<%=stock_size[1]%>}
48
+ \settrimmedsize{<%=trim_size[0]%>}{<%=trim_size[1]%>}{*} % Use entire page
38
49
  \settrims{0pt}{0pt}
39
50
  \setlrmarginsandblock{0.8in}{0.5in}{*}
40
- \setulmarginsandblock{0.8in}{0.5in}{*}
51
+ \setulmarginsandblock{<%=ul_margin[0]%>}{<%=ul_margin[1]%>}{*}
41
52
 
42
53
  \setmarginnotes{0.1pt}{0.2in}{\onelineskip}
43
54
  \setheadfoot{\onelineskip}{2\onelineskip}
@@ -69,8 +80,8 @@
69
80
  % Page Heading
70
81
  %-------------
71
82
  \makepagestyle{ebook}
72
- \makeoddhead{ebook}{}{\normalfont\scshape\theauthor}{\normalfont\thepage}
73
- \makeevenhead{ebook}{\normalfont\thepage}{\normalfont\scshape \thetitle}{}
83
+ \makeoddhead{ebook}{}{\textsf\theauthor}{\normalfont\thepage}
84
+ \makeevenhead{ebook}{\normalfont\thepage}{\textsf \thetitle}{}
74
85
 
75
86
  \aliaspagestyle{title}{empty}
76
87
 
@@ -87,10 +98,10 @@
87
98
  \usepackage{xunicode}
88
99
  \usepackage{xltxtra}
89
100
  \defaultfontfeatures{Mapping=tex-text}
90
- \setmainfont{Liberation Serif}
91
- \setsansfont{TitilliumText22L Light}
92
- \setmonofont{Liberation Mono}
93
- \newfontinstance\scshape[Letters=SmallCaps, Numbers=Uppercase]{Liberation Mono}
101
+ \setmainfont{<%= fonts['serif'] %>}
102
+ \setsansfont{<%= fonts['sans'] %>}
103
+ \setmonofont{<%= fonts['mono'] %>}
104
+ \newfontinstance\scshape[Letters=SmallCaps, Numbers=Uppercase]{<%= fonts['small_caps'] || fonts['mono'] %>}
94
105
  \DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
95
106
  \ifdefined\disableligature
96
107
  \DisableLigatures[f]{encoding = *, family = * }
@@ -152,6 +163,20 @@
152
163
  {\newcommand{\pbreak}{\pfbreak}}%
153
164
  {\newcommand{\pbreak}{\begin{center} \# \# \# \end{center}}}
154
165
 
166
+ % Series Title Page
167
+ %==================
168
+ \def\seriestitle#1{\def\theseriestitle{\uppercase{#1}}}
169
+ \def\seriespage{\thispagestyle{empty}
170
+ \begin{center}
171
+ \noindent{\large\theseriestitle}
172
+ \vskip10.5pt
173
+ \noindent Other Books in the series:
174
+ \vskip4pt
175
+ \theseriesbooks
176
+ \end{center}\newpage}
177
+ \def\seriesbook#1{\vskip.5pt{\noindent\hskip8pt\emph{#1}}\vskip1sp}
178
+ \def\seriesbooks#1\endseriesbooks{\def\theseriesbooks{\let\book\seriesbook{#1}}}
179
+
155
180
  % Indices
156
181
  %=========
157
182
  \makeglossary
@@ -181,6 +206,12 @@
181
206
  \date{<%= published_at %>}
182
207
  \newdate{firstprint}{<%= published_at.split('-')[2]%>}{<%= published_at.split('-')[1]%>}{<%= published_at.split('-')[0]%>}
183
208
 
209
+ <% unless series.nil? or series['books'].nil? %>
210
+ \seriestitle{<%= series['title'] %>}
211
+ \seriesbooks
212
+ <%= series['books'].map{ |b| "\\book{#{b}}" }.join("\n ") %>
213
+ \endseriesbooks
214
+ <% end %>
184
215
 
185
216
  % Drafting Help
186
217
  %==============
@@ -202,44 +233,63 @@
202
233
  % Frontmatter
203
234
  %-------------
204
235
  \frontmatter
236
+ % r.1 - Half-Title
237
+
238
+ % r.2 - Series Title Page
239
+ <%= "\\seriespage" unless series.nil? %>
240
+
241
+ % r.3 Titlepage
205
242
  \begin{titlingpage}
206
- \pagestyle{empty}
207
- \begin{center}
208
- \vspace*{\fill}
243
+ \pagestyle{empty}
244
+ \begin{center}
245
+ \vspace*{\fill}
209
246
 
210
- \HUGE\textbf{\textsf\thetitle}
247
+ \HUGE\textbf{\textsf\thetitle}
211
248
 
212
- \vspace*{0.25in}
213
- \line(1,0){150}
214
- \vspace*{0.25in}
249
+ \vspace*{0.25in}
250
+ \line(1,0){150}
251
+ \vspace*{0.25in}
215
252
 
216
- \Large\textsf\theauthor
253
+ \Large\textsf\theauthor
217
254
 
218
- \vspace*{\fill}
255
+ \vspace*{\fill}
219
256
 
220
- \vspace*{\fill}
221
- \includegraphics[width=0.25\textwidth]{images/dp-logo.png}\\[0cm]
222
- \hspace*{\fill}\textsf{Dausha}\hspace*{\fill}\newline%
223
- \textsf{Communications}
224
- \end{center}
257
+ \vspace*{\fill}
258
+ \includegraphics[width=0.25\textwidth]{images/dp-logo.png}\\[0cm]
259
+ \hspace*{\fill}\textsf{Dausha}\hspace*{\fill}\newline%
260
+ \textsf{Communications}
261
+ \end{center}
225
262
  \end{titlingpage}
226
263
 
227
- % r.3 Copyright Page
264
+ % r.4 Copyright Page
228
265
  \vspace*{\fill}
229
266
  \pagestyle{empty}
230
267
 
231
268
  \par\noindent\emph{\thetitle}
232
269
  \newline
233
270
 
234
- \par\noindent This is a work of fiction. All characters and events portrayed in this
235
- book are fictional, and any resemblance to real people or incidents is
236
- purely coincidental.\newline
271
+ <% if type == 'fiction' %>
272
+
273
+ \par\noindent This is a work of fiction. Names, characters, places and incidents are either
274
+ the product of the author's imagination or are used ficticiously, and any resemblance to
275
+ actual persons, living or dead, business establishments, events or locales is entirely
276
+ coincidental.\newline
277
+ <% end %>
237
278
 
238
279
  \par\noindent\emph{<%= copyright %>}\newline
239
280
 
240
- \par\noindent Cover Design by <%= name %>\newline
281
+ <% unless designer['cover'].nil? || designer['cover'].empty? %>
282
+ \par\noindent Cover Design by <%= designer['cover'] %>\newline
283
+ <% end %>
241
284
 
242
- \par\noindent Book Design by <%= name %>\newline
285
+ <% unless designer['book'].nil? || designer['book'].empty? %>
286
+ \par\noindent Book Design by <%= designer['book'] %>\newline
287
+ <% end %>
288
+
289
+ <% unless editors['text'].nil? || editors['text'].empty? %>
290
+ \par\noindent Book Design by <%= editors['text'].join(',') %>\newline
291
+ <% end %>
292
+
243
293
 
244
294
  \par\noindent All rights reserved.\newline
245
295
 
@@ -257,10 +307,8 @@
257
307
  \par\noindent <%= identifier['type'] %> <%= identifier['id'] %>
258
308
  \vspace*{\fill}
259
309
  \newpage
260
- % \fi
261
310
 
262
- % Todolist
263
- %
311
+ % r.5 - Dedication
264
312
 
265
313
  \tableofcontents
266
314
 
@@ -270,12 +318,6 @@
270
318
 
271
319
  <%= contents %>
272
320
 
273
- % Todolist
274
- %
275
- % \ifdefined\isdraft
276
- % \listoftodos
277
- % \fi
278
-
279
321
  % Back Matter
280
322
  %-------------
281
323
  \backmatter
@@ -287,15 +329,17 @@
287
329
  \begin{center}
288
330
  \vspace*{\fill}
289
331
 
290
- \ifdefined\ReturningCharacters {\Large \par
332
+ {\Large \par
291
333
  \noindent Thank you for reading
292
-
334
+
293
335
  \vspace*{0.125in}
294
336
  {\LARGE\textbf{\textsf{\thetitle}}}
295
337
  \vspace*{0.125in}
296
338
 
297
- \par
298
- \noindent\ReturningCharacters{} will return in \emph{\NextBook}.} \vspace*{\fill} \fi
339
+ \ifdefined\ReturningCharacters
340
+ \par
341
+ \noindent\ReturningCharacters{} will return in \emph{\NextBook}.} \vspace*{\fill}
342
+ \fi
299
343
 
300
344
  {\LARGE\textbf{\textsf{Follow Me}}}
301
345
 
@@ -307,13 +351,13 @@
307
351
  \vspace*{\fill}
308
352
  \end{center}
309
353
 
310
- % \notfinal{
354
+ <% if (type == 'fiction' and status != 'final') or type == 'nonfiction' %>
311
355
 
312
356
  %% Glossary
313
357
  \printglossaries
314
358
 
315
359
  %% Index
316
360
  \printindex
317
- % }
361
+ <% end %>
318
362
 
319
363
  \end{document}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bookmaker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-03 00:00:00.000000000Z
12
+ date: 2013-04-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &2152979800 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2152979800
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: aruba
27
- requirement: &2152978980 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *2152978980
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: cucumber
38
- requirement: &2152978500 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: '0'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *2152978500
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: eeepub
49
- requirement: &2152977980 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ! '>='
@@ -54,10 +69,15 @@ dependencies:
54
69
  version: '0'
55
70
  type: :runtime
56
71
  prerelease: false
57
- version_requirements: *2152977980
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: kramdown
60
- requirement: &2152977300 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ! '>='
@@ -65,10 +85,15 @@ dependencies:
65
85
  version: '0'
66
86
  type: :runtime
67
87
  prerelease: false
68
- version_requirements: *2152977300
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
69
94
  - !ruby/object:Gem::Dependency
70
95
  name: thor
71
- requirement: &2152976660 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
72
97
  none: false
73
98
  requirements:
74
99
  - - ! '>='
@@ -76,10 +101,15 @@ dependencies:
76
101
  version: '0'
77
102
  type: :runtime
78
103
  prerelease: false
79
- version_requirements: *2152976660
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
80
110
  - !ruby/object:Gem::Dependency
81
111
  name: nokogiri
82
- requirement: &2152958140 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
83
113
  none: false
84
114
  requirements:
85
115
  - - ! '>='
@@ -87,10 +117,15 @@ dependencies:
87
117
  version: '0'
88
118
  type: :runtime
89
119
  prerelease: false
90
- version_requirements: *2152958140
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
91
126
  - !ruby/object:Gem::Dependency
92
127
  name: notifier
93
- requirement: &2152957520 !ruby/object:Gem::Requirement
128
+ requirement: !ruby/object:Gem::Requirement
94
129
  none: false
95
130
  requirements:
96
131
  - - ! '>='
@@ -98,7 +133,12 @@ dependencies:
98
133
  version: '0'
99
134
  type: :runtime
100
135
  prerelease: false
101
- version_requirements: *2152957520
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
102
142
  description: ! 'ODO: Write a gem description'
103
143
  email:
104
144
  - dausha@gmail.com
@@ -166,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
206
  version: '0'
167
207
  requirements: []
168
208
  rubyforge_project: bookmaker
169
- rubygems_version: 1.8.10
209
+ rubygems_version: 1.8.24
170
210
  signing_key:
171
211
  specification_version: 3
172
212
  summary: ! 'ODO: Write a gem summary'
@@ -174,3 +214,4 @@ test_files:
174
214
  - features/basic.feature
175
215
  - features/export.feature
176
216
  - features/support/setup.rb
217
+ has_rdoc: