lknovel 0.0.2 → 0.0.3
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/CHANGELOG +1 -0
- data/lib/lknovel/app.rb +11 -11
- data/lib/lknovel/assets/stylesheets/default.css +4 -0
- data/lib/lknovel/meta.rb +1 -1
- metadata +1 -1
data/CHANGELOG
CHANGED
data/lib/lknovel/app.rb
CHANGED
@@ -70,17 +70,6 @@ module Lknovel
|
|
70
70
|
|
71
71
|
FileUtils.mkdir_p(volume.path)
|
72
72
|
Dir.chdir(volume.path) do
|
73
|
-
# generate html
|
74
|
-
FileUtils.mkdir_p(HTML_DIR)
|
75
|
-
Dir.chdir(HTML_DIR) do
|
76
|
-
volume.render(File.join(TEMPLATE_PATH, 'front.html.erb'), 'front.html')
|
77
|
-
erb = File.read(File.join(TEMPLATE_PATH, 'chapter.html.erb'))
|
78
|
-
template = ERB.new(erb, nil, '-')
|
79
|
-
volume.chapters.each_with_index do |chapter, index|
|
80
|
-
chapter.render(template, HTML_FILE_FORMAT % index)
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
73
|
# download images
|
85
74
|
FileUtils.mkdir_p(IMAGE_DIR)
|
86
75
|
Dir.chdir(IMAGE_DIR) do
|
@@ -105,6 +94,17 @@ module Lknovel
|
|
105
94
|
volume.cover_image = cropped ? 'cover.jpg' : cover_image.file
|
106
95
|
end
|
107
96
|
end
|
97
|
+
|
98
|
+
# generate html
|
99
|
+
FileUtils.mkdir_p(HTML_DIR)
|
100
|
+
Dir.chdir(HTML_DIR) do
|
101
|
+
volume.render(File.join(TEMPLATE_PATH, 'front.html.erb'), 'front.html')
|
102
|
+
erb = File.read(File.join(TEMPLATE_PATH, 'chapter.html.erb'))
|
103
|
+
template = ERB.new(erb, nil, '-')
|
104
|
+
volume.chapters.each_with_index do |chapter, index|
|
105
|
+
chapter.render(template, HTML_FILE_FORMAT % index)
|
106
|
+
end
|
107
|
+
end
|
108
108
|
end
|
109
109
|
|
110
110
|
builder = GEPUB::Builder.new {
|
data/lib/lknovel/meta.rb
CHANGED