bookshop 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc
CHANGED
@@ -1,14 +1,15 @@
|
|
1
|
-
=== http://
|
1
|
+
=== http://3.bp.blogspot.com/-gYebAHHXpXs/T3aSYFIj6KI/AAAAAAAAACo/Rdo3WOqbihM/s320/bookshop_logo.png
|
2
2
|
|
3
3
|
"a book publishing framework for today's publishing world"
|
4
|
-
|
5
|
-
|
4
|
+
|
5
|
+
Bookshop is a an open-source book development and publishing framework for authors, editors, publishers and coders in today's publishing industry. Bookshop provides best-practices for developing your books in HTML/CSS/JS, allowing them to be transformed into potentially any book format (Print-PDF, PDF, mobi, ePub, etc.).
|
6
|
+
|
7
|
+
A conceptual overview of bookshop: http://blueheadblog.blogspot.com/2012/03/announcing-bookshop-html-to-pdf-ebook.html
|
6
8
|
|
7
9
|
bookshop hopes to simplify the process by:
|
8
10
|
* using common tools like HTML/CSS to make the creation of your book comfortable and familiar, greatly reducing the learning curve for your developers, authors, agents, and other team members
|
9
11
|
* providing a Ruby Gem to make building a book in HTML as easy as 'gem install bookshop'
|
10
12
|
* pulling all the html-to-pdf/(e)book tools together into one place (princexml, kindlegen, epubcheck)
|
11
|
-
* sticking with open-source tools to encourage community development
|
12
13
|
* giving the developer a set of scripts to automate the redundant stuff
|
13
14
|
* providing an architecture/structure that follows best-practices and simplification (DRY... Don't Repeat Yourself)
|
14
15
|
|
@@ -18,17 +19,24 @@ bookshop hopes to simplify the process by:
|
|
18
19
|
|
19
20
|
* Ruby v1.8.7 or higher http://www.ruby-lang.org/en/downloads/
|
20
21
|
|
22
|
+
(not required, but recommended for using other tools)
|
23
|
+
* Java 1.5 or higher http://www.java.com/en/
|
24
|
+
|
21
25
|
== Installation
|
22
26
|
|
27
|
+
For detailed instructions for your particular platform, please see this link:
|
28
|
+
|
29
|
+
https://github.com/blueheadpublishing/bookshop/wiki/Setting-Up-Your-bookshop-Environment
|
30
|
+
|
23
31
|
=== Install bookshop
|
24
32
|
|
25
33
|
$ gem install bookshop
|
26
34
|
|
27
35
|
=== Install PrinceXML
|
28
36
|
|
29
|
-
|
37
|
+
Go to PrinceXML website and follow the install instructions
|
30
38
|
|
31
|
-
http://www.princexml.com/download
|
39
|
+
http://www.princexml.com/download
|
32
40
|
|
33
41
|
== Using bookshop
|
34
42
|
|
@@ -36,7 +44,7 @@ http://www.princexml.com/download/
|
|
36
44
|
|
37
45
|
$ bookshop new my_new_book
|
38
46
|
|
39
|
-
This will create a new bookshop book in /path/to/my_new_book with the following structure:
|
47
|
+
This will create a new bookshop book project in /path/to/my_new_book with the following structure:
|
40
48
|
|
41
49
|
|-- book/ # Source files for your book
|
42
50
|
|--book.html.erb # The master file
|
@@ -48,6 +56,12 @@ http://www.princexml.com/download/
|
|
48
56
|
|--stylesheet.css
|
49
57
|
|--images/
|
50
58
|
|--js/
|
59
|
+
|--epub/ # epub specific files and contents
|
60
|
+
|--META-INF/
|
61
|
+
|--mimetype
|
62
|
+
|--OEBPS/
|
63
|
+
|--content.opf.erb
|
64
|
+
|--toc.ncx.erb
|
51
65
|
|
52
66
|
|-- builds/ # All the builds are created here
|
53
67
|
|--epub/
|
@@ -61,7 +75,11 @@ http://www.princexml.com/download/
|
|
61
75
|
|
62
76
|
=== Editing Your New Book
|
63
77
|
|
64
|
-
====
|
78
|
+
==== Editing your book source
|
79
|
+
|
80
|
+
Currently, when you create a new bookshop project, it will generate the example book source for you. You can use this as a template, replacing the text with your own. But make sure to utilize the correct CSS microformat markup.
|
81
|
+
|
82
|
+
For an explanation of the example, please see this article. - http://www.alistapart.com/articles/boom
|
65
83
|
|
66
84
|
All of the source documents and assets for your book are stored in the +book/+ folder. So your stylesheets, images, text - everything used for building your book - lives here. Ideally, you should only every edit files in your +book/+ folder (with the exception of your config/book.yml file).
|
67
85
|
|
@@ -73,11 +91,11 @@ The source files are all in ERB. ERB is a templating language for the Ruby progr
|
|
73
91
|
|
74
92
|
More information on ERB - http://www.ruby-doc.org/stdlib-1.9.3/libdoc/erb/rdoc/ERB.html
|
75
93
|
|
76
|
-
====
|
94
|
+
==== The master file book.html.erb
|
77
95
|
|
78
|
-
Your master file (which is
|
96
|
+
Your master file (from which everything is built) is the +book.html.erb+ file (remember that we are in the +book/+ folder). You could of course just use this file and put all of your book contents here, making one enormous file, but we don't recommend it...
|
79
97
|
|
80
|
-
====
|
98
|
+
==== Import files into your master file
|
81
99
|
|
82
100
|
Are you writing another "War and Peace"? We've created a nice way to make your epic book easier to manage. Rather than putting everything in the +book.html.erb+ file, you can +import+ files. This allows you to break your book up into smaller, more manageable pieces. This makes it soooooo much easier to manage your book. And others will thank you for it..
|
83
101
|
|
@@ -104,27 +122,21 @@ and in the +bodymatter/ch01/ch01.html.erb+ you could import more files
|
|
104
122
|
<%= import('bodymatter/ch01/first_section.html.erb') %>
|
105
123
|
<%= import('bodymatter/ch01/second_section.html.erb') %>
|
106
124
|
|
107
|
-
====
|
125
|
+
==== Use the @output tag to create content based on output (pdf/html/epub/etc.)
|
108
126
|
|
109
|
-
So what if you want to create content for certain builds only? Let's say you want
|
127
|
+
So what if you want to create content for certain builds only? Let's say you want a certain section of your book to only be included in the pdf version of your book.
|
110
128
|
|
111
129
|
No worries. We've created the handy Output Variable (@output) for you to use in this case... aren't we special?
|
112
130
|
|
113
131
|
Currently we have three attributes you can call with @output - :html, :pdf, and :epub.
|
114
132
|
|
115
|
-
Let's generate
|
133
|
+
Let's generate a section that will only be displayed in the pdf version of your book, using a conditional statement (remember, everything is ERB, so we can use Ruby):
|
116
134
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
<% elsif @output == :pdf %>
|
121
|
-
PDF Title
|
122
|
-
<% elsif @output == :epub %>
|
123
|
-
EPUB Title
|
124
|
-
<% end %>
|
125
|
-
</p>
|
135
|
+
<% if @output == :pdf %>
|
136
|
+
<p>This is a pdf-only section</p>
|
137
|
+
<% end %>
|
126
138
|
|
127
|
-
====
|
139
|
+
==== Use @book tags to reuse content throughout all book formats (the +config/book.yml+ file)
|
128
140
|
|
129
141
|
Gosh, wouldn't it be cool to have a way to store bits of information that we use repeatedly throughout the book, like the ISBN, or the title? And then it would be great to be able to reference them from within the book source. That way we can change them once, in one place, rather than having to go looking for them throughout the entire book.
|
130
142
|
|
@@ -153,7 +165,7 @@ You can then use these Book Variables in your book source file:
|
|
153
165
|
<p>The html title is <%= @book.html.title %></p>
|
154
166
|
<p>The epub pub_date is <%= @book.epub.pub_date %></p>
|
155
167
|
|
156
|
-
Note that you can construct and/or nest variables however you want to:
|
168
|
+
Note that you can also construct and/or nest variables however you want to:
|
157
169
|
|
158
170
|
# book.yml
|
159
171
|
|
@@ -164,7 +176,7 @@ Note that you can construct and/or nest variables however you want to:
|
|
164
176
|
|
165
177
|
Then call it in your source file with the variable:
|
166
178
|
|
167
|
-
<p>My made up friend's name is <%= @book.my.madeup.friend.name
|
179
|
+
<p>My made up friend's name is <%= @book.my.madeup.friend.name %></p>
|
168
180
|
|
169
181
|
More info about YAML:
|
170
182
|
|
@@ -189,6 +201,10 @@ Please explore other creative ways to structure and enhance your book (we'd love
|
|
189
201
|
|
190
202
|
=== Building Your First Book
|
191
203
|
|
204
|
+
Each time you build a new book format, the source .erb files in your *book/* folder are built and copied to the build target folder. Then the final book format is generated from those newly generated files. For example, if you issue "bookshop build epub", the .erb source files are built and the resulting book.html and all the assets/ are saved to the *builds/epub/* folder. Then the target epub book format is generated from the *builds/epub* folder and saved back in the same folder.
|
205
|
+
|
206
|
+
The great thing about this is that you can easily view the resulting book.html file in a browser to get a quick peak at the generated look and feel.
|
207
|
+
|
192
208
|
To build an HTML format of your book from the ERB source:
|
193
209
|
|
194
210
|
$ bookshop build html # -> find the output in builds/html/book.html
|
@@ -209,14 +225,15 @@ http://www.princexml.com/doc/8.0/
|
|
209
225
|
|
210
226
|
==== Editing you epub document and options
|
211
227
|
|
228
|
+
There are two main files (besides your actual book source) you will need to edit for the epub build are located in the +book/epub/OEBPS+ folder: content.opf (the Open Packaging Format) and the toc.ncx (the Navigation file).
|
229
|
+
|
230
|
+
During the build process, the entire contents of the +book/epub/+ folder will be used, along with your book source files, to create your epub book format. You can add or edit any of the files in that folder if you like. Generally speaking, you will probably only ever edit the content.opf.erb and the toc.ncs.erb files.
|
231
|
+
|
212
232
|
http://idpf.org/epub/30 - For an overview of EPUB
|
213
233
|
http://idpf.org/epub/30/spec/epub30-ocf.html - For the specs on the epub file structures and contents
|
214
234
|
|
215
|
-
|
216
235
|
We recommend consulting the EPUB documentation for specifics.
|
217
236
|
|
218
|
-
There are two main files (besides your actual book source) you will need to edit for the epub build are located in the +book/epub/OEBPS+ folder: content.opf (the Open Packaging Format) and the toc.ncx (the Navigation file).
|
219
|
-
|
220
237
|
===== The *content.opf* file is the file which contains all of the primary information about your epub ebook (publisher, files included, date, etc.).
|
221
238
|
|
222
239
|
http://idpf.org/epub/20/spec/OPF_2.0.1_draft.htm - Specs on the .opf file
|
@@ -241,25 +258,31 @@ You can then build the book into whatever format you like.
|
|
241
258
|
|
242
259
|
The default directory structure of a generated bookshop project:
|
243
260
|
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
261
|
+
|-- book/ # Source files for your book
|
262
|
+
|--book.html.erb # The master file
|
263
|
+
|--frontmatter/ # Content at the front of the book (cover, title, preface, etc.)
|
264
|
+
|--bodymatter/ # Main content of book (chapters, sections, etc.)
|
265
|
+
|--backmatter/ # Content at the back of the book (appendix, index, etc.)
|
266
|
+
|--assets/
|
267
|
+
|--css/
|
268
|
+
|--stylesheet.css
|
269
|
+
|--images/
|
270
|
+
|--js/
|
271
|
+
|--epub/ # epub specific files and contents
|
272
|
+
|--META-INF/
|
273
|
+
|--mimetype
|
274
|
+
|--OEBPS/
|
275
|
+
|--content.opf.erb
|
276
|
+
|--toc.ncx.erb
|
277
|
+
|
278
|
+
|-- builds/ # All the builds are created here
|
279
|
+
|--epub/
|
280
|
+
|--html/
|
281
|
+
|--mobi/
|
282
|
+
|--pdf/
|
283
|
+
|
284
|
+
|-- config/ # Your config and data settings
|
285
|
+
|--book.yml # Settings/Data for your book
|
263
286
|
|
264
287
|
book
|
265
288
|
Holds all the manuscript html code/files. This is where your master manuscript lives from which everything is built.
|
@@ -325,6 +348,7 @@ We would like to thank:
|
|
325
348
|
* The Ruby/Rubygems Team www.ruby-lang.org/
|
326
349
|
* The Thor Team - https://github.com/wycats/thor
|
327
350
|
* Hakon Wium Lie and Bert Bos for developing the book microformat http://www.alistapart.com/articles/boom
|
351
|
+
* The PrinceXML Team - http://www.princexml.com/company/
|
328
352
|
|
329
353
|
A List of Our Contributors:
|
330
354
|
https://github.com/blueheadpublishing/bookshop/blob/master/CONTRIBUTORS.md
|
@@ -134,23 +134,22 @@ module Bookshop
|
|
134
134
|
# Clean up any old builds
|
135
135
|
puts "Deleting any old builds"
|
136
136
|
FileUtils.rm_r Dir.glob('builds/pdf/*')
|
137
|
-
FileUtils.rm_r Dir.glob('builds/html/*')
|
138
137
|
|
139
138
|
@output = :pdf
|
140
139
|
erb = import(BOOK_SOURCE)
|
141
140
|
# Generate the html from ERB
|
142
141
|
puts "Generating new html from erb"
|
143
|
-
File.open('builds/
|
142
|
+
File.open('builds/pdf/book.html', 'a') do |f|
|
144
143
|
f << erb
|
145
144
|
end
|
146
145
|
|
147
146
|
# Copy over html assets
|
148
|
-
FileUtils.cp_r('book/assets/', 'builds/
|
147
|
+
FileUtils.cp_r('book/assets/', 'builds/pdf/', :verbose => true)
|
149
148
|
|
150
149
|
|
151
150
|
# Builds the pdf from builds/html/book.html
|
152
151
|
puts "Building new pdf at builds/pdf/book.pdf from new html build"
|
153
|
-
cmd = %x[prince builds/
|
152
|
+
cmd = %x[prince builds/pdf/book.html -o builds/pdf/book.pdf]
|
154
153
|
|
155
154
|
else
|
156
155
|
puts "Error: Command not recognized" unless %w(-h --help).include?(build)
|
@@ -160,6 +159,7 @@ module Bookshop
|
|
160
159
|
The most common build commands are:
|
161
160
|
pdf Builds a new pdf at /builds/pdf/book.pdf
|
162
161
|
html Builds a new html at /builds/html/book.html
|
162
|
+
epub Builds a new epub at /builds/epub/book.epub
|
163
163
|
|
164
164
|
All commands can be run with -h for more information.
|
165
165
|
EOT
|
@@ -1,14 +1,15 @@
|
|
1
|
-
=== http://
|
1
|
+
=== http://3.bp.blogspot.com/-gYebAHHXpXs/T3aSYFIj6KI/AAAAAAAAACo/Rdo3WOqbihM/s320/bookshop_logo.png
|
2
2
|
|
3
3
|
"a book publishing framework for today's publishing world"
|
4
|
-
|
5
|
-
|
4
|
+
|
5
|
+
Bookshop is a an open-source book development and publishing framework for authors, editors, publishers and coders in today's publishing industry. Bookshop provides best-practices for developing your books in HTML/CSS/JS, allowing them to be transformed into potentially any book format (Print-PDF, PDF, mobi, ePub, etc.).
|
6
|
+
|
7
|
+
A conceptual overview of bookshop: http://blueheadblog.blogspot.com/2012/03/announcing-bookshop-html-to-pdf-ebook.html
|
6
8
|
|
7
9
|
bookshop hopes to simplify the process by:
|
8
10
|
* using common tools like HTML/CSS to make the creation of your book comfortable and familiar, greatly reducing the learning curve for your developers, authors, agents, and other team members
|
9
11
|
* providing a Ruby Gem to make building a book in HTML as easy as 'gem install bookshop'
|
10
12
|
* pulling all the html-to-pdf/(e)book tools together into one place (princexml, kindlegen, epubcheck)
|
11
|
-
* sticking with open-source tools to encourage community development
|
12
13
|
* giving the developer a set of scripts to automate the redundant stuff
|
13
14
|
* providing an architecture/structure that follows best-practices and simplification (DRY... Don't Repeat Yourself)
|
14
15
|
|
@@ -18,17 +19,24 @@ bookshop hopes to simplify the process by:
|
|
18
19
|
|
19
20
|
* Ruby v1.8.7 or higher http://www.ruby-lang.org/en/downloads/
|
20
21
|
|
22
|
+
(not required, but recommended for using other tools)
|
23
|
+
* Java 1.5 or higher http://www.java.com/en/
|
24
|
+
|
21
25
|
== Installation
|
22
26
|
|
27
|
+
For detailed instructions for your particular platform, please see this link:
|
28
|
+
|
29
|
+
https://github.com/blueheadpublishing/bookshop/wiki/Setting-Up-Your-bookshop-Environment
|
30
|
+
|
23
31
|
=== Install bookshop
|
24
32
|
|
25
33
|
$ gem install bookshop
|
26
34
|
|
27
35
|
=== Install PrinceXML
|
28
36
|
|
29
|
-
|
37
|
+
Go to PrinceXML website and follow the install instructions
|
30
38
|
|
31
|
-
http://www.princexml.com/download
|
39
|
+
http://www.princexml.com/download
|
32
40
|
|
33
41
|
== Using bookshop
|
34
42
|
|
@@ -36,7 +44,7 @@ http://www.princexml.com/download/
|
|
36
44
|
|
37
45
|
$ bookshop new my_new_book
|
38
46
|
|
39
|
-
This will create a new bookshop book in /path/to/my_new_book with the following structure:
|
47
|
+
This will create a new bookshop book project in /path/to/my_new_book with the following structure:
|
40
48
|
|
41
49
|
|-- book/ # Source files for your book
|
42
50
|
|--book.html.erb # The master file
|
@@ -48,6 +56,12 @@ http://www.princexml.com/download/
|
|
48
56
|
|--stylesheet.css
|
49
57
|
|--images/
|
50
58
|
|--js/
|
59
|
+
|--epub/ # epub specific files and contents
|
60
|
+
|--META-INF/
|
61
|
+
|--mimetype
|
62
|
+
|--OEBPS/
|
63
|
+
|--content.opf.erb
|
64
|
+
|--toc.ncx.erb
|
51
65
|
|
52
66
|
|-- builds/ # All the builds are created here
|
53
67
|
|--epub/
|
@@ -61,7 +75,11 @@ http://www.princexml.com/download/
|
|
61
75
|
|
62
76
|
=== Editing Your New Book
|
63
77
|
|
64
|
-
====
|
78
|
+
==== Editing your book source
|
79
|
+
|
80
|
+
Currently, when you create a new bookshop project, it will generate the example book source for you. You can use this as a template, replacing the text with your own. But make sure to utilize the correct CSS microformat markup.
|
81
|
+
|
82
|
+
For an explanation of the example, please see this article. - http://www.alistapart.com/articles/boom
|
65
83
|
|
66
84
|
All of the source documents and assets for your book are stored in the +book/+ folder. So your stylesheets, images, text - everything used for building your book - lives here. Ideally, you should only every edit files in your +book/+ folder (with the exception of your config/book.yml file).
|
67
85
|
|
@@ -73,11 +91,11 @@ The source files are all in ERB. ERB is a templating language for the Ruby progr
|
|
73
91
|
|
74
92
|
More information on ERB - http://www.ruby-doc.org/stdlib-1.9.3/libdoc/erb/rdoc/ERB.html
|
75
93
|
|
76
|
-
====
|
94
|
+
==== The master file book.html.erb
|
77
95
|
|
78
|
-
Your master file (which is
|
96
|
+
Your master file (from which everything is built) is the +book.html.erb+ file (remember that we are in the +book/+ folder). You could of course just use this file and put all of your book contents here, making one enormous file, but we don't recommend it...
|
79
97
|
|
80
|
-
====
|
98
|
+
==== Import files into your master file
|
81
99
|
|
82
100
|
Are you writing another "War and Peace"? We've created a nice way to make your epic book easier to manage. Rather than putting everything in the +book.html.erb+ file, you can +import+ files. This allows you to break your book up into smaller, more manageable pieces. This makes it soooooo much easier to manage your book. And others will thank you for it..
|
83
101
|
|
@@ -104,27 +122,21 @@ and in the +bodymatter/ch01/ch01.html.erb+ you could import more files
|
|
104
122
|
<%= import('bodymatter/ch01/first_section.html.erb') %>
|
105
123
|
<%= import('bodymatter/ch01/second_section.html.erb') %>
|
106
124
|
|
107
|
-
====
|
125
|
+
==== Use the @output tag to create content based on output (pdf/html/epub/etc.)
|
108
126
|
|
109
|
-
So what if you want to create content for certain builds only? Let's say you want
|
127
|
+
So what if you want to create content for certain builds only? Let's say you want a certain section of your book to only be included in the pdf version of your book.
|
110
128
|
|
111
129
|
No worries. We've created the handy Output Variable (@output) for you to use in this case... aren't we special?
|
112
130
|
|
113
131
|
Currently we have three attributes you can call with @output - :html, :pdf, and :epub.
|
114
132
|
|
115
|
-
Let's generate
|
133
|
+
Let's generate a section that will only be displayed in the pdf version of your book, using a conditional statement (remember, everything is ERB, so we can use Ruby):
|
116
134
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
<% elsif @output == :pdf %>
|
121
|
-
PDF Title
|
122
|
-
<% elsif @output == :epub %>
|
123
|
-
EPUB Title
|
124
|
-
<% end %>
|
125
|
-
</p>
|
135
|
+
<% if @output == :pdf %>
|
136
|
+
<p>This is a pdf-only section</p>
|
137
|
+
<% end %>
|
126
138
|
|
127
|
-
====
|
139
|
+
==== Use @book tags to reuse content throughout all book formats (the +config/book.yml+ file)
|
128
140
|
|
129
141
|
Gosh, wouldn't it be cool to have a way to store bits of information that we use repeatedly throughout the book, like the ISBN, or the title? And then it would be great to be able to reference them from within the book source. That way we can change them once, in one place, rather than having to go looking for them throughout the entire book.
|
130
142
|
|
@@ -153,7 +165,7 @@ You can then use these Book Variables in your book source file:
|
|
153
165
|
<p>The html title is <%= @book.html.title %></p>
|
154
166
|
<p>The epub pub_date is <%= @book.epub.pub_date %></p>
|
155
167
|
|
156
|
-
Note that you can construct and/or nest variables however you want to:
|
168
|
+
Note that you can also construct and/or nest variables however you want to:
|
157
169
|
|
158
170
|
# book.yml
|
159
171
|
|
@@ -164,7 +176,7 @@ Note that you can construct and/or nest variables however you want to:
|
|
164
176
|
|
165
177
|
Then call it in your source file with the variable:
|
166
178
|
|
167
|
-
<p>My made up friend's name is <%= @book.my.madeup.friend.name
|
179
|
+
<p>My made up friend's name is <%= @book.my.madeup.friend.name %></p>
|
168
180
|
|
169
181
|
More info about YAML:
|
170
182
|
|
@@ -189,6 +201,10 @@ Please explore other creative ways to structure and enhance your book (we'd love
|
|
189
201
|
|
190
202
|
=== Building Your First Book
|
191
203
|
|
204
|
+
Each time you build a new book format, the source .erb files in your *book/* folder are built and copied to the build target folder. Then the final book format is generated from those newly generated files. For example, if you issue "bookshop build epub", the .erb source files are built and the resulting book.html and all the assets/ are saved to the *builds/epub/* folder. Then the target epub book format is generated from the *builds/epub* folder and saved back in the same folder.
|
205
|
+
|
206
|
+
The great thing about this is that you can easily view the resulting book.html file in a browser to get a quick peak at the generated look and feel.
|
207
|
+
|
192
208
|
To build an HTML format of your book from the ERB source:
|
193
209
|
|
194
210
|
$ bookshop build html # -> find the output in builds/html/book.html
|
@@ -209,14 +225,15 @@ http://www.princexml.com/doc/8.0/
|
|
209
225
|
|
210
226
|
==== Editing you epub document and options
|
211
227
|
|
228
|
+
There are two main files (besides your actual book source) you will need to edit for the epub build are located in the +book/epub/OEBPS+ folder: content.opf (the Open Packaging Format) and the toc.ncx (the Navigation file).
|
229
|
+
|
230
|
+
During the build process, the entire contents of the +book/epub/+ folder will be used, along with your book source files, to create your epub book format. You can add or edit any of the files in that folder if you like. Generally speaking, you will probably only ever edit the content.opf.erb and the toc.ncs.erb files.
|
231
|
+
|
212
232
|
http://idpf.org/epub/30 - For an overview of EPUB
|
213
233
|
http://idpf.org/epub/30/spec/epub30-ocf.html - For the specs on the epub file structures and contents
|
214
234
|
|
215
|
-
|
216
235
|
We recommend consulting the EPUB documentation for specifics.
|
217
236
|
|
218
|
-
There are two main files (besides your actual book source) you will need to edit for the epub build are located in the +book/epub/OEBPS+ folder: content.opf (the Open Packaging Format) and the toc.ncx (the Navigation file).
|
219
|
-
|
220
237
|
===== The *content.opf* file is the file which contains all of the primary information about your epub ebook (publisher, files included, date, etc.).
|
221
238
|
|
222
239
|
http://idpf.org/epub/20/spec/OPF_2.0.1_draft.htm - Specs on the .opf file
|
@@ -241,25 +258,31 @@ You can then build the book into whatever format you like.
|
|
241
258
|
|
242
259
|
The default directory structure of a generated bookshop project:
|
243
260
|
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
261
|
+
|-- book/ # Source files for your book
|
262
|
+
|--book.html.erb # The master file
|
263
|
+
|--frontmatter/ # Content at the front of the book (cover, title, preface, etc.)
|
264
|
+
|--bodymatter/ # Main content of book (chapters, sections, etc.)
|
265
|
+
|--backmatter/ # Content at the back of the book (appendix, index, etc.)
|
266
|
+
|--assets/
|
267
|
+
|--css/
|
268
|
+
|--stylesheet.css
|
269
|
+
|--images/
|
270
|
+
|--js/
|
271
|
+
|--epub/ # epub specific files and contents
|
272
|
+
|--META-INF/
|
273
|
+
|--mimetype
|
274
|
+
|--OEBPS/
|
275
|
+
|--content.opf.erb
|
276
|
+
|--toc.ncx.erb
|
277
|
+
|
278
|
+
|-- builds/ # All the builds are created here
|
279
|
+
|--epub/
|
280
|
+
|--html/
|
281
|
+
|--mobi/
|
282
|
+
|--pdf/
|
283
|
+
|
284
|
+
|-- config/ # Your config and data settings
|
285
|
+
|--book.yml # Settings/Data for your book
|
263
286
|
|
264
287
|
book
|
265
288
|
Holds all the manuscript html code/files. This is where your master manuscript lives from which everything is built.
|
@@ -325,6 +348,7 @@ We would like to thank:
|
|
325
348
|
* The Ruby/Rubygems Team www.ruby-lang.org/
|
326
349
|
* The Thor Team - https://github.com/wycats/thor
|
327
350
|
* Hakon Wium Lie and Bert Bos for developing the book microformat http://www.alistapart.com/articles/boom
|
351
|
+
* The PrinceXML Team - http://www.princexml.com/company/
|
328
352
|
|
329
353
|
A List of Our Contributors:
|
330
354
|
https://github.com/blueheadpublishing/bookshop/blob/master/CONTRIBUTORS.md
|
@@ -2,11 +2,11 @@
|
|
2
2
|
#
|
3
3
|
# in book/book.html.erb
|
4
4
|
#
|
5
|
-
# <p><b>Version:</b> <%= book.epub.version %></p>
|
5
|
+
# <p><b>Version:</b> <%= @book.epub.version %></p>
|
6
6
|
#
|
7
7
|
# or
|
8
8
|
#
|
9
|
-
# <% if book.epub.version == '1.0.0' %>
|
9
|
+
# <% if @book.epub.version == '1.0.0' %>
|
10
10
|
# <p>Whew! We made it!</p>
|
11
11
|
# <% end %>
|
12
12
|
|
@@ -30,7 +30,7 @@ rights:
|
|
30
30
|
|
31
31
|
# Place the pdf specific settings here. Use whatever you want.
|
32
32
|
# You can use these settings in your source layouts by using a tag
|
33
|
-
# in book.html.erb you could use <%= book.pdf.title %>
|
33
|
+
# in book.html.erb you could use <%= @book.pdf.title %>
|
34
34
|
pdf:
|
35
35
|
title: Cascading Style Sheets
|
36
36
|
|
@@ -38,6 +38,7 @@ pdf:
|
|
38
38
|
# Place the epub specific settings here.
|
39
39
|
epub:
|
40
40
|
title: Cascading Style Sheets
|
41
|
+
version: 0.1.1
|
41
42
|
|
42
43
|
|
43
44
|
# Place the html specific settings here
|
@@ -50,4 +51,4 @@ html:
|
|
50
51
|
# foo:
|
51
52
|
# bar: foobar
|
52
53
|
#
|
53
|
-
# in book.html.erb you can then use <%= foo.bar %> # --> foobar
|
54
|
+
# in book.html.erb you can then use <%= @book.foo.bar %> # --> foobar
|
data/lib/bookshop/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bookshop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
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: 2012-03-
|
12
|
+
date: 2012-03-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
16
|
-
requirement: &
|
16
|
+
requirement: &70131527064060 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.14.6
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70131527064060
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bundler
|
27
|
-
requirement: &
|
27
|
+
requirement: &70131527058280 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.0.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70131527058280
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &70131527053460 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70131527053460
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: minitest
|
49
|
-
requirement: &
|
49
|
+
requirement: &70131527047800 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70131527047800
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: aruba
|
60
|
-
requirement: &
|
60
|
+
requirement: &70131527044160 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70131527044160
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rdoc
|
71
|
-
requirement: &
|
71
|
+
requirement: &70131527040060 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70131527040060
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: mocha
|
82
|
-
requirement: &
|
82
|
+
requirement: &70131527034280 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70131527034280
|
91
91
|
description: ! "bookshop is a book publishing framework for building pdf/(e)books
|
92
92
|
based on HTML,\n CSS, and JavaScript. The framework is optimized
|
93
93
|
to help publishers, editors, and authors\n quickly ramp-up, allowing
|