lknovel 0.0.4 → 0.0.5
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
CHANGED
data/lib/lknovel/app.rb
CHANGED
@@ -119,10 +119,12 @@ module Lknovel
|
|
119
119
|
contributor volume.illustrator, 'ill'
|
120
120
|
|
121
121
|
resources(:workdir => volume.path) {
|
122
|
-
cover_image File.join(IMAGE_DIR, volume.cover_image)
|
122
|
+
cover_image = File.join(IMAGE_DIR, volume.cover_image)
|
123
|
+
cover_image cover_image
|
123
124
|
file \
|
124
125
|
"#{STYLESHEET_DIR}/default.css" => "#{STYLESHEET_PATH}/default.css"
|
125
|
-
glob
|
126
|
+
images = Dir.glob("#{IMAGE_DIR}/*").select {|x| x != cover_image}
|
127
|
+
files *images
|
126
128
|
ordered {
|
127
129
|
nav "#{HTML_DIR}/front.html"
|
128
130
|
volume.chapters.each_with_index do |chapter, index|
|
data/lib/lknovel/meta.rb
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!DOCTYPE html
|
2
|
+
<!DOCTYPE html>
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh">
|
4
4
|
<head>
|
5
|
-
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
|
6
5
|
<link href="<%= "../#{Lknovel::STYLESHEET_DIR}/default.css" %>" rel="stylesheet" type="text/css"/>
|
7
6
|
<title><%= @title %></title>
|
8
7
|
</head>
|
@@ -10,7 +9,7 @@
|
|
10
9
|
<h1><%= @title %></h1>
|
11
10
|
<% @content.each do |item| -%>
|
12
11
|
<% if item.is_a?(Lknovel::Image) -%>
|
13
|
-
<img src="<%= "../#{Lknovel::IMAGE_DIR}/#{item.file}" %>"
|
12
|
+
<img src="<%= "../#{Lknovel::IMAGE_DIR}/#{item.file}" %>"/>
|
14
13
|
<% else -%>
|
15
14
|
<p><%= item %></p>
|
16
15
|
<% end -%>
|
@@ -1,21 +1,20 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
|
3
3
|
<head>
|
4
|
-
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
|
5
4
|
<link href="<%= "../#{Lknovel::STYLESHEET_DIR}/default.css" %>" rel="stylesheet" type="text/css"/>
|
6
5
|
</head>
|
7
6
|
<body>
|
8
7
|
<% if @cover_image -%>
|
9
|
-
<img class="page-break" src="<%= "../#{Lknovel::IMAGE_DIR}/#{@cover_image}" %>"
|
8
|
+
<img class="page-break" src="<%= "../#{Lknovel::IMAGE_DIR}/#{@cover_image}" %>"/>
|
10
9
|
<% end -%>
|
11
10
|
<h1>简介</h1>
|
12
11
|
<p><%= @intro %></p>
|
13
12
|
<nav epub:type="toc" id="toc">
|
14
|
-
<
|
13
|
+
<ol class="nav">
|
15
14
|
<% @chapters.each_with_index do |chapter, index| -%>
|
16
15
|
<li><a href="<%= Lknovel::HTML_FILE_FORMAT % index %>"><%= chapter.title %></a></li>
|
17
16
|
<% end -%>
|
18
|
-
</
|
17
|
+
</ol>
|
19
18
|
</nav>
|
20
19
|
</body>
|
21
20
|
</html>
|