bookshelf 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bookshelf.gemspec +1 -0
- data/lib/bookshelf/exporter.rb +12 -0
- data/lib/bookshelf/generator.rb +9 -0
- data/lib/bookshelf/version.rb +1 -1
- data/templates/layout.erb +2 -5
- metadata +193 -154
data/bookshelf.gemspec
CHANGED
data/lib/bookshelf/exporter.rb
CHANGED
@@ -17,10 +17,22 @@ module Bookshelf
|
|
17
17
|
@ui ||= Thor::Base.shell.new
|
18
18
|
end
|
19
19
|
|
20
|
+
def export_assets
|
21
|
+
FileUtils.mkdir_p("output/assets/fonts")
|
22
|
+
FileUtils.mkdir_p("output/assets/images")
|
23
|
+
FileUtils.mkdir_p("output/assets/styles")
|
24
|
+
FileUtils.cp_r(Dir.glob('assets/fonts/*'), "output/assets/fonts/")
|
25
|
+
FileUtils.cp_r(Dir.glob('assets/images/*'), "output/assets/images/")
|
26
|
+
["epub","html"].each do |style_sheet|
|
27
|
+
`sass assets/styles/#{style_sheet}.scss output/assets/styles/#{style_sheet}.css`
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
20
31
|
def export!
|
21
32
|
helper = Bookshelf.root_dir.join("config/helper.rb")
|
22
33
|
load(helper) if helper.exist?
|
23
34
|
|
35
|
+
export_assets
|
24
36
|
export_pdf = [nil, "pdf"].include?(options[:only])
|
25
37
|
export_epub = [nil, "mobi", "epub"].include?(options[:only])
|
26
38
|
export_mobi = [nil, "mobi"].include?(options[:only])
|
data/lib/bookshelf/generator.rb
CHANGED
@@ -43,6 +43,10 @@ module Bookshelf
|
|
43
43
|
|
44
44
|
def create_empty_directories
|
45
45
|
empty_directory "output"
|
46
|
+
empty_directory "output/assets"
|
47
|
+
empty_directory "output/assets/fonts"
|
48
|
+
empty_directory "output/assets/images"
|
49
|
+
empty_directory "output/assets/styles"
|
46
50
|
empty_directory "text"
|
47
51
|
end
|
48
52
|
|
@@ -50,10 +54,15 @@ module Bookshelf
|
|
50
54
|
create_file ".gitignore" do
|
51
55
|
"output/*.{html,epub,pdf}\noutput/tmp"
|
52
56
|
end
|
57
|
+
create_file "assets/.gitkeep"
|
53
58
|
create_file "assets/fonts/.gitkeep"
|
54
59
|
create_file "assets/images/.gitkeep"
|
55
60
|
create_file "assets/styles/.gitkeep"
|
56
61
|
create_file "output/.gitkeep"
|
62
|
+
create_file "output/assets/.gitkeep"
|
63
|
+
create_file "output/assets/fonts/.gitkeep"
|
64
|
+
create_file "output/assets/images/.gitkeep"
|
65
|
+
create_file "output/assets/styles/.gitkeep"
|
57
66
|
create_file "text/.gitkeep"
|
58
67
|
end
|
59
68
|
end
|
data/lib/bookshelf/version.rb
CHANGED
data/templates/layout.erb
CHANGED
@@ -1,13 +1,10 @@
|
|
1
1
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
2
|
-
|
2
|
+
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
3
3
|
<html>
|
4
4
|
<head>
|
5
5
|
<title><%= title %></title>
|
6
6
|
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
7
|
-
<link rel="stylesheet" type="text/css" href="
|
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
|
-
|
7
|
+
<link rel="stylesheet" type="text/css" href="assets/styles/html.css"/>
|
11
8
|
<meta name="author" content="<%= authors.join(', ') %>" />
|
12
9
|
<meta name="subject" content="<%= subject %>" />
|
13
10
|
<meta name="keywords" content="<%= keywords %>" />
|
metadata
CHANGED
@@ -1,179 +1,212 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: bookshelf
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
version: 1.2.0
|
6
10
|
platform: ruby
|
7
|
-
authors:
|
11
|
+
authors:
|
8
12
|
- Brad Crawford
|
9
13
|
autorequire:
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
16
|
+
|
17
|
+
date: 2013-05-25 00:00:00 +12:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: activesupport
|
16
|
-
requirement: &70107041166720 !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :runtime
|
23
22
|
prerelease: false
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '0'
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
33
30
|
type: :runtime
|
31
|
+
version_requirements: *id001
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: nokogiri
|
34
34
|
prerelease: false
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: '0'
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
segments:
|
40
|
+
- 0
|
41
|
+
version: "0"
|
44
42
|
type: :runtime
|
43
|
+
version_requirements: *id002
|
44
|
+
- !ruby/object:Gem::Dependency
|
45
|
+
name: RedCloth
|
45
46
|
prerelease: false
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
47
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
segments:
|
52
|
+
- 0
|
53
|
+
version: "0"
|
55
54
|
type: :runtime
|
55
|
+
version_requirements: *id003
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rdiscount
|
56
58
|
prerelease: false
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
version: '0'
|
59
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
segments:
|
64
|
+
- 0
|
65
|
+
version: "0"
|
66
66
|
type: :runtime
|
67
|
+
version_requirements: *id004
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: i18n
|
67
70
|
prerelease: false
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '0'
|
71
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
segments:
|
76
|
+
- 0
|
77
|
+
version: "0"
|
77
78
|
type: :runtime
|
79
|
+
version_requirements: *id005
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: thor
|
78
82
|
prerelease: false
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
version: '0'
|
83
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
segments:
|
88
|
+
- 0
|
89
|
+
version: "0"
|
88
90
|
type: :runtime
|
91
|
+
version_requirements: *id006
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
name: eeepub-with-cover-support
|
89
94
|
prerelease: false
|
90
|
-
|
91
|
-
|
95
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
segments:
|
100
|
+
- 0
|
101
|
+
version: "0"
|
102
|
+
type: :runtime
|
103
|
+
version_requirements: *id007
|
104
|
+
- !ruby/object:Gem::Dependency
|
92
105
|
name: notifier
|
93
|
-
|
94
|
-
|
95
|
-
requirements:
|
96
|
-
- -
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
|
106
|
+
prerelease: false
|
107
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
segments:
|
112
|
+
- 0
|
113
|
+
version: "0"
|
99
114
|
type: :runtime
|
115
|
+
version_requirements: *id008
|
116
|
+
- !ruby/object:Gem::Dependency
|
117
|
+
name: sass
|
100
118
|
prerelease: false
|
101
|
-
|
102
|
-
|
119
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
segments:
|
124
|
+
- 0
|
125
|
+
version: "0"
|
126
|
+
type: :runtime
|
127
|
+
version_requirements: *id009
|
128
|
+
- !ruby/object:Gem::Dependency
|
103
129
|
name: rspec
|
104
|
-
requirement: &70107040940380 !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
|
-
requirements:
|
107
|
-
- - ! '>='
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '0'
|
110
|
-
type: :development
|
111
130
|
prerelease: false
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
- !ruby/object:Gem::Version
|
120
|
-
version: '0'
|
131
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
segments:
|
136
|
+
- 0
|
137
|
+
version: "0"
|
121
138
|
type: :development
|
139
|
+
version_requirements: *id010
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: test_notifier
|
122
142
|
prerelease: false
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
143
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
segments:
|
148
|
+
- 0
|
149
|
+
version: "0"
|
132
150
|
type: :development
|
151
|
+
version_requirements: *id011
|
152
|
+
- !ruby/object:Gem::Dependency
|
153
|
+
name: rake
|
133
154
|
prerelease: false
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
- !ruby/object:Gem::Version
|
142
|
-
version: '0'
|
155
|
+
requirement: &id012 !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
segments:
|
160
|
+
- 0
|
161
|
+
version: "0"
|
143
162
|
type: :development
|
163
|
+
version_requirements: *id012
|
164
|
+
- !ruby/object:Gem::Dependency
|
165
|
+
name: pry
|
144
166
|
prerelease: false
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
- !ruby/object:Gem::Version
|
153
|
-
version: '0'
|
167
|
+
requirement: &id013 !ruby/object:Gem::Requirement
|
168
|
+
requirements:
|
169
|
+
- - ">="
|
170
|
+
- !ruby/object:Gem::Version
|
171
|
+
segments:
|
172
|
+
- 0
|
173
|
+
version: "0"
|
154
174
|
type: :development
|
175
|
+
version_requirements: *id013
|
176
|
+
- !ruby/object:Gem::Dependency
|
177
|
+
name: pry-nav
|
155
178
|
prerelease: false
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
- !ruby/object:Gem::Version
|
164
|
-
version: '0'
|
179
|
+
requirement: &id014 !ruby/object:Gem::Requirement
|
180
|
+
requirements:
|
181
|
+
- - ">="
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
segments:
|
184
|
+
- 0
|
185
|
+
version: "0"
|
165
186
|
type: :development
|
187
|
+
version_requirements: *id014
|
188
|
+
- !ruby/object:Gem::Dependency
|
189
|
+
name: awesome_print
|
166
190
|
prerelease: false
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
191
|
+
requirement: &id015 !ruby/object:Gem::Requirement
|
192
|
+
requirements:
|
193
|
+
- - ">="
|
194
|
+
- !ruby/object:Gem::Version
|
195
|
+
segments:
|
196
|
+
- 0
|
197
|
+
version: "0"
|
198
|
+
type: :development
|
199
|
+
version_requirements: *id015
|
200
|
+
description: A framework that generates PDF and e-Pub from Markdown, Textile, and HTML files.
|
201
|
+
email:
|
171
202
|
- brad.robert.crawford@gmail.com
|
172
|
-
executables:
|
203
|
+
executables:
|
173
204
|
- bookshelf
|
174
205
|
extensions: []
|
206
|
+
|
175
207
|
extra_rdoc_files: []
|
176
|
-
|
208
|
+
|
209
|
+
files:
|
177
210
|
- .gitignore
|
178
211
|
- .gitmodules
|
179
212
|
- Gemfile
|
@@ -214,30 +247,36 @@ files:
|
|
214
247
|
- templates/helper.rb
|
215
248
|
- templates/html.scss
|
216
249
|
- templates/layout.erb
|
250
|
+
has_rdoc: true
|
217
251
|
homepage: https://bitbucket.org/bradcrawford/bookshelf
|
218
|
-
licenses:
|
252
|
+
licenses:
|
219
253
|
- MIT
|
220
254
|
post_install_message:
|
221
255
|
rdoc_options: []
|
222
|
-
|
256
|
+
|
257
|
+
require_paths:
|
223
258
|
- lib
|
224
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
259
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
260
|
+
requirements:
|
261
|
+
- - ">="
|
262
|
+
- !ruby/object:Gem::Version
|
263
|
+
segments:
|
264
|
+
- 1
|
265
|
+
- 9
|
266
|
+
version: "1.9"
|
267
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
268
|
+
requirements:
|
269
|
+
- - ">="
|
270
|
+
- !ruby/object:Gem::Version
|
271
|
+
segments:
|
272
|
+
- 0
|
273
|
+
version: "0"
|
236
274
|
requirements: []
|
275
|
+
|
237
276
|
rubyforge_project:
|
238
|
-
rubygems_version: 1.
|
277
|
+
rubygems_version: 1.3.6
|
239
278
|
signing_key:
|
240
279
|
specification_version: 3
|
241
|
-
summary: A framework that generates PDF and e-Pub from Markdown, Textile, and HTML
|
242
|
-
files.
|
280
|
+
summary: A framework that generates PDF and e-Pub from Markdown, Textile, and HTML files.
|
243
281
|
test_files: []
|
282
|
+
|