review 1.2.0 → 1.3.0
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.
- checksums.yaml +4 -4
- data/.gitignore +36 -0
- data/.rubocop.yml +1 -0
- data/ChangeLog +102 -0
- data/README.rdoc +2 -2
- data/bin/review-check +18 -16
- data/bin/review-compile +49 -42
- data/bin/review-epubmaker +23 -993
- data/bin/review-epubmaker-legacy +1024 -0
- data/bin/review-index +17 -15
- data/bin/review-init +39 -9
- data/bin/review-pdfmaker +124 -89
- data/bin/review-preproc +16 -14
- data/bin/review-vol +17 -15
- data/debian/docs +1 -1
- data/doc/catalog.rdoc +34 -0
- data/doc/format.rdoc +16 -2
- data/doc/libepubmaker/{config.yaml → config.yml} +63 -19
- data/doc/quickstart.rdoc +1 -1
- data/doc/{sample.yaml → sample.yml} +0 -0
- data/lib/epubmaker.rb +1 -1
- data/lib/epubmaker/content.rb +9 -1
- data/lib/epubmaker/epubv2.rb +59 -7
- data/lib/epubmaker/epubv3.rb +14 -9
- data/lib/epubmaker/producer.rb +68 -27
- data/lib/epubmaker/resource.rb +3 -1
- data/lib/lineinput.rb +2 -2
- data/lib/review/book/base.rb +125 -24
- data/lib/review/book/chapter.rb +42 -0
- data/lib/review/book/compilable.rb +23 -4
- data/lib/review/book/image_finder.rb +64 -0
- data/lib/review/book/index.rb +64 -50
- data/lib/review/book/page_metric.rb +1 -1
- data/lib/review/builder.rb +19 -12
- data/lib/review/catalog.rb +47 -0
- data/lib/review/compiler.rb +3 -2
- data/lib/review/configure.rb +5 -3
- data/lib/review/epubmaker.rb +130 -46
- data/lib/review/ewbbuilder.rb +27 -31
- data/lib/review/extentions/string.rb +4 -4
- data/lib/review/htmlbuilder.rb +140 -79
- data/lib/review/htmllayout.rb +26 -4
- data/lib/review/htmlutils.rb +20 -1
- data/lib/review/i18n.rb +5 -2
- data/lib/review/{i18n.yaml → i18n.yml} +4 -2
- data/lib/review/idgxmlbuilder.rb +65 -39
- data/lib/review/latexbuilder.rb +72 -24
- data/lib/review/latexutils.rb +3 -1
- data/lib/review/makerhelper.rb +8 -2
- data/lib/review/preprocessor.rb +20 -20
- data/lib/review/review.tex.erb +4 -0
- data/lib/review/sec_counter.rb +9 -11
- data/lib/review/tocparser.rb +2 -2
- data/lib/review/tocprinter.rb +12 -12
- data/lib/review/topbuilder.rb +15 -15
- data/lib/review/version.rb +1 -1
- data/lib/uuid.rb +7 -7
- data/review.gemspec +2 -2
- data/rubocop-todo.yml +443 -0
- data/test/sample-book/src/config.yml +2 -2
- data/test/sample-book/src/{main.css → style.css} +0 -0
- data/test/test_book.rb +46 -48
- data/test/test_book_chapter.rb +25 -13
- data/test/test_builder.rb +3 -3
- data/test/test_catalog.rb +107 -0
- data/test/test_epubmaker.rb +6 -6
- data/test/test_htmlbuilder.rb +160 -39
- data/test/test_htmlutils.rb +22 -0
- data/test/test_i18n.rb +2 -2
- data/test/test_idgxmlbuilder.rb +33 -47
- data/test/test_image_finder.rb +82 -0
- data/test/test_inaobuilder.rb +1 -1
- data/test/test_latexbuilder.rb +35 -39
- data/test/test_lineinput.rb +2 -2
- data/test/test_markdownbuilder.rb +2 -2
- data/test/test_topbuilder.rb +39 -23
- metadata +23 -14
- data/bin/review-epubmaker-ng +0 -23
data/bin/review-index
CHANGED
@@ -18,6 +18,7 @@ $LOAD_PATH.unshift((bindir + '../lib').realpath)
|
|
18
18
|
require 'review/book'
|
19
19
|
require 'review/tocparser'
|
20
20
|
require 'review/tocprinter'
|
21
|
+
require 'review/version'
|
21
22
|
require 'optparse'
|
22
23
|
|
23
24
|
def main
|
@@ -41,56 +42,57 @@ def _main
|
|
41
42
|
"outencoding" => "UTF-8"
|
42
43
|
}
|
43
44
|
|
44
|
-
|
45
|
-
|
45
|
+
opts = OptionParser.new
|
46
|
+
opts.version = ReVIEW::VERSION
|
47
|
+
opts.on('--inencoding=ENCODING', 'Set input encoding. (UTF-8, EUC, JIS, and SJIS)') {|enc|
|
46
48
|
param["inencoding"] = enc
|
47
49
|
}
|
48
|
-
|
50
|
+
opts.on('--outencoding=ENCODING', 'Set output encoding. (UTF-8[default], EUC, JIS, and SJIS)') {|enc|
|
49
51
|
param["outencoding"] = enc
|
50
52
|
}
|
51
|
-
|
53
|
+
opts.on('-a', '--all', 'print all chapters.') {
|
52
54
|
begin
|
53
55
|
source = ReVIEW.book
|
54
56
|
rescue ReVIEW::Error => err
|
55
57
|
error_exit err.message
|
56
58
|
end
|
57
59
|
}
|
58
|
-
|
60
|
+
opts.on('-p', '--part N', 'list only part N.') {|n|
|
59
61
|
source = ReVIEW.book.part(Integer(n)) or
|
60
62
|
error_exit "part #{n} does not exist in this book"
|
61
63
|
}
|
62
|
-
|
64
|
+
opts.on('-c', '--chapter C', 'list only chapter C.') {|c|
|
63
65
|
begin
|
64
66
|
source = ReVIEW::Book::Part.new(nil, 1, [ReVIEW.book.chapter(c)])
|
65
67
|
rescue
|
66
68
|
error_exit "chapter #{c} does not exist in this book"
|
67
69
|
end
|
68
70
|
}
|
69
|
-
|
71
|
+
opts.on('-l', '--level N', 'list upto N level (1..4, default=4)') {|n|
|
70
72
|
upper = Integer(n)
|
71
73
|
unless (0..4).include?(upper) # 0 is hidden option
|
72
74
|
$stderr.puts "-l/--level option accepts only 1..4"
|
73
75
|
exit 1
|
74
76
|
end
|
75
77
|
}
|
76
|
-
|
78
|
+
opts.on('--text', 'output in plain text (default)') {
|
77
79
|
printer_class = ReVIEW::TextTOCPrinter
|
78
80
|
}
|
79
|
-
|
81
|
+
opts.on('--html', 'output in HTML (deprecated)') {
|
80
82
|
printer_class = ReVIEW::HTMLTOCPrinter
|
81
83
|
}
|
82
|
-
|
84
|
+
opts.on('--idg', 'output in InDesign XML') {
|
83
85
|
printer_class = ReVIEW::IDGTOCPrinter
|
84
86
|
}
|
85
|
-
|
86
|
-
puts
|
87
|
+
opts.on('--help', 'print this message and quit.') {
|
88
|
+
puts opts.help
|
87
89
|
exit 0
|
88
90
|
}
|
89
91
|
begin
|
90
|
-
|
92
|
+
opts.parse!
|
91
93
|
rescue OptionParser::ParseError => err
|
92
94
|
$stderr.puts err.message
|
93
|
-
$stderr.puts
|
95
|
+
$stderr.puts opts.help
|
94
96
|
exit 1
|
95
97
|
end
|
96
98
|
if source
|
@@ -98,7 +100,7 @@ def _main
|
|
98
100
|
error_exit '-a/-s option and file arguments are exclusive'
|
99
101
|
end
|
100
102
|
else
|
101
|
-
puts
|
103
|
+
puts opts.help
|
102
104
|
exit 0
|
103
105
|
end
|
104
106
|
|
data/bin/review-init
CHANGED
@@ -8,22 +8,46 @@
|
|
8
8
|
# For details of the GNU LGPL, see the file "COPYING".
|
9
9
|
|
10
10
|
require 'fileutils'
|
11
|
+
require 'optparse'
|
12
|
+
|
13
|
+
require 'pathname'
|
14
|
+
|
15
|
+
bindir = Pathname.new(__FILE__).realpath.dirname
|
16
|
+
$LOAD_PATH.unshift((bindir + '../lib').realpath)
|
17
|
+
|
18
|
+
require 'review/version'
|
11
19
|
|
12
20
|
def main
|
21
|
+
opts = OptionParser.new
|
22
|
+
opts.version = ReVIEW::VERSION
|
23
|
+
opts.banner = "Usage: #{File.basename($0)} dirname"
|
24
|
+
opts.on('-h', '--help', 'print this message and quit.') {
|
25
|
+
puts opts.help
|
26
|
+
exit 0
|
27
|
+
}
|
28
|
+
begin
|
29
|
+
opts.parse!
|
30
|
+
rescue OptionParser::ParseError => err
|
31
|
+
$stderr.puts err.message
|
32
|
+
$stderr.puts opts.help
|
33
|
+
exit 1
|
34
|
+
end
|
35
|
+
|
13
36
|
if ARGV.empty?
|
14
|
-
puts
|
15
|
-
exit
|
37
|
+
$stderr.puts opts.help
|
38
|
+
exit 1
|
16
39
|
end
|
17
40
|
|
18
41
|
initdir = File.expand_path(ARGV.shift)
|
19
42
|
@review_dir = File.dirname(File.expand_path(__FILE__ + "./../"))
|
20
43
|
|
21
44
|
generate_dir(initdir) do |dir|
|
22
|
-
|
45
|
+
generate_catalog_file(dir)
|
23
46
|
generate_sample(dir)
|
24
47
|
generate_images_dir(dir)
|
25
48
|
generate_cover_image(dir)
|
26
49
|
generate_layout(dir)
|
50
|
+
generate_style(dir)
|
27
51
|
generate_texmacro(dir)
|
28
52
|
generate_config(dir)
|
29
53
|
generate_rakefile(dir)
|
@@ -67,12 +91,18 @@ EOS
|
|
67
91
|
end
|
68
92
|
end
|
69
93
|
|
70
|
-
def
|
71
|
-
File.open(dir + "/
|
72
|
-
|
73
|
-
|
94
|
+
def generate_catalog_file(dir)
|
95
|
+
File.open(dir + "/catalog.yml", "w") do |file|
|
96
|
+
file.write <<-EOS
|
97
|
+
PREDEF:
|
98
|
+
|
99
|
+
CHAPS:
|
100
|
+
- #{File.basename(dir)}.re
|
101
|
+
|
102
|
+
POSTDEF:
|
103
|
+
|
104
|
+
EOS
|
74
105
|
end
|
75
|
-
File.open(dir + "/POSTDEF", "w")
|
76
106
|
end
|
77
107
|
|
78
108
|
def generate_images_dir(dir)
|
@@ -88,7 +118,7 @@ def generate_config(dir)
|
|
88
118
|
end
|
89
119
|
|
90
120
|
def generate_style(dir)
|
91
|
-
|
121
|
+
FileUtils.cp @review_dir + "/test/sample-book/src/style.css", dir
|
92
122
|
end
|
93
123
|
|
94
124
|
def generate_texmacro(dir)
|
data/bin/review-pdfmaker
CHANGED
@@ -13,6 +13,7 @@ require 'tmpdir'
|
|
13
13
|
require 'yaml'
|
14
14
|
require 'fileutils'
|
15
15
|
require 'erb'
|
16
|
+
require 'optparse'
|
16
17
|
|
17
18
|
require 'pathname'
|
18
19
|
bindir = Pathname.new(__FILE__).realpath.dirname
|
@@ -21,48 +22,82 @@ $LOAD_PATH.unshift((bindir + '../lib').realpath)
|
|
21
22
|
require 'review'
|
22
23
|
require 'review/i18n'
|
23
24
|
|
25
|
+
include ReVIEW::LaTeXUtils
|
26
|
+
|
27
|
+
include FileUtils
|
28
|
+
|
24
29
|
def error(msg)
|
25
30
|
$stderr.puts "#{File.basename($0, '.*')}: error: #{msg}"
|
26
31
|
exit 1
|
27
32
|
end
|
28
33
|
|
29
|
-
def
|
30
|
-
$stderr.puts "
|
31
|
-
exit 0
|
34
|
+
def warn(msg)
|
35
|
+
$stderr.puts "#{File.basename($0, '.*')}: warning: #{msg}"
|
32
36
|
end
|
33
37
|
|
34
|
-
def check_book(
|
35
|
-
pdf_file =
|
38
|
+
def check_book(config)
|
39
|
+
pdf_file = config["bookname"]+".pdf"
|
36
40
|
if File.exist? pdf_file
|
37
41
|
error "file already exists:#{pdf_file}"
|
38
42
|
end
|
39
43
|
end
|
40
44
|
|
41
|
-
def build_path(
|
42
|
-
|
43
|
-
|
45
|
+
def build_path(config)
|
46
|
+
"./#{config["bookname"]}-pdf"
|
47
|
+
end
|
48
|
+
|
49
|
+
def check_compile_status(ignore_errors)
|
50
|
+
return unless @compile_errors
|
51
|
+
|
52
|
+
if ignore_errors
|
53
|
+
$stderr.puts "compile error, but try to generate PDF file"
|
44
54
|
else
|
45
|
-
"
|
55
|
+
error "compile error, No PDF file output."
|
46
56
|
end
|
47
57
|
end
|
48
58
|
|
59
|
+
|
49
60
|
def main
|
50
|
-
|
61
|
+
config = ReVIEW::Configure.values
|
62
|
+
cmd_config = Hash.new
|
63
|
+
|
64
|
+
opts = OptionParser.new
|
65
|
+
opts.banner = "Usage: #{File.basename($0)} configfile"
|
66
|
+
opts.version = ReVIEW::VERSION
|
67
|
+
opts.on('--help', 'Prints this message and quit.') do
|
68
|
+
puts opts.help
|
69
|
+
exit 0
|
70
|
+
end
|
71
|
+
opts.on('--[no-]debug', 'Keep temporary files.') do |debug|
|
72
|
+
cmd_config["debug"] = debug
|
73
|
+
end
|
74
|
+
opts.on('--ignore-errors', 'Ignore review-compile errors.') do
|
75
|
+
cmd_config["ignore-errors"] = true
|
76
|
+
end
|
51
77
|
|
78
|
+
opts.parse!(ARGV)
|
79
|
+
if ARGV.size != 1
|
80
|
+
puts opts.help
|
81
|
+
exit 0
|
82
|
+
end
|
52
83
|
yamlfile = ARGV[0]
|
53
|
-
|
54
|
-
|
84
|
+
config.merge!(YAML.load_file(yamlfile))
|
85
|
+
# YAML configs will be overridden by command line options.
|
86
|
+
config.merge!(cmd_config)
|
87
|
+
|
88
|
+
check_book(config)
|
55
89
|
@basedir = Dir.pwd
|
56
|
-
@path = build_path(
|
57
|
-
bookname =
|
90
|
+
@path = build_path(config)
|
91
|
+
bookname = config["bookname"]
|
58
92
|
Dir.mkdir(@path)
|
59
93
|
|
60
94
|
@chaps_fnames = Hash.new{|h, key| h[key] = ""}
|
95
|
+
@compile_errors = nil
|
61
96
|
|
62
97
|
ReVIEW::Book.load(@basedir).parts.each do |part|
|
63
98
|
if part.name.present?
|
64
99
|
if part.file?
|
65
|
-
output_parts(part.name,
|
100
|
+
output_parts(part.name, config)
|
66
101
|
@chaps_fnames["CHAPS"] << %Q|\\input{#{part.name}.tex}\n|
|
67
102
|
else
|
68
103
|
@chaps_fnames["CHAPS"] << %Q|\\part{#{part.name}}\n|
|
@@ -71,24 +106,26 @@ def main
|
|
71
106
|
|
72
107
|
part.chapters.each do |chap|
|
73
108
|
filename = "#{File.basename(chap.path, ".*")}.tex"
|
74
|
-
output_chaps(filename,
|
109
|
+
output_chaps(filename, config)
|
75
110
|
@chaps_fnames["PREDEF"] << "\\input{#{filename}}\n" if chap.on_PREDEF?
|
76
111
|
@chaps_fnames["CHAPS"] << "\\input{#{filename}}\n" if chap.on_CHAPS?
|
77
112
|
@chaps_fnames["POSTDEF"] << "\\input{#{filename}}\n" if chap.on_POSTDEF?
|
78
113
|
end
|
79
114
|
end
|
80
115
|
|
81
|
-
|
82
|
-
|
83
|
-
|
116
|
+
check_compile_status(config["ignore-errors"])
|
117
|
+
|
118
|
+
config["pre_str"] = @chaps_fnames["PREDEF"]
|
119
|
+
config["chap_str"] = @chaps_fnames["CHAPS"]
|
120
|
+
config["post_str"] = @chaps_fnames["POSTDEF"]
|
84
121
|
|
85
|
-
|
86
|
-
if
|
87
|
-
|
122
|
+
config["usepackage"] = ""
|
123
|
+
if config["texstyle"]
|
124
|
+
config["usepackage"] = "\\usepackage{#{config['texstyle']}}"
|
88
125
|
end
|
89
126
|
|
90
127
|
%w[aut csl trl dsr ill cov edt].each do |item|
|
91
|
-
|
128
|
+
config[item] = [config[item]] if !config[item].nil? && config[item].instance_of?(String)
|
92
129
|
end
|
93
130
|
|
94
131
|
copy_images("./images", "#{@path}/images")
|
@@ -96,52 +133,50 @@ def main
|
|
96
133
|
copyStyToDir(Dir.pwd, @path, "tex")
|
97
134
|
|
98
135
|
Dir.chdir(@path) {
|
99
|
-
template = get_template(
|
136
|
+
template = get_template(config)
|
100
137
|
File.open("./book.tex", "wb"){|f| f.write(template)}
|
101
138
|
|
102
139
|
## do compile
|
103
|
-
enc =
|
104
|
-
kanji =
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
fork {
|
115
|
-
exec("#{texcommand} -kanji=#{kanji} book.tex")
|
116
|
-
}
|
117
|
-
if texcommand != "lualatex"
|
118
|
-
Process.waitall
|
119
|
-
fork {
|
120
|
-
exec("dvipdfmx -d 5 book.dvi")
|
121
|
-
}
|
122
|
-
Process.waitall
|
140
|
+
enc = config["params"].to_s.split(/\s+/).find{|i| i =~ /\A--outencoding=/ }
|
141
|
+
kanji = 'utf8'
|
142
|
+
if enc
|
143
|
+
kanji = enc.split(/\=/).last.gsub(/-/, '').downcase
|
144
|
+
end
|
145
|
+
texcommand = config["texcommand"] || "platex"
|
146
|
+
3.times do
|
147
|
+
system("#{texcommand} -kanji=#{kanji} book.tex")
|
148
|
+
end
|
149
|
+
if File.exist?("book.dvi")
|
150
|
+
system("dvipdfmx -d 5 book.dvi")
|
123
151
|
end
|
124
152
|
}
|
125
153
|
FileUtils.cp("#{@path}/book.pdf", "#{@basedir}/#{bookname}.pdf")
|
126
|
-
end
|
127
154
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
$stderr.puts "compiling #{filename}"
|
132
|
-
exec("review-compile --target=latex --level=#{values["secnolevel"]} --toclevel=#{values["toclevel"]} #{values["params"]} #{filename}")
|
133
|
-
}
|
134
|
-
Process.waitall
|
155
|
+
unless config["debug"]
|
156
|
+
remove_entry_secure @path
|
157
|
+
end
|
135
158
|
end
|
136
159
|
|
137
|
-
def
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
160
|
+
def output_chaps(filename, config)
|
161
|
+
$stderr.puts "compiling #{filename}"
|
162
|
+
cmd = "#{ReVIEW::MakerHelper.bindir}/review-compile --target=latex --level=#{config["secnolevel"]} --toclevel=#{config["toclevel"]} #{config["params"]} #{filename} > #{@path}/#{filename}"
|
163
|
+
if system cmd
|
164
|
+
# OK
|
165
|
+
else
|
166
|
+
@compile_errors = true
|
167
|
+
warn cmd
|
168
|
+
end
|
169
|
+
end
|
142
170
|
|
143
|
-
|
144
|
-
|
171
|
+
def output_parts(filename, config)
|
172
|
+
$stderr.puts "compiling #{filename}.tex"
|
173
|
+
cmd = "review-compile --target=latex --level=#{config["secnolevel"]} --toclevel=#{config["toclevel"]} #{config["params"]} #{filename}.re | sed -e s/\\chapter{/\\part{/ > #{@path}/#{filename}.tex"
|
174
|
+
if system cmd
|
175
|
+
# OK
|
176
|
+
else
|
177
|
+
@compile_errors = true
|
178
|
+
warn cmd
|
179
|
+
end
|
145
180
|
end
|
146
181
|
|
147
182
|
|
@@ -149,16 +184,15 @@ def copy_images(from, to)
|
|
149
184
|
if File.exist?(from)
|
150
185
|
Dir.mkdir(to)
|
151
186
|
ReVIEW::MakerHelper.copy_images_to_dir(from, to)
|
152
|
-
Dir.chdir(to)
|
153
|
-
|
154
|
-
|
155
|
-
exec("extractbb *.png *.jpg *.pdf */*.jpg */*.png */*.pdf;extractbb -m *.png *.jpg *.pdf */*.jpg */*.png */*.pdf")
|
156
|
-
rescue
|
157
|
-
exec("ebb *.png *.jpg *.pdf */*.jpg */*.png */*.pdf")
|
158
|
-
end
|
187
|
+
Dir.chdir(to) do
|
188
|
+
images = Dir.glob("**/*").find_all{|f|
|
189
|
+
File.file?(f) and f =~ /\.(jpg|jpeg|png|pdf)\z/
|
159
190
|
}
|
160
|
-
|
161
|
-
|
191
|
+
system("extractbb", *images)
|
192
|
+
unless system("extractbb", "-m", *images)
|
193
|
+
system("ebb", *images)
|
194
|
+
end
|
195
|
+
end
|
162
196
|
end
|
163
197
|
end
|
164
198
|
|
@@ -171,42 +205,42 @@ def make_custom_titlepage(coverfile)
|
|
171
205
|
end
|
172
206
|
end
|
173
207
|
|
174
|
-
def get_template(
|
175
|
-
dclass =
|
208
|
+
def get_template(config)
|
209
|
+
dclass = config["texdocumentclass"] || []
|
176
210
|
documentclass = dclass[0] || "jsbook"
|
177
211
|
documentclassoption = dclass[1] || "oneside"
|
178
212
|
|
179
213
|
okuduke = ""
|
180
214
|
authors = ""
|
181
|
-
if !
|
182
|
-
okuduke += "著 者 & #{
|
183
|
-
authors =
|
215
|
+
if !config["aut"].nil? && !config["aut"].empty?
|
216
|
+
okuduke += "著 者 & #{escape_latex(config["aut"].join(ReVIEW::I18n.t("names_splitter")))} \\\\\n"
|
217
|
+
authors = config["aut"].join(ReVIEW::I18n.t("names_splitter")) + ReVIEW::I18n.t("author_postfix")
|
184
218
|
end
|
185
|
-
if !
|
186
|
-
okuduke += "監 修 & #{
|
187
|
-
authors += " \\\\\n"+
|
219
|
+
if !config["csl"].nil? && !config["csl"].empty?
|
220
|
+
okuduke += "監 修 & #{escape_latex(config["csl"].join(ReVIEW::I18n.t("names_splitter")))} \\\\\n"
|
221
|
+
authors += " \\\\\n"+config["csl"].join(ReVIEW::I18n.t("names_splitter")) + ReVIEW::I18n.t("supervisor_postfix")
|
188
222
|
end
|
189
|
-
if !
|
190
|
-
okuduke += "翻 訳 & #{
|
191
|
-
authors += " \\\\\n"+
|
223
|
+
if !config["trl"].nil? && !config["trl"].empty?
|
224
|
+
okuduke += "翻 訳 & #{escape_latex(config["trl"].join(ReVIEW::I18n.t("names_splitter")))} \\\\\n"
|
225
|
+
authors += " \\\\\n"+config["trl"].join(ReVIEW::I18n.t("names_splitter")) + ReVIEW::I18n.t("translator_postfix")
|
192
226
|
end
|
193
|
-
if !
|
194
|
-
okuduke += "デザイン & #{
|
227
|
+
if !config["dsr"].nil? && !config["dsr"].empty?
|
228
|
+
okuduke += "デザイン & #{escape_latex(config["dsr"].join(ReVIEW::I18n.t("names_splitter")))} \\\\\n"
|
195
229
|
end
|
196
|
-
if !
|
197
|
-
okuduke += "イラスト & #{
|
230
|
+
if !config["ill"].nil? && !config["ill"].empty?
|
231
|
+
okuduke += "イラスト & #{escape_latex(config["ill"].join(ReVIEW::I18n.t("names_splitter")))} \\\\\n"
|
198
232
|
end
|
199
|
-
if !
|
200
|
-
okuduke += "表 紙 & #{
|
233
|
+
if !config["cov"].nil? && !config["cov"].empty?
|
234
|
+
okuduke += "表 紙 & #{escape_latex(config["cov"].join(ReVIEW::I18n.t("names_splitter")))} \\\\\n"
|
201
235
|
end
|
202
|
-
if !
|
203
|
-
okuduke += "編集者 & #{
|
236
|
+
if !config["edt"].nil? && !config["edt"].empty?
|
237
|
+
okuduke += "編集者 & #{escape_latex(config["edt"].join(ReVIEW::I18n.t("names_splitter")))} \\\\\n"
|
204
238
|
end
|
205
239
|
okuduke += <<EOB
|
206
|
-
発行所 & #{
|
240
|
+
発行所 & #{config["prt"]} \\\\
|
207
241
|
EOB
|
208
242
|
|
209
|
-
custom_titlepage = make_custom_titlepage(
|
243
|
+
custom_titlepage = make_custom_titlepage(config["coverfile"])
|
210
244
|
|
211
245
|
template = File.expand_path(File.dirname(__FILE__) +
|
212
246
|
'/../lib/review/review.tex.erb')
|
@@ -216,6 +250,7 @@ EOB
|
|
216
250
|
end
|
217
251
|
|
218
252
|
erb = ERB.new(File.open(template).read)
|
253
|
+
values = config # must be 'values' for legacy files
|
219
254
|
erb.result(binding)
|
220
255
|
end
|
221
256
|
|