review 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +1 -0
- data/ChangeLog +100 -0
- data/README.rdoc +11 -12
- data/Rakefile +6 -2
- data/bin/review-check +1 -1
- data/bin/review-compile +13 -4
- data/bin/review-epubmaker +172 -24
- data/bin/review-epubmaker-ng +8 -161
- data/bin/review-index +1 -1
- data/bin/review-init +17 -5
- data/bin/review-pdfmaker +40 -19
- data/bin/review-preproc +1 -1
- data/bin/review-validate +2 -2
- data/bin/review-vol +1 -1
- data/debian/control +2 -2
- data/doc/format.rdoc +23 -6
- data/doc/format_idg.rdoc +3 -3
- data/doc/libepubmaker/config.yaml +163 -0
- data/doc/quickstart.rdoc +27 -27
- data/doc/sample.yaml +10 -5
- data/lib/epubmaker.rb +2 -5
- data/lib/epubmaker/content.rb +9 -6
- data/lib/epubmaker/epubv2.rb +233 -109
- data/lib/epubmaker/epubv3.rb +83 -119
- data/lib/epubmaker/producer.rb +50 -20
- data/lib/epubmaker/resource.rb +22 -8
- data/lib/review/book/base.rb +1 -0
- data/lib/review/book/chapter.rb +2 -2
- data/lib/review/book/compilable.rb +1 -1
- data/lib/review/book/index.rb +33 -27
- data/lib/review/book/parameters.rb +3 -2
- data/lib/review/book/part.rb +1 -1
- data/lib/review/builder.rb +10 -42
- data/lib/review/compiler.rb +1 -1
- data/lib/review/configure.rb +3 -3
- data/lib/review/epubmaker.rb +428 -0
- data/lib/review/htmlbuilder.rb +45 -95
- data/lib/review/htmlutils.rb +2 -0
- data/lib/review/i18n.yaml +25 -0
- data/lib/review/idgxmlbuilder.rb +11 -9
- data/lib/review/inaobuilder.rb +1 -1
- data/lib/review/latexbuilder.rb +7 -6
- data/lib/review/latexutils.rb +6 -0
- data/lib/review/makerhelper.rb +4 -2
- data/lib/review/markdownbuilder.rb +8 -0
- data/lib/review/sec_counter.rb +71 -0
- data/lib/review/topbuilder.rb +0 -1
- data/lib/review/version.rb +2 -2
- data/review.gemspec +4 -4
- data/test/sample-book/README.md +2 -2
- data/test/sample-book/src/Rakefile +2 -2
- data/test/sample-book/src/config.yml +4 -4
- data/test/sample-book/src/images/cover.jpg +0 -0
- data/test/sample-book/src/sty/{samplemacro.sty → reviewmacro.sty} +1 -1
- data/test/test_book_parameter.rb +1 -1
- data/test/test_epubmaker.rb +77 -15
- data/test/test_epubmaker_cmd.rb +11 -7
- data/test/test_helper.rb +7 -0
- data/test/test_htmlbuilder.rb +39 -6
- data/test/test_idgxmlbuilder.rb +14 -2
- data/test/test_inaobuilder.rb +2 -1
- data/test/test_latexbuilder.rb +23 -2
- data/test/test_makerhelper.rb +19 -3
- data/test/test_markdownbuilder.rb +35 -0
- data/test/test_pdfmaker_cmd.rb +11 -7
- data/test/test_topbuilder.rb +36 -2
- metadata +18 -18
- data/VERSION +0 -1
- data/doc/libepubmaker/sample.yaml +0 -90
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: be841a3905cc8d1771d130b04df3c067a748e15b
|
4
|
+
data.tar.gz: af6f9c3dc732bd39db56231dc5f996e796111f8a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f0f1b28e80f8f5fdf3ec468dc30b038cf7b931fd2c15efef6b2c6d381a49e44c8965bb577304e0e43804f44d12fec3fb8119ce689f85b217a067d47f7ac1806f
|
7
|
+
data.tar.gz: de7d44f7431871751a88e2b8d3e9e28c4ede8181aece50246c68af5a8049f095534248ce2ff110f2d97b3fe052f4f39a5c02caa2c03c4a0c6b5c1fc3635a192e
|
data/.travis.yml
CHANGED
data/ChangeLog
CHANGED
@@ -1,3 +1,103 @@
|
|
1
|
+
Wed Apr 2 22:34:56 2014 Masayoshi Takahashi <takahashimm@gmail.com>
|
2
|
+
|
3
|
+
* Release 1.2.0.
|
4
|
+
|
5
|
+
Tue Mar 25 19:11:36 2014 Kenshi Muto <kmuto@debian.org>
|
6
|
+
|
7
|
+
* lib/review/book/index.rb, bin/review-compile:
|
8
|
+
improve the image file finder.
|
9
|
+
Now review-compile finds a image file from:
|
10
|
+
1. <imgdir>/<builder>/<chapid>/<id>.<ext>
|
11
|
+
2. <imgdir>/<builder>/<chapid>-<id>.<ext>
|
12
|
+
3. <imgdir>/<builder>/<id>.<ext>
|
13
|
+
4. <imgdir>/<chapid>/<id>.<ext>
|
14
|
+
5. <imgdir>/<chapid>-<id>.<ext>
|
15
|
+
6. <imgdir>/<id>.<ext>
|
16
|
+
|
17
|
+
Sun Mar 23 23:54:27 2014 Kenshi Muto <kmuto@debian.org>
|
18
|
+
|
19
|
+
* doc/libepubmaker/config.yaml, lib/epubmaker/epubv2.rb,
|
20
|
+
lib/epubmaker/epubv3.rb, lib/epubmaker/poducer.rb,
|
21
|
+
test/test_epubmaker.rb: support both hierarchy toc and
|
22
|
+
flat toc.
|
23
|
+
|
24
|
+
Sun Mar 23 18:05:53 2014 Kenshi Muto <kmuto@debian.org>
|
25
|
+
|
26
|
+
* doc/libepubmaker/config.yaml, lib/epubmaker/epubv2.rb,
|
27
|
+
lib/epubmaker/epubv3.rb, lib/epubmaker/poducer.rb,
|
28
|
+
lib/review/epubmaker.rb: use <bookname>-toc.<htmlext> for
|
29
|
+
ePUB2 as same as ePUB3. dropped tocfile parameter.
|
30
|
+
Closes: #237
|
31
|
+
|
32
|
+
Tue Mar 18 18:37:12 2014 Kenshi Muto <kmuto@debian.org>
|
33
|
+
|
34
|
+
* doc/libepubmaker/config.yaml: add descriptions of some parameters.
|
35
|
+
|
36
|
+
Tue Mar 18 17:57:23 2014 Kenshi Muto <kmuto@debian.org>
|
37
|
+
|
38
|
+
* epubmaker/content.rb, epubmaker/producer.rb, epubmaker.rb:
|
39
|
+
add embeded font support. By default, review-epubmaker-ng
|
40
|
+
takes fonts/*.{otf|ttf|woff} and images/*.{otf|ttf|woff}.
|
41
|
+
You can change this behaviour by modifying image_ext, font_ext,
|
42
|
+
fontdir, and imagedir in config.yaml.
|
43
|
+
|
44
|
+
Thu Mar 13 11:34:15 2014 Kenshi Muto <kmuto@debian.org>
|
45
|
+
|
46
|
+
* lib/review/htmlutils.rb, lib/review/epubmaker.rb, test_htmlbuilder.rb: use pygments higlighting only if "pygments: true" is defined.
|
47
|
+
|
48
|
+
Thu Mar 13 09:52:50 2014 Kenshi Muto <kmuto@debian.org>
|
49
|
+
|
50
|
+
* epubmaker/epubv3.rb: <nav> needs own epub namespace. <nav> should use <ol>, not <ul>.
|
51
|
+
|
52
|
+
Thu Mar 13 00:36:58 2014 Kenshi Muto <kmuto@debian.org>
|
53
|
+
|
54
|
+
* lib/review/epubmaker.rb: remove unnecessary escape character for review-epubmaker-ng.
|
55
|
+
|
56
|
+
Wed Mar 12 20:14:22 2014 Kenshi Muto <kmuto@debian.org>
|
57
|
+
|
58
|
+
* epubmaker/epubv2.rb, epubmaker/producer.rb, review/epubmaker.rb:
|
59
|
+
- use system() instead of exec() for review-epubmaker-ng.
|
60
|
+
- hand over stylesheet values to review-compile in review-epubmaker-ng.
|
61
|
+
|
62
|
+
Wed Mar 12 20:03:12 2014 Masayoshi Takahashi <takahashimm@gmail.com>
|
63
|
+
|
64
|
+
* bin/review-pdfmaker: support LuaLaTeX.
|
65
|
+
|
66
|
+
Sat Mar 8 23:16:52 2014 Kenshi Muto <kmuto@debian.org>
|
67
|
+
|
68
|
+
* 'ReVIEW' has been renamed to 'Re:VIEW'.
|
69
|
+
|
70
|
+
Tue Oct 8 18:57:54 2013 Masayoshi Takahashi <takahashimm@gmail.com>
|
71
|
+
|
72
|
+
* lib/review/htmlbuilder.rb:
|
73
|
+
support epub:type="noteref" and epub:type="footnote" in EPUB3.
|
74
|
+
|
75
|
+
Tue Oct 8 13:47:01 2013 Masayoshi Takahashi <takahashimm@gmail.com>
|
76
|
+
|
77
|
+
* bin/review-epubmaker: support MathML in EPUB3
|
78
|
+
|
79
|
+
Mon Oct 7 22:37:38 2013 Kenshi Muto <kmuto@debian.org>
|
80
|
+
|
81
|
+
* lib/review/book/compilable.rb:
|
82
|
+
remove type and label from the extracted title.
|
83
|
+
|
84
|
+
* bin/review-epubmaker:
|
85
|
+
add prefix 'rv' to internal ID for each converted files.
|
86
|
+
Closes: #204
|
87
|
+
|
88
|
+
* lib/review/htmlbuilder.rb:
|
89
|
+
set 'noteref' style class for footnote referers.
|
90
|
+
Closes: #205
|
91
|
+
|
92
|
+
Tue Sep 17 09:25:20 2013 Kenshi Muto <kmuto@debian.org>
|
93
|
+
|
94
|
+
* lib/review/builder.rb, lib/review/topbuilder.rb:
|
95
|
+
force all builders to load compiler.rb.
|
96
|
+
|
97
|
+
Sun Sep 15 14:39:43 2013 Masayoshi Takahashi <takahashimm@gmail.com>
|
98
|
+
|
99
|
+
* bin/review-init: fix review-init; it's broken when installed as gem.
|
100
|
+
|
1
101
|
Thu Aug 29 21:33:19 2013 Masayoshi Takahashi <takahashimm@gmail.com>
|
2
102
|
|
3
103
|
* Version bump to 1.1.0.
|
data/README.rdoc
CHANGED
@@ -1,17 +1,20 @@
|
|
1
|
-
=
|
1
|
+
= Re:VIEW
|
2
2
|
|
3
|
-
|
3
|
+
{<img src="https://secure.travis-ci.org/kmuto/review.png"/>}[http://travis-ci.org/kmuto/review]
|
4
|
+
{<img src="https://badge.fury.io/rb/review.png" alt="Gem Version" />}[http://badge.fury.io/rb/review]
|
5
|
+
|
6
|
+
Re:VIEW is a easy-to-use digital publishing system for books and ebooks.
|
4
7
|
|
5
8
|
== Format
|
6
9
|
|
7
|
-
|
10
|
+
Re:VIEW uses its original format('Re:VIEW format') as source files. See doc/format.rdoc (in Japanese).
|
8
11
|
|
9
|
-
Output formats
|
12
|
+
Output formats Re:VIEW supports are:
|
10
13
|
|
11
14
|
* EPUB
|
12
15
|
* LaTeX(ptexlive)
|
13
16
|
* InDesign(IDGXML)
|
14
|
-
* plain text(TOPBuilder Markup
|
17
|
+
* plain text(TOPBuilder Text Markup Language)
|
15
18
|
* Inao(gihyo.jp original markup)
|
16
19
|
|
17
20
|
== Commands
|
@@ -23,8 +26,8 @@ There are two commands generate files directly.
|
|
23
26
|
|
24
27
|
And some useful commands.
|
25
28
|
|
26
|
-
* review-compile: compile
|
27
|
-
* review-vol: figure out size of
|
29
|
+
* review-compile: compile Re:VIEW fomat files.
|
30
|
+
* review-vol: figure out size of Re:VIEW files.
|
28
31
|
* review-index: generate index with various format.
|
29
32
|
* review-preproc: preprocessor.
|
30
33
|
|
@@ -38,14 +41,10 @@ And some useful commands.
|
|
38
41
|
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
39
42
|
* Send me a pull request. Bonus points for topic branches.
|
40
43
|
|
41
|
-
== Build status
|
42
|
-
|
43
|
-
* {<img src="https://secure.travis-ci.org/kmuto/review.png"/>}[http://travis-ci.org/kmuto/review]
|
44
|
-
|
45
44
|
== License
|
46
45
|
|
47
46
|
LGPL. See COPYING file.
|
48
47
|
|
49
48
|
== Copyright
|
50
49
|
|
51
|
-
Copyright (c) 2006-
|
50
|
+
Copyright (c) 2006-2014 Minero Aoki, Kenshi Muto, Masayoshi Takahashi.
|
data/Rakefile
CHANGED
data/bin/review-check
CHANGED
data/bin/review-compile
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
#
|
3
3
|
# $Id: review-compile 4326 2010-01-12 14:10:17Z kmuto $
|
4
4
|
#
|
5
|
+
# Copyright (c) 2008-2014 Kenshi Muto, Masayoshi Takahashi, KADO Masanori, Minero Aoki
|
5
6
|
# Copyright (c) 1999-2007 Minero Aoki
|
6
7
|
#
|
7
8
|
# This program is free software.
|
@@ -52,8 +53,6 @@ def _main
|
|
52
53
|
"structuredxml" => nil, # for IDGXML
|
53
54
|
"inencoding" => "UTF-8",
|
54
55
|
"outencoding" => "UTF-8",
|
55
|
-
"subdirmode" => nil,
|
56
|
-
"singledirmode" => nil,
|
57
56
|
"stylesheet" => [], # for HTML
|
58
57
|
"mathml" => nil, # for HTML
|
59
58
|
"language" => "ja", # for HTML
|
@@ -79,18 +78,27 @@ def _main
|
|
79
78
|
parser.on('--table=WIDTH', 'Default table width. (idgxml)') {|tbl| param["tableopt"] = tbl }
|
80
79
|
parser.on('--listinfo', 'Append listinfo tag to lists to indicate begin/end. (idgxml)') { param["listinfo"] = true }
|
81
80
|
parser.on('--chapref="before,middle,after"', 'Chapref decoration.') {|cdec| param["chapref"] = cdec }
|
82
|
-
parser.on('--subdirmode', 'Use chapter/id.ext path style to find images.')
|
83
|
-
|
81
|
+
parser.on('--subdirmode', 'Use chapter/id.ext path style to find images. (deprecated)') do
|
82
|
+
STDERR.puts "Warning: --subdirmode is deprecated. Images are automatically detected."
|
83
|
+
end
|
84
|
+
parser.on('--singledirmode', 'Use id.ext path style to find images. (deprecated)') do
|
85
|
+
STDERR.puts "Warning: --singledirmode is deprecated. Images are automatically detected."
|
86
|
+
end
|
84
87
|
parser.on('--chapterlink', 'make chapref hyperlink') { param["chapterlink"] = true }
|
85
88
|
parser.on('--stylesheet=file', 'Stylesheet file for HTML (comma separated)') {|files| param["stylesheet"] = files.split(/\s*,\s*/) }
|
86
89
|
parser.on('--mathml', 'Use MathML for TeX equation in HTML') do
|
87
90
|
param["mathml"] = true
|
88
91
|
require 'math_ml'
|
92
|
+
require "math_ml/symbol/character_reference"
|
89
93
|
end
|
90
94
|
parser.on('--htmlversion=VERSION', 'HTML version.') do |v|
|
91
95
|
v = v.to_i
|
92
96
|
param["htmlversion"] = v if v == 4 || v == 5
|
93
97
|
end
|
98
|
+
parser.on('--epubversion=VERSION', 'EPUB version.') do |v|
|
99
|
+
v = v.to_i
|
100
|
+
param["epubversion"] = v if v == 2 || v == 3
|
101
|
+
end
|
94
102
|
parser.on('--hdnumberingmode', 'Output numbering headlines. (deprecated)') { param["hdnumberingmode"] = true }
|
95
103
|
parser.on('--deprecated-blocklines', 'Disable paragrahs in block tags. Treat physical line as a paragraph. (deprecated)') { param["deprecated-blocklines"] = true }
|
96
104
|
parser.on('--target=FMT', 'Target format.') {|fmt| target = fmt } unless target
|
@@ -132,6 +140,7 @@ def _main
|
|
132
140
|
|
133
141
|
begin
|
134
142
|
ReVIEW.book.param = param
|
143
|
+
ReVIEW.book.param["builder"] = target
|
135
144
|
compiler = ReVIEW::Compiler.new(load_strategy_class(target, check_only))
|
136
145
|
case mode
|
137
146
|
when :files
|
data/bin/review-epubmaker
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# encoding: utf-8
|
3
3
|
#
|
4
|
-
# Copyright (c) 2010 Kenshi Muto and Masayoshi Takahashi
|
4
|
+
# Copyright (c) 2010-2014 Kenshi Muto and Masayoshi Takahashi
|
5
5
|
#
|
6
6
|
# This program is free software.
|
7
7
|
# You can distribute or modify this program under the terms of
|
@@ -83,12 +83,12 @@ def main
|
|
83
83
|
else
|
84
84
|
htmlfile = "part_#{part.number}.html"
|
85
85
|
make_part_page(part, htmlfile, values)
|
86
|
+
file_id = "part_#{part.number}"
|
87
|
+
part_name = "#{ReVIEW::I18n.t("part", part.number)} #{part.name.strip}"
|
88
|
+
@tocdesc << [1, htmlfile, nil, part_name]
|
89
|
+
@manifeststr << %Q(<item id="rv-#{file_id}" href="#{htmlfile}" media-type="application/xhtml+xml" />\n)
|
90
|
+
@ncxstr << %Q(<itemref idref="rv-#{file_id}" />\n)
|
86
91
|
end
|
87
|
-
file_id = "part_#{part.number}"
|
88
|
-
part_name = "#{ReVIEW::I18n.t("part", part.number)} #{part.name.strip}"
|
89
|
-
@tocdesc << [1, htmlfile, nil, part_name]
|
90
|
-
@manifeststr << %Q(<item id="#{file_id}" href="#{htmlfile}" media-type="application/xhtml+xml" />\n)
|
91
|
-
@ncxstr << %Q(<itemref idref="#{file_id}" />\n)
|
92
92
|
end
|
93
93
|
|
94
94
|
part.chapters.each do |chap|
|
@@ -97,16 +97,19 @@ def main
|
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
|
+
# images
|
100
101
|
if File.exist?("images")
|
102
|
+
allow_exts = values["image_ext"] || %w(png gif jpg jpeg svg ttf woff otf)
|
101
103
|
Dir.mkdir("#{@bookdir}/OEBPS/images")
|
102
|
-
image_files = ReVIEW::MakerHelper.copy_images_to_dir("images", "#{@bookdir}/OEBPS/images")
|
104
|
+
image_files = ReVIEW::MakerHelper.copy_images_to_dir("images", "#{@bookdir}/OEBPS/images", :exts=>allow_exts)
|
103
105
|
image_files.each do |image_file|
|
104
106
|
dirname = File.dirname(image_file)
|
105
107
|
fname = File.basename(image_file)
|
106
108
|
figid = getFigId(dirname.gsub(%r|/|,'-')+"-"+fname)
|
107
109
|
mime = nil
|
108
|
-
|
109
|
-
|
110
|
+
fname_pattern = /\.(#{allow_exts.join("|")})$/i
|
111
|
+
next unless fname =~ fname_pattern
|
112
|
+
case fname.downcase.match(fname_pattern)[1]
|
110
113
|
when "png"
|
111
114
|
mime = "image/png"
|
112
115
|
when "gif"
|
@@ -115,10 +118,44 @@ def main
|
|
115
118
|
mime = "image/jpeg"
|
116
119
|
when "svg"
|
117
120
|
mime = "image/svg+xml"
|
121
|
+
when "ttf", "otf"
|
122
|
+
mime = "application/vnd.ms-opentype"
|
123
|
+
when "woff"
|
124
|
+
mime = "application/font-woff"
|
118
125
|
else
|
119
126
|
raise "unsupported type #{fname}"
|
120
127
|
end
|
121
|
-
@
|
128
|
+
if @epubversion == 3 && File.join("images",values["coverimage"]) == image_file
|
129
|
+
properties = ' properties="cover-image"'
|
130
|
+
end
|
131
|
+
@manifeststr << %Q(<item id="#{figid}" href="#{image_file}"#{properties} media-type="#{mime}" />\n)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
# fonts
|
136
|
+
fontdir = values["fontdir"] || "fonts"
|
137
|
+
if File.exist?(fontdir)
|
138
|
+
font_ext = values["font_ext"]
|
139
|
+
Dir.mkdir("#{@bookdir}/OEBPS/#{fontdir}")
|
140
|
+
font_files = ReVIEW::MakerHelper.copy_images_to_dir(fontdir, "#{@bookdir}/OEBPS/#{fontdir}", :exts=>font_ext)
|
141
|
+
font_files.each do |font_file|
|
142
|
+
dirname = File.dirname(font_file)
|
143
|
+
fname = File.basename(font_file)
|
144
|
+
font_id = "font-"+fname
|
145
|
+
mime = nil
|
146
|
+
fname_pattern = /\.(#{font_ext.join("|")})$/i
|
147
|
+
next unless fname =~ fname_pattern
|
148
|
+
case fname.downcase.match(fname_pattern)[1]
|
149
|
+
when "svg"
|
150
|
+
mime = "image/svg+xml"
|
151
|
+
when "ttf", "otf"
|
152
|
+
mime = "application/vnd.ms-opentype"
|
153
|
+
when "woff"
|
154
|
+
mime = "application/font-woff"
|
155
|
+
else
|
156
|
+
raise "unsupported type #{fname}"
|
157
|
+
end
|
158
|
+
@manifeststr << %Q(<item id="#{font_id}" href="#{font_file}" media-type="#{mime}" />\n)
|
122
159
|
end
|
123
160
|
end
|
124
161
|
|
@@ -225,13 +262,13 @@ EOT
|
|
225
262
|
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
226
263
|
<meta http-equiv="Content-Style-Type" content="text/css"/>
|
227
264
|
<link rel="stylesheet" type="text/css" href="#{values["stylesheet"]}"/>
|
228
|
-
<meta name="generator" content="
|
265
|
+
<meta name="generator" content="Re:VIEW EPUB Maker"/>
|
229
266
|
EOT
|
230
267
|
else
|
231
268
|
f.puts <<EOT
|
232
269
|
<meta charset="UTF-8" />
|
233
270
|
<link rel="stylesheet" type="text/css" href="#{values["stylesheet"]}"/>
|
234
|
-
<meta name="generator" content="
|
271
|
+
<meta name="generator" content="Re:VIEW EPUB Maker"/>
|
235
272
|
EOT
|
236
273
|
end
|
237
274
|
f.puts <<EOT
|
@@ -257,6 +294,9 @@ EOT
|
|
257
294
|
EOT
|
258
295
|
}
|
259
296
|
|
297
|
+
if values["backcoverfile"]
|
298
|
+
make_backcover_image(bookname, values)
|
299
|
+
end
|
260
300
|
|
261
301
|
# Title page
|
262
302
|
File.open("#{@bookdir}/OEBPS/top.html", "w") {|f|
|
@@ -274,13 +314,13 @@ EOT
|
|
274
314
|
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
275
315
|
<meta http-equiv="Content-Style-Type" content="text/css"/>
|
276
316
|
<link rel="stylesheet" type="text/css" href="#{values["stylesheet"]}"/>
|
277
|
-
<meta name="generator" content="
|
317
|
+
<meta name="generator" content="Re:VIEW EPUB Maker"/>
|
278
318
|
EOT
|
279
319
|
else
|
280
320
|
f.puts <<EOT
|
281
321
|
<meta charset="UTF-8" />
|
282
322
|
<link rel="stylesheet" type="text/css" href="#{values["stylesheet"]}"/>
|
283
|
-
<meta name="generator" content="
|
323
|
+
<meta name="generator" content="Re:VIEW EPUB Maker"/>
|
284
324
|
EOT
|
285
325
|
end
|
286
326
|
f.puts <<EOT
|
@@ -348,13 +388,13 @@ EOT
|
|
348
388
|
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
349
389
|
<meta http-equiv="Content-Style-Type" content="text/css"/>
|
350
390
|
<link rel="stylesheet" type="text/css" href="#{values["stylesheet"]}"/>
|
351
|
-
<meta name="generator" content="
|
391
|
+
<meta name="generator" content="Re:VIEW EPUB Maker"/>
|
352
392
|
EOT
|
353
393
|
else
|
354
394
|
f.puts <<EOT
|
355
395
|
<meta charset="UTF-8" />
|
356
396
|
<link rel="stylesheet" type="text/css" href="#{values["stylesheet"]}"/>
|
357
|
-
<meta name="generator" content="
|
397
|
+
<meta name="generator" content="Re:VIEW EPUB Maker"/>
|
358
398
|
EOT
|
359
399
|
end
|
360
400
|
f.puts <<EOT
|
@@ -398,7 +438,7 @@ EOT
|
|
398
438
|
f.puts "</li>"
|
399
439
|
end
|
400
440
|
fragment_id = (id ? '#'+id : '')
|
401
|
-
f.write "<li><a href=\"#{file}#{fragment_id}\">#{content}</a>"
|
441
|
+
f.write "<li><a href=\"#{file}#{fragment_id}\">#{strip_html(content)}</a>"
|
402
442
|
init_item = false
|
403
443
|
}
|
404
444
|
|
@@ -536,6 +576,11 @@ EOT
|
|
536
576
|
<item id="colophon" href="colophon.html" media-type="application/xhtml+xml" />
|
537
577
|
EOT
|
538
578
|
end
|
579
|
+
if values["backcoverfile"]
|
580
|
+
f.puts <<EOT
|
581
|
+
<item id="backcover" href="#{values["backcoverfile"]}" media-type="application/xhtml+xml" />
|
582
|
+
EOT
|
583
|
+
end
|
539
584
|
|
540
585
|
if values["cover_linear"] && values["cover_linear"] != "no"
|
541
586
|
cover_linear = "yes"
|
@@ -560,6 +605,11 @@ EOT
|
|
560
605
|
if values["colophon"]
|
561
606
|
f.puts <<EOT
|
562
607
|
<itemref idref="colophon" />
|
608
|
+
EOT
|
609
|
+
end
|
610
|
+
if values["backcoverfile"]
|
611
|
+
f.puts <<EOT
|
612
|
+
<itemref idref="backcover" />
|
563
613
|
EOT
|
564
614
|
end
|
565
615
|
f.puts <<EOT
|
@@ -646,6 +696,12 @@ EOT
|
|
646
696
|
EOT
|
647
697
|
end
|
648
698
|
|
699
|
+
if values["backcoverfile"]
|
700
|
+
f.puts <<EOT
|
701
|
+
<item id="backcover" href="#{values["backcoverfile"]}" media-type="application/xhtml+xml" />
|
702
|
+
EOT
|
703
|
+
end
|
704
|
+
|
649
705
|
if values["cover_linear"] && values["cover_linear"] != "no"
|
650
706
|
cover_linear = "yes"
|
651
707
|
else
|
@@ -669,6 +725,11 @@ EOT
|
|
669
725
|
if values["colophon"]
|
670
726
|
f.puts <<EOT
|
671
727
|
<itemref idref="colophon" />
|
728
|
+
EOT
|
729
|
+
end
|
730
|
+
if values["backcoverfile"]
|
731
|
+
f.puts <<EOT
|
732
|
+
<itemref idref="backcover" />
|
672
733
|
EOT
|
673
734
|
end
|
674
735
|
f.puts <<EOT
|
@@ -718,12 +779,27 @@ def output_chaps_by_file(l, values)
|
|
718
779
|
filename = "#{file_id}.html"
|
719
780
|
fork {
|
720
781
|
STDOUT.reopen("#{@bookdir}/OEBPS/#{filename}")
|
721
|
-
exec("review-compile --target=html --level=#{values["secnolevel"]} --htmlversion=#{values["htmlversion"]} #{values["params"]} #{l}")
|
782
|
+
exec("review-compile --target=html --level=#{values["secnolevel"]} --htmlversion=#{values["htmlversion"]} --epubversion=#{values["epubversion"]} #{values["params"]} #{l}")
|
722
783
|
}
|
723
784
|
Process.waitall
|
724
785
|
getanchors("#{@bookdir}/OEBPS/#{filename}")
|
725
|
-
@
|
726
|
-
|
786
|
+
if @epubversion == 3 && include_mathml?("#{@bookdir}/OEBPS/#{filename}")
|
787
|
+
@manifeststr << %Q(<item id="rv-#{file_id}" href="#{filename}" properties="mathml" media-type="application/xhtml+xml" />\n)
|
788
|
+
else
|
789
|
+
@manifeststr << %Q(<item id="rv-#{file_id}" href="#{filename}" media-type="application/xhtml+xml" />\n)
|
790
|
+
end
|
791
|
+
@ncxstr << %Q(<itemref idref="rv-#{file_id}" />\n)
|
792
|
+
end
|
793
|
+
|
794
|
+
def include_mathml?(filename)
|
795
|
+
File.open(filename) {|f|
|
796
|
+
REXML::Document.new(f).each_element("//math"){
|
797
|
+
return true
|
798
|
+
}
|
799
|
+
return false
|
800
|
+
}
|
801
|
+
rescue
|
802
|
+
false
|
727
803
|
end
|
728
804
|
|
729
805
|
def getFigId(filename)
|
@@ -764,13 +840,13 @@ EOT
|
|
764
840
|
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
765
841
|
<meta http-equiv="Content-Style-Type" content="text/css"/>
|
766
842
|
<link rel="stylesheet" type="text/css" href="#{values["stylesheet"]}"/>
|
767
|
-
<meta name="generator" content="
|
843
|
+
<meta name="generator" content="Re:VIEW EPUB Maker"/>
|
768
844
|
EOT
|
769
845
|
else
|
770
846
|
header += <<EOT
|
771
847
|
<meta charset="UTF-8" />
|
772
848
|
<link rel="stylesheet" type="text/css" href="#{values["stylesheet"]}"/>
|
773
|
-
<meta name="generator" content="
|
849
|
+
<meta name="generator" content="Re:VIEW EPUB Maker"/>
|
774
850
|
EOT
|
775
851
|
end
|
776
852
|
header += <<EOT
|
@@ -811,9 +887,11 @@ EOT
|
|
811
887
|
<table>
|
812
888
|
EOT
|
813
889
|
f.puts %Q[<tr>\n <th>著 者</th><td>#{values["aut"]}</td>\n</tr>] if values["aut"]
|
890
|
+
f.puts %Q[<tr>\n <th>監 修</th><td>#{values["csl"]}</td>\n</tr>] if values["csl"]
|
814
891
|
f.puts %Q[<tr>\n <th>翻 訳</th><td>#{values["trl"]}</td>\n</tr>] if values["trl"]
|
815
892
|
f.puts %Q[<tr>\n <th>デザイン</th><td>#{values["dsr"]}</td>\n</tr>] if values["dsr"]
|
816
893
|
f.puts %Q[<tr>\n <th>イラスト</th><td>#{values["ill"]}</td>\n</tr>] if values["ill"]
|
894
|
+
f.puts %Q[<tr>\n <th>表 紙</th><td>#{values["cov"]}</td>\n</tr>] if values["cov"]
|
817
895
|
f.puts %Q[<tr>\n <th>編 集</th><td>#{values["edt"]}</td>\n</tr>] if values["edt"]
|
818
896
|
f.puts %Q[<tr>\n <th>発行所</th><td>#{values["prt"]}</td>\n</tr>] if values["prt"]
|
819
897
|
f.puts <<EOT
|
@@ -836,15 +914,31 @@ def make_part_page(part, filename, values)
|
|
836
914
|
EOT
|
837
915
|
doctype = make_doctype()
|
838
916
|
f.puts doctype
|
839
|
-
|
917
|
+
if @htmlversion == 4
|
918
|
+
header = <<-EOT
|
840
919
|
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ops="http://www.idpf.org/2007/ops" xmlns:epub="http://www.idpf.org/2007/ops" xml:lang="ja">
|
841
920
|
<head>
|
842
921
|
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
843
922
|
<meta http-equiv="Content-Style-Type" content="text/css"/>
|
844
923
|
<link rel="stylesheet" type="text/css" href="#{values["stylesheet"]}"/>
|
845
|
-
<meta name="generator" content="
|
924
|
+
<meta name="generator" content="Re:VIEW EPUB Maker"/>
|
925
|
+
<title>#{values["booktitle"]}</title>
|
926
|
+
</head>
|
927
|
+
EOT
|
928
|
+
else
|
929
|
+
header = <<-EOT
|
930
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ops="http://www.idpf.org/2007/ops" xmlns:epub="http://www.idpf.org/2007/ops" xml:lang="ja">
|
931
|
+
<head>
|
932
|
+
<meta charset="UTF-8" />
|
933
|
+
<link rel="stylesheet" type="text/css" href="#{values["stylesheet"]}"/>
|
934
|
+
<meta name="generator" content="Re:VIEW EPUB Maker"/>
|
846
935
|
<title>#{values["booktitle"]}</title>
|
847
936
|
</head>
|
937
|
+
EOT
|
938
|
+
end
|
939
|
+
f.puts header
|
940
|
+
|
941
|
+
f.puts <<-EOT
|
848
942
|
<body>
|
849
943
|
<h1 class="part-number">#{ReVIEW::I18n.t("part", part.number)}</h1>
|
850
944
|
EOT
|
@@ -862,5 +956,59 @@ def make_part_page(part, filename, values)
|
|
862
956
|
}
|
863
957
|
end
|
864
958
|
|
959
|
+
def make_backcover_image(bookname, values)
|
960
|
+
backcoverfile = values["backcoverfile"]
|
961
|
+
File.open("#{@bookdir}/OEBPS/#{backcoverfile}", "w") {|f|
|
962
|
+
f.puts <<EOT
|
963
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
964
|
+
EOT
|
965
|
+
doctype = make_doctype()
|
966
|
+
f.puts doctype
|
967
|
+
f.puts <<EOT
|
968
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ops="http://www.idpf.org/2007/ops" xmlns:epub="http://www.idpf.org/2007/ops" xml:lang="ja">
|
969
|
+
<head>
|
970
|
+
EOT
|
971
|
+
if @htmlversion == 4
|
972
|
+
f.puts <<EOT
|
973
|
+
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
974
|
+
<meta http-equiv="Content-Style-Type" content="text/css"/>
|
975
|
+
<link rel="stylesheet" type="text/css" href="#{values["stylesheet"]}"/>
|
976
|
+
<meta name="generator" content="Re:VIEW EPUB Maker"/>
|
977
|
+
EOT
|
978
|
+
else
|
979
|
+
f.puts <<EOT
|
980
|
+
<meta charset="UTF-8" />
|
981
|
+
<link rel="stylesheet" type="text/css" href="#{values["stylesheet"]}"/>
|
982
|
+
<meta name="generator" content="Re:VIEW EPUB Maker"/>
|
983
|
+
EOT
|
984
|
+
end
|
985
|
+
f.puts <<EOT
|
986
|
+
<title>#{values["booktitle"]}</title>
|
987
|
+
</head>
|
988
|
+
<body>
|
989
|
+
EOT
|
990
|
+
if File.exist?(backcoverfile)
|
991
|
+
File.open(backcoverfile) {|f2|
|
992
|
+
f2.each_line {|l|
|
993
|
+
f.puts l
|
994
|
+
}
|
995
|
+
}
|
996
|
+
else
|
997
|
+
f.puts <<EOT
|
998
|
+
<div id="back-cover-image" class="full">
|
999
|
+
<img src="images/#{backcoverfile}" alt="back-cover"/>
|
1000
|
+
</div>
|
1001
|
+
EOT
|
1002
|
+
end
|
1003
|
+
|
1004
|
+
f.puts <<EOT
|
1005
|
+
</body>
|
1006
|
+
</html>
|
1007
|
+
EOT
|
1008
|
+
}
|
1009
|
+
end
|
1010
|
+
|
1011
|
+
|
1012
|
+
|
865
1013
|
|
866
1014
|
main
|