epubbery 0.1.2
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.
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +19 -0
- data/Gemfile.lock +38 -0
- data/LICENSE.txt +26 -0
- data/README.rdoc +41 -0
- data/Rakefile +55 -0
- data/VERSION +1 -0
- data/bin/epubbery +57 -0
- data/config_sample.yml +7 -0
- data/epubbery.gemspec +126 -0
- data/lib/book.rb +30 -0
- data/lib/chapter.rb +66 -0
- data/lib/epub_setup.rb +70 -0
- data/lib/epubbery.rb +16 -0
- data/spec/book_spec.rb +25 -0
- data/spec/chapter_spec.rb +65 -0
- data/spec/epub_setup_spec.rb +52 -0
- data/spec/spec_helper.rb +12 -0
- data/templates/META-INF/container.xml +7 -0
- data/templates/OEBPS/chapter.html.liquid +24 -0
- data/templates/OEBPS/content.opf.liquid +41 -0
- data/templates/OEBPS/end_of_book.html.liquid +33 -0
- data/templates/OEBPS/fonts/BergamoStd-Bold.otf +0 -0
- data/templates/OEBPS/fonts/BergamoStd-BoldItalic.otf +0 -0
- data/templates/OEBPS/fonts/BergamoStd-Italic.otf +0 -0
- data/templates/OEBPS/fonts/BergamoStd-Regular.otf +0 -0
- data/templates/OEBPS/fonts/OFLGoudyStM-Italic.otf +0 -0
- data/templates/OEBPS/fonts/OFLGoudyStM.otf +0 -0
- data/templates/OEBPS/fonts/licenses.txt +158 -0
- data/templates/OEBPS/fonts/texgyrepagella-bold.otf +0 -0
- data/templates/OEBPS/fonts/texgyrepagella-bolditalic.otf +0 -0
- data/templates/OEBPS/fonts/texgyrepagella-italic.otf +0 -0
- data/templates/OEBPS/fonts/texgyrepagella-regular.otf +0 -0
- data/templates/OEBPS/fonts/texgyretermes-bold.otf +0 -0
- data/templates/OEBPS/fonts/texgyretermes-bolditalic.otf +0 -0
- data/templates/OEBPS/fonts/texgyretermes-italic.otf +0 -0
- data/templates/OEBPS/fonts/texgyretermes-regular.otf +0 -0
- data/templates/OEBPS/fonts.css +127 -0
- data/templates/OEBPS/images/made_by_obf.jpg +0 -0
- data/templates/OEBPS/print.css +4 -0
- data/templates/OEBPS/stylesheet.css +82 -0
- data/templates/OEBPS/title.html.liquid +13 -0
- data/templates/OEBPS/toc.ncx.liquid +30 -0
- data/templates/mimetype +1 -0
- metadata +290 -0
@@ -0,0 +1,52 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
include EpubSetup
|
4
|
+
|
5
|
+
describe EpubSetup do
|
6
|
+
before(:all) do
|
7
|
+
@tmp_epub_folder = "test_epub_folder_safe_to_remove_will_be_deleted"
|
8
|
+
@base_dir = File.expand_path(File.dirname(__FILE__) + "/..")
|
9
|
+
@tmp_text_folder = "test_epub_folder_safe_to_remove_will_be_deleted2"
|
10
|
+
FileUtils.rm_rf File.join(@base_dir, @tmp_text_folder) if File.exists?(File.join(@base_dir, @tmp_text_folder))
|
11
|
+
FileUtils.mkdir File.join(@base_dir, @tmp_text_folder)
|
12
|
+
File.open(File.join(@base_dir, @tmp_text_folder, "1.txt"), "w") do |f|
|
13
|
+
f.puts "Chapter: 1\n"
|
14
|
+
f.puts "Blah blah blah.\n"
|
15
|
+
end
|
16
|
+
File.open(File.join(@base_dir, @tmp_text_folder, "2.txt"), "w") do |f|
|
17
|
+
f.puts "Chapter: 2\n"
|
18
|
+
f.puts "Bork bork bork.\n"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
after(:all) do
|
23
|
+
FileUtils.rm_rf File.join(@base_dir, @tmp_epub_folder)
|
24
|
+
FileUtils.rm_rf File.join(@base_dir, @tmp_text_folder)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should make skeleton" do
|
28
|
+
make_skeleton @base_dir, @tmp_epub_folder
|
29
|
+
File.exists?(File.join(@tmp_epub_folder, 'META-INF')).should == true
|
30
|
+
File.exists?(File.join(@tmp_epub_folder, 'META-INF', 'container.xml')).should == true
|
31
|
+
File.exists?(File.join(@tmp_epub_folder, 'OEBPS')).should == true
|
32
|
+
File.exists?(File.join(@tmp_epub_folder, 'OEBPS', 'stylesheet.css')).should == true
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should read chapters from a glob file description" do
|
36
|
+
chapters = read_chapters("#{File.join(@base_dir, @tmp_text_folder)}/*.txt")
|
37
|
+
chapters.size.should == 2
|
38
|
+
chapters.first.file_name.should == "1.html"
|
39
|
+
chapters[1].file_name.should == "2.html"
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should write tempates into the epub folder" do
|
43
|
+
make_skeleton @base_dir, @tmp_epub_folder
|
44
|
+
book = Book.new "Testy", "Jason", Date.new(2001)
|
45
|
+
book.chapters = read_chapters("#{File.join(@base_dir, @tmp_text_folder)}/*.txt")
|
46
|
+
write_templates book
|
47
|
+
File.exists?(File.join(@tmp_epub_folder, 'OEBPS', 'title.html')).should == true
|
48
|
+
File.exists?(File.join(@tmp_epub_folder, 'OEBPS', '1.html')).should == true
|
49
|
+
File.exists?(File.join(@tmp_epub_folder, 'OEBPS', '2.html')).should == true
|
50
|
+
File.exists?(File.join(@tmp_epub_folder, 'OEBPS', 'end_of_book.html')).should == true
|
51
|
+
end
|
52
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
4
|
+
require 'epubbery'
|
5
|
+
|
6
|
+
# Requires supporting files with custom matchers and macros, etc,
|
7
|
+
# in ./support/ and its subdirectories.
|
8
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2
|
+
<head>
|
3
|
+
<title>{{ chapter.number_or_name }}</title>
|
4
|
+
<link rel="stylesheet" href="stylesheet.css" type="text/css" media="all" />
|
5
|
+
<link rel="stylesheet" href="fonts.css" type="text/css" media="all" />
|
6
|
+
<link rel="stylesheet" href="print.css" type="text/css" media="print" />
|
7
|
+
</head>
|
8
|
+
|
9
|
+
<body>
|
10
|
+
<div id="content">
|
11
|
+
{% if chapter.number != null %}
|
12
|
+
<h1>Chapter {{ chapter.number_as_word | capitalize }}</h1>
|
13
|
+
{% endif %}
|
14
|
+
{% if chapter.name != null %}
|
15
|
+
<h2>{{ chapter.name }}</h2>
|
16
|
+
{% endif %}
|
17
|
+
{% if chapter.meta['subhead'] != null %}
|
18
|
+
<h3>{{ chapter.meta['subhead'] }}</h3>
|
19
|
+
{% endif %}
|
20
|
+
|
21
|
+
{{ chapter.html }}
|
22
|
+
</div>
|
23
|
+
</body>
|
24
|
+
</html>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<?xml version='1.0' encoding='utf-8'?>
|
2
|
+
<package xmlns="http://www.idpf.org/2007/opf"
|
3
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
4
|
+
unique-identifier="bookid" version="2.0">
|
5
|
+
<metadata>
|
6
|
+
<dc:title>{{ book.title }}</dc:title>
|
7
|
+
<dc:creator>{{ book.creator }}</dc:creator>
|
8
|
+
<dc:identifier id="bookid">{{ book.book_id }}</dc:identifier>
|
9
|
+
<dc:language>en-US</dc:language>
|
10
|
+
<dc:date>{{ book.pub_date }}</dc:date>
|
11
|
+
<dc:rights>{{ book.cc_url }}</dc:rights>
|
12
|
+
<meta name="cover" content="cover-image" />
|
13
|
+
</metadata>
|
14
|
+
<manifest>
|
15
|
+
<item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/>
|
16
|
+
<item id="cover" href="title.html" media-type="application/xhtml+xml"/>
|
17
|
+
<item id="end_of_book" href="end_of_book.html" media-type="application/xhtml+xml"/>
|
18
|
+
{% for chapter in book.chapters %}
|
19
|
+
<item id="chapter_{{chapter.chapter_id}}" href="{{chapter.file_name}}" media-type="application/xhtml+xml"/>
|
20
|
+
{% endfor %}
|
21
|
+
{% for image_file in image_files %}
|
22
|
+
<item id="image_{{image_file}}" href="images/{{image_file}}" media-type="image/jpeg"/>
|
23
|
+
{% endfor %}
|
24
|
+
{% for css_file in css_files %}
|
25
|
+
<item id="css_{{css_file}}" href="{{css_file}}" media-type="text/css"/>
|
26
|
+
{% endfor %}
|
27
|
+
{% for font_file in font_files %}
|
28
|
+
<item id="font_{{font_file}}" href="fonts/{{font_file}}" media-type="application/x-font-opentype"/>
|
29
|
+
{% endfor %}
|
30
|
+
</manifest>
|
31
|
+
<spine toc="ncx">
|
32
|
+
<itemref idref="cover" linear="yes"/>
|
33
|
+
{% for chapter in book.chapters %}
|
34
|
+
<itemref idref="chapter_{{chapter.chapter_id}}"/>
|
35
|
+
{% endfor %}
|
36
|
+
<itemref idref="end_of_book"/>
|
37
|
+
</spine>
|
38
|
+
<guide>
|
39
|
+
<reference href="title.html" type="cover" title="Cover"/>
|
40
|
+
</guide>
|
41
|
+
</package>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2
|
+
<head>
|
3
|
+
<title>In closing...</title>
|
4
|
+
<link rel="stylesheet" href="stylesheet.css" type="text/css" media="all" />
|
5
|
+
<link rel="stylesheet" href="fonts.css" type="text/css" media="all" />
|
6
|
+
<link rel="stylesheet" href="print.css" type="text/css" media="print" />
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<div class="smaller">
|
10
|
+
<p>This E-Book was produced by tools provided by OpenBookFiction.com</p>
|
11
|
+
|
12
|
+
<p>Copyright © {{book.pub_year}} by {{book.author}}</p>
|
13
|
+
|
14
|
+
<p>All rights reserved. Except as permitted under the U.S. Copyright Act of 1976,
|
15
|
+
no part of this publication may be reproduced, distributed, or transmitted in any form
|
16
|
+
or by any means, or stored in a database or retrieval system, without the prior
|
17
|
+
written permission of the author.</p>
|
18
|
+
|
19
|
+
<p><strong>This e-book is DRM free.</strong> DRM stands for <em>Digital Rights Management</em>.
|
20
|
+
Basically, it's the stuff that some companies use to protect digital media (such as e-books,
|
21
|
+
music/audio files, DVD, and so on) from being copied and redistributed.
|
22
|
+
It's technology that replaces trust.</p>
|
23
|
+
|
24
|
+
<p>I'm not going to waste time and energy on distrust. If you want to share this e-book with a
|
25
|
+
friend, then pretend it's a real book - just delete it from your hard drive after you copy it and
|
26
|
+
give it away. <em>(wink wink nudge nudge)</em></p>
|
27
|
+
|
28
|
+
<p>If you've received a copy from a friend and you've read this far and you would like to support
|
29
|
+
a struggling author, I would be humbly honored if you would go to my site
|
30
|
+
and pay for your very own copy of this e-book.</p>
|
31
|
+
</div>
|
32
|
+
</body>
|
33
|
+
</html>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,158 @@
|
|
1
|
+
Bergamo-Std:
|
2
|
+
|
3
|
+
This typeface software ("SOFTWARE") is the property of FontSite Inc. Its
|
4
|
+
use by you is covered under the terms of an End-User License Agreement
|
5
|
+
("EULA"). By exercising your rights to make and use copies of this SOFTWARE,
|
6
|
+
you agree to be bound by the terms of this EULA. If you do not agree to the
|
7
|
+
terms of this EULA, you may not use the SOFTWARE.
|
8
|
+
|
9
|
+
This SOFTWARE is a valuable asset of FontSite Inc. which is protected by
|
10
|
+
copyright laws and international copyright treaties, as well as other
|
11
|
+
intellectual property laws and treaties. The typeface software is licensed,
|
12
|
+
not sold.
|
13
|
+
|
14
|
+
This EULA grants you the following rights:
|
15
|
+
|
16
|
+
You may install and use an unlimited number of copies of this SOFTWARE.
|
17
|
+
|
18
|
+
You may reproduce and distribute an unlimited number of copies of this
|
19
|
+
SOFTWARE, provided that each copy shall be a true and complete copy,
|
20
|
+
including all copyright and trademark notices, electronic documentation
|
21
|
+
(user guide in PDF format, etc.), and shall be accompanied by a copy of this
|
22
|
+
EULA. Copies of the SOFTWARE may not be distributed for profit either on a
|
23
|
+
standalone basis or included as part of your own product.
|
24
|
+
|
25
|
+
|
26
|
+
-----
|
27
|
+
|
28
|
+
OFL-Sorts-Mill-Goudy:
|
29
|
+
|
30
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
31
|
+
This license is copied below, and is also available with a FAQ at:
|
32
|
+
http://scripts.sil.org/OFL
|
33
|
+
|
34
|
+
|
35
|
+
-----------------------------------------------------------
|
36
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
37
|
+
-----------------------------------------------------------
|
38
|
+
|
39
|
+
PREAMBLE
|
40
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
41
|
+
development of collaborative font projects, to support the font creation
|
42
|
+
efforts of academic and linguistic communities, and to provide a free and
|
43
|
+
open framework in which fonts may be shared and improved in partnership
|
44
|
+
with others.
|
45
|
+
|
46
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
47
|
+
redistributed freely as long as they are not sold by themselves. The
|
48
|
+
fonts, including any derivative works, can be bundled, embedded,
|
49
|
+
redistributed and/or sold with any software provided that any reserved
|
50
|
+
names are not used by derivative works. The fonts and derivatives,
|
51
|
+
however, cannot be released under any other type of license. The
|
52
|
+
requirement for fonts to remain under this license does not apply
|
53
|
+
to any document created using the fonts or their derivatives.
|
54
|
+
|
55
|
+
DEFINITIONS
|
56
|
+
"Font Software" refers to the set of files released by the Copyright
|
57
|
+
Holder(s) under this license and clearly marked as such. This may
|
58
|
+
include source files, build scripts and documentation.
|
59
|
+
|
60
|
+
"Reserved Font Name" refers to any names specified as such after the
|
61
|
+
copyright statement(s).
|
62
|
+
|
63
|
+
"Original Version" refers to the collection of Font Software components as
|
64
|
+
distributed by the Copyright Holder(s).
|
65
|
+
|
66
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
67
|
+
or substituting -- in part or in whole -- any of the components of the
|
68
|
+
Original Version, by changing formats or by porting the Font Software to a
|
69
|
+
new environment.
|
70
|
+
|
71
|
+
"Author" refers to any designer, engineer, programmer, technical
|
72
|
+
writer or other person who contributed to the Font Software.
|
73
|
+
|
74
|
+
PERMISSION & CONDITIONS
|
75
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
76
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
77
|
+
redistribute, and sell modified and unmodified copies of the Font
|
78
|
+
Software, subject to the following conditions:
|
79
|
+
|
80
|
+
1) Neither the Font Software nor any of its individual components,
|
81
|
+
in Original or Modified Versions, may be sold by itself.
|
82
|
+
|
83
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
84
|
+
redistributed and/or sold with any software, provided that each copy
|
85
|
+
contains the above copyright notice and this license. These can be
|
86
|
+
included either as stand-alone text files, human-readable headers or
|
87
|
+
in the appropriate machine-readable metadata fields within text or
|
88
|
+
binary files as long as those fields can be easily viewed by the user.
|
89
|
+
|
90
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
91
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
92
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
93
|
+
presented to the users.
|
94
|
+
|
95
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
96
|
+
Software shall not be used to promote, endorse or advertise any
|
97
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
98
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
99
|
+
permission.
|
100
|
+
|
101
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
102
|
+
must be distributed entirely under this license, and must not be
|
103
|
+
distributed under any other license. The requirement for fonts to
|
104
|
+
remain under this license does not apply to any document created
|
105
|
+
using the Font Software.
|
106
|
+
|
107
|
+
TERMINATION
|
108
|
+
This license becomes null and void if any of the above conditions are
|
109
|
+
not met.
|
110
|
+
|
111
|
+
DISCLAIMER
|
112
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
113
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
114
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
115
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
116
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
117
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
118
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
119
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
120
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
-----
|
125
|
+
|
126
|
+
TeX Gyre (Pagella and Termes):
|
127
|
+
|
128
|
+
|
129
|
+
This is a preliminary version (2006-09-30), barring acceptance from
|
130
|
+
the LaTeX Project Team and other feedback, of the GUST Font License.
|
131
|
+
(GUST is the Polish TeX Users Group, http://www.gust.org.pl)
|
132
|
+
|
133
|
+
For the most recent version of this license see
|
134
|
+
http://www.gust.org.pl/fonts/licenses/GUST-FONT-LICENSE.txt
|
135
|
+
or
|
136
|
+
http://tug.org/fonts/licenses/GUST-FONT-LICENSE.txt
|
137
|
+
|
138
|
+
This work may be distributed and/or modified under the conditions
|
139
|
+
of the LaTeX Project Public License, either version 1.3c of this
|
140
|
+
license or (at your option) any later version.
|
141
|
+
|
142
|
+
Please also observe the following clause:
|
143
|
+
1) it is requested, but not legally required, that derived works be
|
144
|
+
distributed only after changing the names of the fonts comprising this
|
145
|
+
work and given in an accompanying "manifest", and that the
|
146
|
+
files comprising the Work, as listed in the manifest, also be given
|
147
|
+
new names. Any exceptions to this request are also given in the
|
148
|
+
manifest.
|
149
|
+
|
150
|
+
We recommend the manifest be given in a separate file named
|
151
|
+
MANIFEST-<fontid>.txt, where <fontid> is some unique identification
|
152
|
+
of the font family. If a separate "readme" file accompanies the Work,
|
153
|
+
we recommend a name of the form README-<fontid>.txt.
|
154
|
+
|
155
|
+
The latest version of the LaTeX Project Public License is in
|
156
|
+
http://www.latex-project.org/lppl.txt and version 1.3c or later
|
157
|
+
is part of all distributions of LaTeX version 2006/05/20 or later.
|
158
|
+
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,127 @@
|
|
1
|
+
/* A Few Fonts
|
2
|
+
* -----------
|
3
|
+
*
|
4
|
+
* There are many ways to embed fonts for different browsers.
|
5
|
+
* For the sake of simplicity, I'm including the most correct way. As such,
|
6
|
+
* these, fonts might not work for all browsers, but they should fall back
|
7
|
+
* properly.
|
8
|
+
*
|
9
|
+
* See: http://www.metaltoad.com/blog/how-use-font-face-avoid-faux-italic-and-bold-browser-styles
|
10
|
+
*/
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
/* OFL Sorts Mill Goudy */
|
15
|
+
|
16
|
+
@font-face {
|
17
|
+
font-family: 'OFL Sorts Mill Goudy';
|
18
|
+
font-style: normal;
|
19
|
+
font-weight: normal;
|
20
|
+
src: url("fonts/OFL Sorts Mill GoudyStM.otf");
|
21
|
+
}
|
22
|
+
|
23
|
+
@font-face {
|
24
|
+
font-family: 'OFL Sorts Mill Goudy';
|
25
|
+
font-style: italic;
|
26
|
+
font-weight: normal;
|
27
|
+
src: url("fonts/OFL Sorts Mill GoudyStM-Italic.otf");
|
28
|
+
}
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
/* Bergamo Std */
|
33
|
+
|
34
|
+
@font-face {
|
35
|
+
font-family: 'Bergamo Std';
|
36
|
+
font-style: normal;
|
37
|
+
font-weight: normal;
|
38
|
+
src: url("fonts/BergamoStd-Regular.otf");
|
39
|
+
}
|
40
|
+
|
41
|
+
@font-face {
|
42
|
+
font-family: 'Bergamo Std';
|
43
|
+
font-style: italic;
|
44
|
+
font-weight: normal;
|
45
|
+
src: url("fonts/BergamoStd-Italic.otf");
|
46
|
+
}
|
47
|
+
|
48
|
+
@font-face {
|
49
|
+
font-family: 'Bergamo Std';
|
50
|
+
font-style: normal;
|
51
|
+
font-weight: bold;
|
52
|
+
src: url("fonts/BergamoStd-Bold.otf");
|
53
|
+
}
|
54
|
+
|
55
|
+
@font-face {
|
56
|
+
font-family: 'Bergamo Std';
|
57
|
+
font-style: italic;
|
58
|
+
font-weight: bold;
|
59
|
+
src: url("fonts/BergamoStd-BoldItalic.otf");
|
60
|
+
}
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
/* TeX Gyre Pagella */
|
67
|
+
|
68
|
+
@font-face {
|
69
|
+
font-family: 'TeX Gyre Pagella';
|
70
|
+
font-style: normal;
|
71
|
+
font-weight: normal;
|
72
|
+
src: url("fonts/texgyrepagella-regular.otf");
|
73
|
+
}
|
74
|
+
|
75
|
+
@font-face {
|
76
|
+
font-family: 'TeX Gyre Pagella';
|
77
|
+
font-style: italic;
|
78
|
+
font-weight: normal;
|
79
|
+
src: url("fonts/texgyrepagella-italic.otf");
|
80
|
+
}
|
81
|
+
|
82
|
+
@font-face {
|
83
|
+
font-family: 'TeX Gyre Pagella';
|
84
|
+
font-style: normal;
|
85
|
+
font-weight: bold;
|
86
|
+
src: url("fonts/texgyrepagella-bold.otf");
|
87
|
+
}
|
88
|
+
|
89
|
+
@font-face {
|
90
|
+
font-family: 'TeX Gyre Pagella';
|
91
|
+
font-style: italic;
|
92
|
+
font-weight: bold;
|
93
|
+
src: url("fonts/texgyrepagella-bolditalic.otf");
|
94
|
+
}
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
/* TeX Gyre Termes */
|
99
|
+
|
100
|
+
@font-face {
|
101
|
+
font-family: 'TeX Gyre Termes';
|
102
|
+
font-style: normal;
|
103
|
+
font-weight: normal;
|
104
|
+
src: url("fonts/texgyretermes-regular.otf");
|
105
|
+
}
|
106
|
+
|
107
|
+
@font-face {
|
108
|
+
font-family: 'TeX Gyre Termes';
|
109
|
+
font-style: italic;
|
110
|
+
font-weight: normal;
|
111
|
+
src: url("fonts/texgyretermes-italic.otf");
|
112
|
+
}
|
113
|
+
|
114
|
+
@font-face {
|
115
|
+
font-family: 'TeX Gyre Termes';
|
116
|
+
font-style: normal;
|
117
|
+
font-weight: bold;
|
118
|
+
src: url("fonts/texgyretermes-bold.otf");
|
119
|
+
}
|
120
|
+
|
121
|
+
@font-face {
|
122
|
+
font-family: 'TeX Gyre Termes';
|
123
|
+
font-style: italic;
|
124
|
+
font-weight: bold;
|
125
|
+
src: url("fonts/texgyretermes-bolditalic.otf");
|
126
|
+
}
|
127
|
+
|
Binary file
|
@@ -0,0 +1,82 @@
|
|
1
|
+
/* Most of this CSS is by Jason LaPier:
|
2
|
+
* http://openbookfiction.com
|
3
|
+
*
|
4
|
+
* other great resources:
|
5
|
+
* http://epubzengarden.com/
|
6
|
+
* http://www.fontsquirrel.com/
|
7
|
+
* http://blog.threepress.org/
|
8
|
+
*/
|
9
|
+
|
10
|
+
#content {
|
11
|
+
background-color: white;
|
12
|
+
color: black;
|
13
|
+
font-family: 'TeX Gyre Termes', serif;
|
14
|
+
text-align: justify;
|
15
|
+
}
|
16
|
+
|
17
|
+
#content h1, #content h2, #content h3 {
|
18
|
+
text-align: right;
|
19
|
+
font-family: sans-serif;
|
20
|
+
}
|
21
|
+
|
22
|
+
#content h1 {
|
23
|
+
border-bottom: 1px solid black;
|
24
|
+
margin: 2em 0em;
|
25
|
+
font-variant: small-caps;
|
26
|
+
}
|
27
|
+
|
28
|
+
/*
|
29
|
+
#content h1 { text-transform:uppercase }
|
30
|
+
*/
|
31
|
+
|
32
|
+
#content h3 {
|
33
|
+
font-style: italic;
|
34
|
+
}
|
35
|
+
|
36
|
+
blockquote {
|
37
|
+
margin-left: 5em;
|
38
|
+
margin-right: 5em;
|
39
|
+
}
|
40
|
+
|
41
|
+
blockquote .attribution {
|
42
|
+
display: block;
|
43
|
+
text-align: right;
|
44
|
+
}
|
45
|
+
|
46
|
+
p {
|
47
|
+
text-indent: 1em;
|
48
|
+
text-align: justify;
|
49
|
+
margin: 0;
|
50
|
+
clear:both;
|
51
|
+
}
|
52
|
+
|
53
|
+
p.first, p.noindent, blockquote p, h1 + p, h2 + p, h3 + p {
|
54
|
+
text-indent: 0;
|
55
|
+
margin-top: 1em;
|
56
|
+
clear:both;
|
57
|
+
}
|
58
|
+
|
59
|
+
h1 + p:first-line, h2 + p:first-line, h3 + p:first-line {
|
60
|
+
font-variant: small-caps;
|
61
|
+
}
|
62
|
+
|
63
|
+
/*
|
64
|
+
h2 + p:first-letter, h1 + p:first-letter {
|
65
|
+
font-size: 2.5em;
|
66
|
+
font-weight: bold;
|
67
|
+
}
|
68
|
+
*/
|
69
|
+
|
70
|
+
em { font-style: italic; }
|
71
|
+
em em { font-style: normal; }
|
72
|
+
|
73
|
+
strong { font-weight: bold; }
|
74
|
+
strong strong { font-weight: normal; }
|
75
|
+
|
76
|
+
.smaller p {
|
77
|
+
font-size: 8pt;
|
78
|
+
text-indent: 0;
|
79
|
+
text-align:left;
|
80
|
+
margin-bottom: 1em;
|
81
|
+
font-family: 'TeX Gyre Termes', serif;
|
82
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2
|
+
<head>
|
3
|
+
<title>{{ title }}</title>
|
4
|
+
<link rel="stylesheet" href="stylesheet.css" type="text/css" media="all" />
|
5
|
+
<link rel="stylesheet" href="fonts.css" type="text/css" media="all" />
|
6
|
+
<link rel="stylesheet" href="print.css" type="text/css" media="print" />
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<h1>{{ title }}</h1>
|
10
|
+
<div><img src="images/made_by_obf.jpg" alt="Title page"/></div>
|
11
|
+
<p>E-Book Produced by tools provided by OpenBookFiction.com</p>
|
12
|
+
</body>
|
13
|
+
</html>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<?xml version='1.0' encoding='utf-8'?>
|
2
|
+
<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN"
|
3
|
+
"http://www.daisy.org/z3986/2005/ncx-2005-1.dtd">
|
4
|
+
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1" xml:lang="en">
|
5
|
+
<head>
|
6
|
+
<meta name="dtb:uid" content="{{ book.book_id }}"/>
|
7
|
+
<meta name="dtb:depth" content="1"/>
|
8
|
+
<meta name="dtb:totalPageCount" content="0"/>
|
9
|
+
<meta name="dtb:maxPageNumber" content="0"/>
|
10
|
+
</head>
|
11
|
+
<docTitle>
|
12
|
+
<text>{{ book.title }}</text>
|
13
|
+
</docTitle>
|
14
|
+
<navMap>
|
15
|
+
<navPoint id="navpoint-1" playOrder="1">
|
16
|
+
<navLabel>
|
17
|
+
<text>Book cover</text>
|
18
|
+
</navLabel>
|
19
|
+
<content src="title.html"/>
|
20
|
+
</navPoint>
|
21
|
+
{% for chapter in book.chapters %}
|
22
|
+
<navPoint id="navpoint-{{ forloop.index | plus:1 }}" playOrder="{{ forloop.index | plus:1 }}">
|
23
|
+
<navLabel>
|
24
|
+
<text>{{ chapter.name_or_number }}</text>
|
25
|
+
</navLabel>
|
26
|
+
<content src="{{ chapter.file_name }}"/>
|
27
|
+
</navPoint>
|
28
|
+
{% endfor %}
|
29
|
+
</navMap>
|
30
|
+
</ncx>
|
data/templates/mimetype
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
application/epub+zip
|