bookshelf 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
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="<%= language %>">
4
+ <head>
5
+ <title></title>
6
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
7
+ <link rel="stylesheet" type="text/css" href="user.css"/>
8
+ </head>
9
+
10
+ <body>
11
+ <div class="chapter">
12
+ <%= content %>
13
+ </div>
14
+ </body>
15
+ </html>
@@ -0,0 +1,29 @@
1
+ # Put any Ruby code in here.
2
+ # Here's an example on how you can extend RedCloth (Textile) with new formatters.
3
+ #
4
+ # module RedCloth
5
+ # module Formatters
6
+ # module HTML
7
+ # def attention(options)
8
+ # %[<p class="attention">#{options[:text]}</p>]
9
+ # end
10
+ # end
11
+ # end
12
+ # end
13
+ #
14
+ # Then you can just use `attention. This is an important note!` on your text.
15
+ #
16
+ # You can add inline formatters as well. The approach is slightly different,
17
+ # but pretty straightforward.
18
+ #
19
+ # Add your formatter to `RedCloth::INLINE_FORMATTERS` and implement the method, making sure that it
20
+ # replaces the content using `String#gsub!`.
21
+ #
22
+ # module RedCloth
23
+ # def my_formatter(text)
24
+ # text.gsub!(/Hello/, "Hi")
25
+ # end
26
+ # end
27
+ #
28
+ # RedCloth::INLINE_FORMATTERS << :my_formatter
29
+ #
@@ -0,0 +1,353 @@
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
+ prince-bookmark-level: none;
53
+ }
54
+
55
+ .frontcover h1 { prince-bookmark-level: 1; }
56
+ .chapter h2 { prince-bookmark-level: 2; }
57
+ .chapter h3 { prince-bookmark-level: 3; }
58
+ .chapter h4 { prince-bookmark-level: 4; }
59
+ .chapter h5 { prince-bookmark-level: 5; }
60
+ .chapter h6 { prince-bookmark-level: 6; }
61
+
62
+ /* ============= */
63
+ /* = CONTAINER = */
64
+ /* ============= */
65
+ div.container {
66
+ height: 7in;
67
+ left: 0;
68
+ page: cover;
69
+ position: absolute;
70
+ top: 0;
71
+ width: 9.25in;
72
+ z-index: -1;
73
+ }
74
+
75
+ /* ============== */
76
+ /* = FRONTCOVER = */
77
+ /* ============== */
78
+ div.frontcover {
79
+ background: #fff;
80
+ }
81
+
82
+ div.frontcover div {
83
+ left: 1in;
84
+ padding-top: 0.25in;
85
+ position: absolute;
86
+ top: 2.5in;
87
+ width: 7.25in;
88
+ }
89
+
90
+ div.frontcover h1 {
91
+ color: #f00;
92
+ font-size: 46pt;
93
+ }
94
+
95
+ div.frontcover p {
96
+ font-size: 18pt;
97
+ }
98
+
99
+ div.frontcover p.description {
100
+ color: #666;
101
+ font: italic normal normal 14pt/normal Baskerville, "Hoefler Text", Garamond, "Times New Roman", serif;
102
+ margin-top: -.1in;
103
+ }
104
+
105
+ div.frontcover p.authors {
106
+ color: #000;
107
+ font-style: italic;
108
+ position: absolute;
109
+ top: 0;
110
+ }
111
+
112
+ div.frontcover * {
113
+ margin: 0;
114
+ }
115
+
116
+ /* =========== */
117
+ /* = CHAPTER = */
118
+ /* =========== */
119
+ #chapters {
120
+ counter-reset: page 1;
121
+ counter-reset: chapter;
122
+ page-break-before: always;
123
+ }
124
+
125
+ .chapter {
126
+ color: #444;
127
+ counter-reset: footnote 0;
128
+ page-break-after: always;
129
+ }
130
+
131
+ .chapter a {
132
+ color: #0AE;
133
+ text-decoration: none;
134
+ }
135
+
136
+ .chapter h2,
137
+ .chapter h3,
138
+ .chapter h4,
139
+ .chapter h5 {
140
+ margin: 25pt 0 15pt 0;
141
+ }
142
+
143
+ .chapter h2 {
144
+ color: #222;
145
+ counter-increment: chapter;
146
+ font-size: 36pt;
147
+ line-height: 1;
148
+ string-set: header "Chapter " counter(chapter) ": " content();
149
+ }
150
+
151
+ .chapter h2::before {
152
+ content: "Chapter " counter(chapter);
153
+ color: #999;
154
+ display: block;
155
+ font-size: 18pt;
156
+ letter-spacing: 0;
157
+ margin-bottom: .2em;
158
+ white-space: pre;
159
+ }
160
+
161
+ .chapter h3,
162
+ .chapter h5 {
163
+ font-family: "helvetica", arial, sans-serif;
164
+ }
165
+
166
+ .chapter h3 {
167
+ color: #b62f32;
168
+ font-size: 28px;
169
+ }
170
+
171
+ .chapter h4 {
172
+ font-size: 18px;
173
+ font-family: "helvetica neue", "arial narrow", sans-serif;
174
+ }
175
+
176
+ .chapter h5 {
177
+ font-size: 15px;
178
+ }
179
+
180
+ .chapter h6 {
181
+ font-size: 15px;
182
+ font-weight: normal;
183
+ text-transform: uppercase;
184
+ }
185
+
186
+ /* =========== */
187
+ /* = IMPRINT = */
188
+ /* =========== */
189
+ .imprint {
190
+ background: #E2E7E2;
191
+ page: cover;
192
+ string-set: header "";
193
+ }
194
+
195
+ .imprint, .imprint * {
196
+ color: #5b5b5b;
197
+ }
198
+
199
+ .imprint * {
200
+ font-family: "Lucida Grande", arial, sans-serif;
201
+ font-size: 10pt;
202
+ margin: 0 0 2pt 0;
203
+ }
204
+
205
+ .imprint div {
206
+ left: 0.5in;
207
+ position: absolute;
208
+ bottom: 0.3in;
209
+ }
210
+
211
+ /* ========== */
212
+ /* = CODING = */
213
+ /* ========== */
214
+ pre, code {
215
+ color: #090;
216
+ font-family: monaco, monospace;
217
+ font-size: 9pt;
218
+ }
219
+
220
+ pre, pre code {
221
+ font-size: 8pt;
222
+ line-height: 1.4;
223
+ padding-left: 25pt;
224
+ }
225
+
226
+ /* ========= */
227
+ /* = TABLE = */
228
+ /* ========= */
229
+ table {
230
+ border-collapse: collapse;
231
+ }
232
+
233
+ thead th {
234
+ background: #e9e9e9;
235
+ }
236
+
237
+ th, td {
238
+ border: 1px solid #ccc;
239
+ font-size: 11pt;
240
+ padding: 5pt;
241
+ }
242
+
243
+ /* ========= */
244
+ /* = LISTS = */
245
+ /* ========= */
246
+ li {
247
+ margin-bottom: 8pt;
248
+ }
249
+
250
+ li ul,
251
+ li ol {
252
+ margin-left: 15pt;
253
+ }
254
+
255
+ /* ========== */
256
+ /* = FIGURE = */
257
+ /* ========== */
258
+ .figure img:after {
259
+ content: attr("alt");
260
+ display: block;
261
+ font-size: 10pt;
262
+ }
263
+
264
+ img {
265
+ max-width: none;
266
+ prince-image-resolution: 96dpi;
267
+ }
268
+
269
+ .figure {
270
+ float: right;
271
+ margin: 0 0 20pt 20pt;
272
+ overflow: auto;
273
+ text-align: center;
274
+ }
275
+
276
+ /* ===================== */
277
+ /* = TABLE OF CONTENTS = */
278
+ /* ===================== */
279
+ div.table-of-contents {
280
+ page: toc;
281
+ }
282
+
283
+ div.table-of-contents h2 {
284
+ font-size: 36pt;
285
+ }
286
+
287
+ div.table-of-contents a {
288
+ font-size: 11pt;
289
+ text-decoration: none;
290
+ }
291
+
292
+ div.table-of-contents div.level2 a {
293
+ color: #000;
294
+ font-weight: bold;
295
+ }
296
+
297
+ div.table-of-contents #toc {
298
+ column-count: 2;
299
+ column-fill: auto;
300
+ column-gap: 5%;
301
+ column-rule: none;
302
+ column-width: 45%;
303
+ }
304
+
305
+ div.table-of-contents #toc div {
306
+ padding-bottom: 10px;
307
+ }
308
+
309
+ div.table-of-contents div.level3 {
310
+ margin-left: 20px;
311
+ }
312
+
313
+ div.table-of-contents #toc div.level3 a {
314
+ color: #555;
315
+ }
316
+
317
+ div.table-of-contents div a::before {
318
+ color: #888;
319
+ content: target-counter(attr(href), page) " ";
320
+ float: left;
321
+ font-weight: normal;
322
+ font-size: 11pt !important;
323
+ margin-right: 4px;
324
+ width: 40px;
325
+ }
326
+
327
+ div.table-of-contents div.level3 a::before {
328
+ width: 20px;
329
+ }
330
+
331
+ div.table-of-contents div.level4,
332
+ div.table-of-contents div.level5,
333
+ div.table-of-contents div.level6 {
334
+ display: none;
335
+ }
336
+
337
+ /* ===================== */
338
+ /* = OTHER TEXT TWEAKS = */
339
+ /* ===================== */
340
+ acronym:after {
341
+ content: " (" attr(title) ")";
342
+ }
343
+
344
+ /* ============= */
345
+ /* = HIGHLIGHT = */
346
+ /* ============= */
347
+ .highlight {
348
+ font-size: 20pt;
349
+ }
350
+
351
+ .highlight strong {
352
+ color: #b62f32;
353
+ }
@@ -0,0 +1,44 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3
+ <html>
4
+ <head>
5
+ <title><%= title %></title>
6
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
7
+ <link rel="stylesheet" type="text/css" href="../templates/html/layout.css"/>
8
+ <link rel="stylesheet" type="text/css" href="../templates/html/syntax.css"/>
9
+ <link rel="stylesheet" type="text/css" href="../templates/html/user.css"/>
10
+
11
+ <meta name="author" content="<%= authors.join(', ') %>" />
12
+ <meta name="subject" content="<%= subject %>" />
13
+ <meta name="keywords" content="<%= keywords %>" />
14
+ <meta name="date" content="<%= published_at %>" />
15
+ </head>
16
+ <body>
17
+ <div class="frontcover container">
18
+ <div>
19
+ <h1><%= title %></h1>
20
+ <p class="description"><%= subject %></p>
21
+ <p class="authors"><%= authors.to_sentence %></p>
22
+ </div>
23
+ </div>
24
+
25
+ <div class="table-of-contents">
26
+ <h2 class="no-toc">Content</h2>
27
+ <div id="toc">
28
+ <%= toc %>
29
+ </div>
30
+ </div>
31
+
32
+ <div id="chapters">
33
+ <%= content %>
34
+ </div>
35
+
36
+ <div class="imprint container">
37
+ <div>
38
+ <h2><%= title %></h2>
39
+ <p><%= authors.to_sentence %></p>
40
+ <p><%= copyright %></p>
41
+ </div>
42
+ </div>
43
+ </body>
44
+ </html>
@@ -0,0 +1 @@
1
+ /* add custom CSS */
metadata ADDED
@@ -0,0 +1,244 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bookshelf
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Brad Crawford
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-05-19 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: activesupport
16
+ requirement: &70233285321100 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70233285321100
25
+ - !ruby/object:Gem::Dependency
26
+ name: nokogiri
27
+ requirement: &70233285320640 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70233285320640
36
+ - !ruby/object:Gem::Dependency
37
+ name: RedCloth
38
+ requirement: &70233285320220 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *70233285320220
47
+ - !ruby/object:Gem::Dependency
48
+ name: rdiscount
49
+ requirement: &70233285319800 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: *70233285319800
58
+ - !ruby/object:Gem::Dependency
59
+ name: i18n
60
+ requirement: &70233285319380 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :runtime
67
+ prerelease: false
68
+ version_requirements: *70233285319380
69
+ - !ruby/object:Gem::Dependency
70
+ name: thor
71
+ requirement: &70233285318960 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: *70233285318960
80
+ - !ruby/object:Gem::Dependency
81
+ name: eeepub-with-cover-support
82
+ requirement: &70233268785200 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ type: :runtime
89
+ prerelease: false
90
+ version_requirements: *70233268785200
91
+ - !ruby/object:Gem::Dependency
92
+ name: notifier
93
+ requirement: &70233268782640 !ruby/object:Gem::Requirement
94
+ none: false
95
+ requirements:
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ type: :runtime
100
+ prerelease: false
101
+ version_requirements: *70233268782640
102
+ - !ruby/object:Gem::Dependency
103
+ name: rspec
104
+ requirement: &70233268781540 !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: *70233268781540
113
+ - !ruby/object:Gem::Dependency
114
+ name: test_notifier
115
+ requirement: &70233285350100 !ruby/object:Gem::Requirement
116
+ none: false
117
+ requirements:
118
+ - - ! '>='
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
121
+ type: :development
122
+ prerelease: false
123
+ version_requirements: *70233285350100
124
+ - !ruby/object:Gem::Dependency
125
+ name: rake
126
+ requirement: &70233285349680 !ruby/object:Gem::Requirement
127
+ none: false
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: *70233285349680
135
+ - !ruby/object:Gem::Dependency
136
+ name: pry
137
+ requirement: &70233285349260 !ruby/object:Gem::Requirement
138
+ none: false
139
+ requirements:
140
+ - - ! '>='
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
143
+ type: :development
144
+ prerelease: false
145
+ version_requirements: *70233285349260
146
+ - !ruby/object:Gem::Dependency
147
+ name: pry-nav
148
+ requirement: &70233285348840 !ruby/object:Gem::Requirement
149
+ none: false
150
+ requirements:
151
+ - - ! '>='
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
154
+ type: :development
155
+ prerelease: false
156
+ version_requirements: *70233285348840
157
+ - !ruby/object:Gem::Dependency
158
+ name: awesome_print
159
+ requirement: &70233285348420 !ruby/object:Gem::Requirement
160
+ none: false
161
+ requirements:
162
+ - - ! '>='
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
165
+ type: :development
166
+ prerelease: false
167
+ version_requirements: *70233285348420
168
+ description: A framework that generates PDF and e-Pub from Markdown, Textile, and
169
+ HTML files.
170
+ email:
171
+ - brad.robert.crawford@gmail.com
172
+ executables:
173
+ - bookshelf
174
+ extensions: []
175
+ extra_rdoc_files: []
176
+ files:
177
+ - .gitignore
178
+ - .gitmodules
179
+ - Gemfile
180
+ - Gemfile.lock
181
+ - README.md
182
+ - Rakefile
183
+ - bin/bookshelf
184
+ - bookshelf.gemspec
185
+ - lib/bookshelf.rb
186
+ - lib/bookshelf/adapters/markdown.rb
187
+ - lib/bookshelf/cli.rb
188
+ - lib/bookshelf/dependency.rb
189
+ - lib/bookshelf/errors.rb
190
+ - lib/bookshelf/exporter.rb
191
+ - lib/bookshelf/extensions/redcloth.rb
192
+ - lib/bookshelf/extensions/string.rb
193
+ - lib/bookshelf/generator.rb
194
+ - lib/bookshelf/parser.rb
195
+ - lib/bookshelf/parser/epub.rb
196
+ - lib/bookshelf/parser/html.rb
197
+ - lib/bookshelf/parser/mobi.rb
198
+ - lib/bookshelf/parser/pdf.rb
199
+ - lib/bookshelf/parser/txt.rb
200
+ - lib/bookshelf/stats.rb
201
+ - lib/bookshelf/stream.rb
202
+ - lib/bookshelf/syntax.rb
203
+ - lib/bookshelf/toc.rb
204
+ - lib/bookshelf/toc/epub.rb
205
+ - lib/bookshelf/toc/html.rb
206
+ - lib/bookshelf/version.rb
207
+ - templates/Guardfile
208
+ - templates/config.erb
209
+ - templates/cover.erb
210
+ - templates/cover.png
211
+ - templates/ebook.png
212
+ - templates/epub.css
213
+ - templates/epub.erb
214
+ - templates/helper.rb
215
+ - templates/layout.css
216
+ - templates/layout.erb
217
+ - templates/user.css
218
+ homepage: https://bitbucket.org/bradcrawford/bookshelf
219
+ licenses:
220
+ - MIT
221
+ post_install_message:
222
+ rdoc_options: []
223
+ require_paths:
224
+ - lib
225
+ required_ruby_version: !ruby/object:Gem::Requirement
226
+ none: false
227
+ requirements:
228
+ - - ! '>='
229
+ - !ruby/object:Gem::Version
230
+ version: '1.9'
231
+ required_rubygems_version: !ruby/object:Gem::Requirement
232
+ none: false
233
+ requirements:
234
+ - - ! '>='
235
+ - !ruby/object:Gem::Version
236
+ version: '0'
237
+ requirements: []
238
+ rubyforge_project:
239
+ rubygems_version: 1.8.15
240
+ signing_key:
241
+ specification_version: 3
242
+ summary: A framework that generates PDF and e-Pub from Markdown, Textile, and HTML
243
+ files.
244
+ test_files: []