bookshelf 1.2.0 → 1.2.1
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/lib/bookshelf/generator.rb +1 -9
- data/lib/bookshelf/parser.rb +1 -1
- data/lib/bookshelf/parser/epub.rb +3 -2
- data/lib/bookshelf/version.rb +1 -1
- data/templates/cover.erb +5 -6
- data/templates/epub.erb +5 -5
- metadata +2 -2
data/lib/bookshelf/generator.rb
CHANGED
@@ -43,26 +43,18 @@ 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"
|
50
46
|
empty_directory "text"
|
51
47
|
end
|
52
48
|
|
53
49
|
def create_git_files
|
54
50
|
create_file ".gitignore" do
|
55
|
-
"output
|
51
|
+
"output\n.sass-cache"
|
56
52
|
end
|
57
53
|
create_file "assets/.gitkeep"
|
58
54
|
create_file "assets/fonts/.gitkeep"
|
59
55
|
create_file "assets/images/.gitkeep"
|
60
56
|
create_file "assets/styles/.gitkeep"
|
61
57
|
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"
|
66
58
|
create_file "text/.gitkeep"
|
67
59
|
end
|
68
60
|
end
|
data/lib/bookshelf/parser.rb
CHANGED
@@ -102,8 +102,9 @@ module Bookshelf
|
|
102
102
|
|
103
103
|
def assets
|
104
104
|
@assets ||= begin
|
105
|
-
assets = Dir[Bookshelf.root_dir.join("
|
106
|
-
assets += Dir[Bookshelf.root_dir.join("assets/
|
105
|
+
assets = Dir[Bookshelf.root_dir.join("output/assets/styles/epub.css")].map{|path| {path => "styles"}}
|
106
|
+
assets += Dir[Bookshelf.root_dir.join("output/assets/fonts/*.*")].map{|path| {path => "fonts"}}
|
107
|
+
assets += Dir[Bookshelf.root_dir.join("output/assets/images/*.{jpg,png,gif}")].map{|path| {path => "images"}}
|
107
108
|
assets
|
108
109
|
end
|
109
110
|
end
|
data/lib/bookshelf/version.rb
CHANGED
data/templates/cover.erb
CHANGED
@@ -2,14 +2,13 @@
|
|
2
2
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= language %>">
|
4
4
|
<head>
|
5
|
-
<title
|
6
|
-
<
|
7
|
-
<
|
5
|
+
<title><%= title %></title>
|
6
|
+
<link rel="stylesheet" href="styles/epub.css" type="text/css" />
|
7
|
+
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
|
8
8
|
</head>
|
9
|
-
|
10
9
|
<body>
|
11
|
-
<div
|
12
|
-
|
10
|
+
<div>
|
11
|
+
<h1><%= title %></h1>
|
13
12
|
</div>
|
14
13
|
</body>
|
15
14
|
</html>
|
data/templates/epub.erb
CHANGED
@@ -2,13 +2,13 @@
|
|
2
2
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= language %>">
|
4
4
|
<head>
|
5
|
-
<title
|
6
|
-
<
|
7
|
-
<
|
5
|
+
<title></title>
|
6
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
7
|
+
<link rel="stylesheet" type="text/css" href="assets/styles/epub.css"/>
|
8
8
|
</head>
|
9
9
|
<body>
|
10
|
-
<div>
|
11
|
-
|
10
|
+
<div class="chapter">
|
11
|
+
<%= content %>
|
12
12
|
</div>
|
13
13
|
</body>
|
14
14
|
</html>
|