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
@@ -88,10 +88,18 @@ module ReVIEW
|
|
88
88
|
"*#{str.gsub(/\*/, '\*')}*"
|
89
89
|
end
|
90
90
|
|
91
|
+
def inline_em(str)
|
92
|
+
"*#{str.gsub(/\*/, '\*')}*"
|
93
|
+
end
|
94
|
+
|
91
95
|
def inline_b(str)
|
92
96
|
"**#{str.gsub(/\*/, '\*')}**"
|
93
97
|
end
|
94
98
|
|
99
|
+
def inline_strong(str)
|
100
|
+
"**#{str.gsub(/\*/, '\*')}**"
|
101
|
+
end
|
102
|
+
|
95
103
|
def inline_code(str)
|
96
104
|
"`#{str}`"
|
97
105
|
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#
|
3
|
+
# Copyright (c) 2008-2014 Minero Aoki, Kenshi Muto, Masayoshi Takahashi,
|
4
|
+
# KADO Masanori
|
5
|
+
#
|
6
|
+
# This program is free software.
|
7
|
+
# You can distribute or modify this program under the terms of
|
8
|
+
# the GNU LGPL, Lesser General Public License version 2.1.
|
9
|
+
#
|
10
|
+
|
11
|
+
module ReVIEW
|
12
|
+
|
13
|
+
# Secion Counter class
|
14
|
+
#
|
15
|
+
class SecCounter
|
16
|
+
def initialize(n, chapter)
|
17
|
+
@chapter = chapter
|
18
|
+
reset(n)
|
19
|
+
end
|
20
|
+
|
21
|
+
def reset(n)
|
22
|
+
@counter = Array.new(n, 0)
|
23
|
+
end
|
24
|
+
|
25
|
+
def inc(level)
|
26
|
+
n = level - 2
|
27
|
+
if n >= 0
|
28
|
+
@counter[n] += 1
|
29
|
+
end
|
30
|
+
if @counter.size > n
|
31
|
+
(n+1 .. @counter.size).each do |i|
|
32
|
+
@counter[i] = 0
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def anchor(level)
|
38
|
+
str = "#{@chapter.number}"
|
39
|
+
0.upto(level-2) do |i|
|
40
|
+
str << "-#{@counter[i]}"
|
41
|
+
end
|
42
|
+
str
|
43
|
+
end
|
44
|
+
|
45
|
+
def prefix(level, secnolevel)
|
46
|
+
return nil if @chapter.number.blank?
|
47
|
+
|
48
|
+
if level == 1
|
49
|
+
if secnolevel >= 1
|
50
|
+
placeholder = if @chapter.is_a? ReVIEW::Book::Part
|
51
|
+
'part'
|
52
|
+
elsif @chapter.on_POSTDEF?
|
53
|
+
'appendix'
|
54
|
+
else
|
55
|
+
'chapter'
|
56
|
+
end
|
57
|
+
return "#{I18n.t(placeholder, @chapter.number)}#{I18n.t("chapter_postfix")}"
|
58
|
+
end
|
59
|
+
else
|
60
|
+
if secnolevel >= level && !@chapter.on_POSTDEF?
|
61
|
+
prefix = "#{@chapter.number}"
|
62
|
+
0.upto(level-2) do |i|
|
63
|
+
prefix << ".#{@counter[i]}"
|
64
|
+
end
|
65
|
+
prefix << I18n.t("chapter_postfix")
|
66
|
+
return prefix
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
data/lib/review/topbuilder.rb
CHANGED
data/lib/review/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module
|
2
|
-
VERSION = "1.
|
1
|
+
module ReVIEW
|
2
|
+
VERSION = "1.2.0"
|
3
3
|
end
|
data/review.gemspec
CHANGED
@@ -4,16 +4,16 @@ require "review/version"
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "review"
|
7
|
-
gem.version =
|
7
|
+
gem.version = ReVIEW::VERSION
|
8
8
|
gem.platform = Gem::Platform::RUBY
|
9
9
|
gem.license = "LGPL"
|
10
10
|
gem.authors = ["kmuto", "takahashim"]
|
11
11
|
gem.email = "kmuto@debian.org"
|
12
12
|
gem.homepage = "http://github.com/kmuto/review"
|
13
|
-
gem.summary = "
|
14
|
-
gem.description = "
|
13
|
+
gem.summary = "Re:VIEW: a easy-to-use digital publishing system"
|
14
|
+
gem.description = "Re:VIEW is a digital publishing system for books and ebooks. It supports InDesign, EPUB and LaTeX."
|
15
15
|
gem.required_rubygems_version = Gem::Requirement.new(">= 0") if gem.respond_to? :required_rubygems_version=
|
16
|
-
gem.date = "
|
16
|
+
gem.date = "2014-04-02"
|
17
17
|
|
18
18
|
gem.files = `git ls-files`.split("\n")
|
19
19
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
data/test/sample-book/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# Re:VIEWサンプル書籍データ
|
2
2
|
|
3
|
-
|
3
|
+
Re:VIEW ( http://github.com/kmuto/review )で書籍データを作るためのサンプルファイルです。
|
4
4
|
|
5
5
|
必要なファイルはsrc/ディレクトリ内にあります。srcディレクトリで「review-epubmaker config.yml」と実行すればEPUBが、「review-pdfmaker config.yml」とすればPDFが生成されます(PDFの生成にはpLaTeXとdvipdfmxが必要です)。
|
@@ -1,14 +1,14 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
|
3
3
|
def build(mode, chapter)
|
4
|
-
sh "review-compile --target=#{mode} --footnotetext --
|
4
|
+
sh "review-compile --target=#{mode} --footnotetext --stylesheet=style.css #{chapter} > tmp"
|
5
5
|
mode_ext = {"html" => "html", "latex" => "tex",
|
6
6
|
"idgxml" => "xml", "inao" => "inao"}
|
7
7
|
FileUtils.mv "tmp", chapter.gsub(/re\z/, mode_ext[mode])
|
8
8
|
end
|
9
9
|
|
10
10
|
def build_all(mode)
|
11
|
-
sh "review-compile --all --target=#{mode} --footnotetext --
|
11
|
+
sh "review-compile --all --target=#{mode} --footnotetext --stylesheet=style.css"
|
12
12
|
end
|
13
13
|
|
14
14
|
desc "build html (Usage: rake build re=target.re)"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# review-epubmaker向けの設定ファイルの例。
|
2
|
-
# yamlファイルを
|
2
|
+
# yamlファイルをRe:VIEWファイルのある場所に置き、
|
3
3
|
# 「review-epubmaker yamlファイル」を実行すると、<bookname>.epubファイルが
|
4
4
|
# 生成されます。
|
5
5
|
# このファイルはUTF-8エンコーディングで記述してください。
|
@@ -7,7 +7,7 @@
|
|
7
7
|
# ブック名(ファイル名になるもの。ASCII範囲の文字を使用)
|
8
8
|
bookname: book
|
9
9
|
# 書名
|
10
|
-
booktitle:
|
10
|
+
booktitle: Re:VIEWサンプル書籍
|
11
11
|
# 著者
|
12
12
|
aut: 高橋征義
|
13
13
|
prt: 達人出版会
|
@@ -37,7 +37,7 @@ coverfile: _cover.html
|
|
37
37
|
coverimage: cover.jpg
|
38
38
|
# 固有IDに使用するドメイン
|
39
39
|
urnid: http://tatsu-zine.com/books/review-sample-book/1.0.0/
|
40
|
-
# CSSファイル (yamlファイルおよび
|
40
|
+
# CSSファイル (yamlファイルおよびRe:VIEWファイルを置いたディレクトリにあること
|
41
41
|
stylesheet: main.css
|
42
42
|
# 目次として抽出するレベル
|
43
43
|
toclevel: 2
|
@@ -49,7 +49,7 @@ params: --stylesheet=main.css
|
|
49
49
|
mytoc: true
|
50
50
|
# 奥付生成用
|
51
51
|
colophon: true
|
52
|
-
texstyle:
|
52
|
+
texstyle: reviewmacro
|
53
53
|
pubhistory: |
|
54
54
|
2011年08月03日 v1.0.0版発行
|
55
55
|
debug: true
|
Binary file
|
data/test/test_book_parameter.rb
CHANGED
data/test/test_epubmaker.rb
CHANGED
@@ -8,7 +8,7 @@ class EPUBMakerTest < Test::Unit::TestCase
|
|
8
8
|
|
9
9
|
def setup
|
10
10
|
@producer = Producer.new
|
11
|
-
@producer.
|
11
|
+
@producer.merge_params({
|
12
12
|
"bookname" => "sample",
|
13
13
|
"title" => "Sample Book",
|
14
14
|
"version" => 2,
|
@@ -24,12 +24,12 @@ class EPUBMakerTest < Test::Unit::TestCase
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def test_resource_en
|
27
|
-
@producer.
|
27
|
+
@producer.merge_params({"language" => "en"})
|
28
28
|
assert_equal "Table of Contents", @producer.res.v("toctitle")
|
29
29
|
end
|
30
30
|
|
31
31
|
def test_resource_ja
|
32
|
-
@producer.
|
32
|
+
@producer.merge_params({"language" => "ja"})
|
33
33
|
assert_equal "目次", @producer.res.v("toctitle")
|
34
34
|
end
|
35
35
|
|
@@ -403,21 +403,47 @@ EOT
|
|
403
403
|
</head>
|
404
404
|
<body>
|
405
405
|
<h1 class="toc-title">Table of Contents</h1>
|
406
|
-
|
407
|
-
<li><a href="ch01.html">CH01</a></li>
|
406
|
+
|
407
|
+
<ul class="toc-h1"><li><a href="ch01.html">CH01</a></li>
|
408
408
|
<li><a href="ch02.html">CH02</a>
|
409
|
-
<ul class="toc-h2">
|
410
|
-
<li><a href="ch02.html#S1">CH02.1</a></li>
|
409
|
+
<ul class="toc-h2"><li><a href="ch02.html#S1">CH02.1</a></li>
|
411
410
|
<li><a href="ch02.html#S2">CH02.2</a></li>
|
412
|
-
</ul>
|
413
|
-
</li>
|
411
|
+
</ul></li>
|
414
412
|
<li><a href="ch03.html">CH03</a>
|
415
|
-
<ul class="toc-h2">
|
413
|
+
<ul class="toc-h2"><li><a href="ch03.html#S1">CH03.1</a></li>
|
414
|
+
</ul></li>
|
415
|
+
<li><a href="ch04.html">CH04</a></li>
|
416
|
+
</ul></body>
|
417
|
+
</html>
|
418
|
+
EOT
|
419
|
+
assert_equal expect, @output.string
|
420
|
+
end
|
421
|
+
|
422
|
+
def test_stage3_flat
|
423
|
+
@producer.merge_params({"flattoc" => true, "flattocindent" => false})
|
424
|
+
stage3
|
425
|
+
@producer.mytoc(@output)
|
426
|
+
expect = <<EOT
|
427
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
428
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
429
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ops="http://www.idpf.org/2007/ops" xml:lang="en">
|
430
|
+
<head>
|
431
|
+
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
432
|
+
<meta http-equiv="Content-Style-Type" content="text/css"/>
|
433
|
+
<meta name="generator" content="EPUBMaker::Producer"/>
|
434
|
+
<title>Table of Contents</title>
|
435
|
+
</head>
|
436
|
+
<body>
|
437
|
+
<h1 class="toc-title">Table of Contents</h1>
|
438
|
+
<ul class="toc-h1">
|
439
|
+
<li><a href="ch01.html">CH01</a></li>
|
440
|
+
<li><a href="ch02.html">CH02</a></li>
|
441
|
+
<li><a href="ch02.html#S1">CH02.1</a></li>
|
442
|
+
<li><a href="ch02.html#S2">CH02.2</a></li>
|
443
|
+
<li><a href="ch03.html">CH03</a></li>
|
416
444
|
<li><a href="ch03.html#S1">CH03.1</a></li>
|
417
|
-
</ul>
|
418
|
-
</li>
|
419
445
|
<li><a href="ch04.html">CH04</a></li>
|
420
|
-
|
446
|
+
</ul>
|
421
447
|
</body>
|
422
448
|
</html>
|
423
449
|
EOT
|
@@ -470,8 +496,40 @@ EOT
|
|
470
496
|
end
|
471
497
|
|
472
498
|
def test_colophon_default
|
473
|
-
@producer.params["aut"] = "Mr.Smith"
|
474
|
-
@producer.params["prt"] = "BLUEPRINT"
|
499
|
+
@producer.params["aut"] = ["Mr.Smith"]
|
500
|
+
@producer.params["prt"] = ["BLUEPRINT"]
|
501
|
+
@producer.colophon(@output)
|
502
|
+
expect = <<EOT
|
503
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
504
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
505
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ops="http://www.idpf.org/2007/ops" xml:lang="en">
|
506
|
+
<head>
|
507
|
+
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
508
|
+
<meta http-equiv="Content-Style-Type" content="text/css"/>
|
509
|
+
<meta name="generator" content="EPUBMaker::Producer"/>
|
510
|
+
<title>Colophon</title>
|
511
|
+
</head>
|
512
|
+
<body>
|
513
|
+
<div class="colophon">
|
514
|
+
<p class="title">Sample Book</p>
|
515
|
+
<div class="pubhistory">
|
516
|
+
<p>2011年1月1日 発行</p>
|
517
|
+
</div>
|
518
|
+
<table class="colophon">
|
519
|
+
<tr><th>Author</th><td>Mr.Smith</td></tr>
|
520
|
+
<tr><th>Publisher</th><td>BLUEPRINT</td></tr>
|
521
|
+
</table>
|
522
|
+
</div>
|
523
|
+
</body>
|
524
|
+
</html>
|
525
|
+
EOT
|
526
|
+
assert_equal expect, @output.string
|
527
|
+
end
|
528
|
+
|
529
|
+
def test_colophon_pht
|
530
|
+
@producer.params["aut"] = ["Mr.Smith"]
|
531
|
+
@producer.params["prt"] = ["BLUEPRINT"]
|
532
|
+
@producer.params["pht"] = ["Mrs.Smith"]
|
475
533
|
@producer.colophon(@output)
|
476
534
|
expect = <<EOT
|
477
535
|
<?xml version="1.0" encoding="UTF-8"?>
|
@@ -486,9 +544,13 @@ EOT
|
|
486
544
|
<body>
|
487
545
|
<div class="colophon">
|
488
546
|
<p class="title">Sample Book</p>
|
547
|
+
<div class="pubhistory">
|
548
|
+
<p>2011年1月1日 発行</p>
|
549
|
+
</div>
|
489
550
|
<table class="colophon">
|
490
551
|
<tr><th>Author</th><td>Mr.Smith</td></tr>
|
491
552
|
<tr><th>Publisher</th><td>BLUEPRINT</td></tr>
|
553
|
+
<tr><th>Director of Photography</th><td>Mrs.Smith</td></tr>
|
492
554
|
</table>
|
493
555
|
</div>
|
494
556
|
</body>
|
data/test/test_epubmaker_cmd.rb
CHANGED
@@ -4,6 +4,7 @@ require 'test_helper'
|
|
4
4
|
require 'tmpdir'
|
5
5
|
require 'fileutils'
|
6
6
|
require 'yaml'
|
7
|
+
require 'rbconfig'
|
7
8
|
|
8
9
|
REVIEW_EPUBMAKER = File.expand_path('../bin/review-epubmaker', File.dirname(__FILE__))
|
9
10
|
|
@@ -23,14 +24,17 @@ class EPUBMakerCmdTest < Test::Unit::TestCase
|
|
23
24
|
end
|
24
25
|
|
25
26
|
def test_epubmaker_cmd
|
26
|
-
|
27
|
-
|
28
|
-
|
27
|
+
if RUBY_VERSION !~ /^1.8/
|
28
|
+
config = prepare_samplebook(@tmpdir1)
|
29
|
+
builddir = @tmpdir1 + "/" + config['bookname'] + '-epub'
|
30
|
+
assert ! File.exist?(builddir)
|
29
31
|
|
30
|
-
|
31
|
-
|
32
|
-
|
32
|
+
ruby_cmd = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
|
33
|
+
Dir.chdir(@tmpdir1) do
|
34
|
+
system("#{ruby_cmd} -S #{REVIEW_EPUBMAKER} config.yml 1>/dev/null 2>/dev/null")
|
35
|
+
end
|
33
36
|
|
34
|
-
|
37
|
+
assert File.exist?(builddir)
|
38
|
+
end
|
35
39
|
end
|
36
40
|
end
|
data/test/test_helper.rb
CHANGED
@@ -8,6 +8,13 @@ def ul_helper(src, expect)
|
|
8
8
|
assert_equal expect, @builder.raw_result
|
9
9
|
end
|
10
10
|
|
11
|
+
def ol_helper(src, expect)
|
12
|
+
io = StringIO.new(src)
|
13
|
+
li = LineInput.new(io)
|
14
|
+
@compiler.__send__(:compile_olist, li)
|
15
|
+
assert_equal expect, @builder.raw_result
|
16
|
+
end
|
17
|
+
|
11
18
|
def builder_helper(src, expect, method_sym)
|
12
19
|
io = StringIO.new(src)
|
13
20
|
li = LineInput.new(io)
|
data/test/test_htmlbuilder.rb
CHANGED
@@ -15,7 +15,6 @@ class HTMLBuidlerTest < Test::Unit::TestCase
|
|
15
15
|
"secnolevel" => 2, # for IDGXMLBuilder, HTMLBuilder
|
16
16
|
"inencoding" => "UTF-8",
|
17
17
|
"outencoding" => "UTF-8",
|
18
|
-
"subdirmode" => nil,
|
19
18
|
"stylesheet" => nil, # for HTMLBuilder
|
20
19
|
}
|
21
20
|
ReVIEW.book.param = @param
|
@@ -25,13 +24,22 @@ class HTMLBuidlerTest < Test::Unit::TestCase
|
|
25
24
|
@builder.bind(@compiler, @chapter, location)
|
26
25
|
end
|
27
26
|
|
27
|
+
def test_xmlns_ops_prefix_epub3
|
28
|
+
ReVIEW.book.param["epubversion"] = 3
|
29
|
+
assert_equal "epub", @builder.xmlns_ops_prefix
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_xmlns_ops_prefix_epub2
|
33
|
+
assert_equal "ops", @builder.xmlns_ops_prefix
|
34
|
+
end
|
35
|
+
|
28
36
|
def test_headline_level1
|
29
37
|
@builder.headline(1,"test","this is test.")
|
30
38
|
assert_equal %Q|<h1 id="test"><a id="h1"></a>第1章 this is test.</h1>\n|, @builder.raw_result
|
31
39
|
end
|
32
40
|
|
33
41
|
def test_headline_level1_without_secno
|
34
|
-
|
42
|
+
ReVIEW.book.param["secnolevel"] = 0
|
35
43
|
@builder.headline(1,"test","this is test.")
|
36
44
|
assert_equal %Q|<h1 id="test"><a id="h1"></a>this is test.</h1>\n|, @builder.raw_result
|
37
45
|
end
|
@@ -52,7 +60,7 @@ class HTMLBuidlerTest < Test::Unit::TestCase
|
|
52
60
|
end
|
53
61
|
|
54
62
|
def test_headline_level3_with_secno
|
55
|
-
|
63
|
+
ReVIEW.book.param["secnolevel"] = 3
|
56
64
|
@builder.headline(3,"test","this is test.")
|
57
65
|
assert_equal %Q|\n<h3 id="test"><a id="h1-0-1"></a>1.0.1 this is test.</h3>\n|, @builder.raw_result
|
58
66
|
end
|
@@ -288,12 +296,22 @@ class HTMLBuidlerTest < Test::Unit::TestCase
|
|
288
296
|
end
|
289
297
|
@builder.list(["test1", "test1.5", "", "test<i>2</i>"], "samplelist", "this is @<b>{test}<&>_")
|
290
298
|
|
291
|
-
|
299
|
+
assert_equal %Q|<div class="caption-code">\n<p class="caption">リスト1.1: this is <b>test</b><&>_</p>\n<pre class="list">test1\ntest1.5\n\ntest<i>2</i>\n</pre>\n</div>\n|, @builder.raw_result
|
300
|
+
end
|
301
|
+
|
302
|
+
def test_list_pygments
|
303
|
+
def @chapter.list(id)
|
304
|
+
Book::ListIndex::Item.new("samplelist",1)
|
305
|
+
end
|
306
|
+
begin
|
292
307
|
require 'pygments'
|
293
|
-
assert_equal %Q|<div class="caption-code">\n<p class="caption">リスト1.1: this is <b>test</b><&>_</p>\n<pre class="list">test1\ntest1.5\n\ntest<span style="color: #666666"><</span>i<span style="color: #666666">>2</</span>i<span style="color: #666666">></span>\n</pre>\n</div>\n|, @builder.raw_result
|
294
308
|
rescue LoadError
|
295
|
-
|
309
|
+
return true
|
296
310
|
end
|
311
|
+
ReVIEW.book.param["pygments"] = true
|
312
|
+
@builder.list(["test1", "test1.5", "", "test<i>2</i>"], "samplelist", "this is @<b>{test}<&>_")
|
313
|
+
|
314
|
+
assert_equal %Q|<div class="caption-code">\n<p class="caption">リスト1.1: this is <b>test</b><&>_</p>\n<pre class="list">test1\ntest1.5\n\ntest<span style="color: #008000; font-weight: bold"><i></span>2<span style="color: #008000; font-weight: bold"></i></span>\n</pre>\n</div>\n|, @builder.raw_result
|
297
315
|
end
|
298
316
|
|
299
317
|
def test_emlist
|
@@ -561,6 +579,21 @@ EOS
|
|
561
579
|
ul_helper(src, expect)
|
562
580
|
end
|
563
581
|
|
582
|
+
def test_ol
|
583
|
+
src =<<-EOS
|
584
|
+
3. AAA
|
585
|
+
3. BBB
|
586
|
+
EOS
|
587
|
+
|
588
|
+
expect =<<-EOS
|
589
|
+
<ol>
|
590
|
+
<li>AAA</li>
|
591
|
+
<li>BBB</li>
|
592
|
+
</ol>
|
593
|
+
EOS
|
594
|
+
ol_helper(src, expect)
|
595
|
+
end
|
596
|
+
|
564
597
|
def test_inline_raw0
|
565
598
|
assert_equal "normal", @builder.inline_raw("normal")
|
566
599
|
end
|