review 0.6.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +441 -0
- data/README.rdoc +25 -0
- data/Rakefile +13 -1
- data/VERSION +1 -1
- data/bin/review-check +1 -1
- data/bin/review-compile +19 -10
- data/bin/review-epubmaker +114 -17
- data/bin/review-index +8 -1
- data/bin/review-pdfmaker +378 -0
- data/bin/review-preproc +2 -3
- data/bin/review-vol +1 -2
- data/debian/README.Debian +12 -0
- data/debian/README.source +5 -0
- data/debian/changelog +5 -0
- data/debian/compat +1 -0
- data/debian/control +22 -0
- data/debian/copyright +60 -0
- data/debian/docs +5 -0
- data/debian/manpage.1.ex +59 -0
- data/debian/patches/path.diff +91 -0
- data/debian/patches/series +1 -0
- data/debian/review.install +13 -0
- data/debian/review.links +4 -0
- data/debian/rules +13 -0
- data/debian/source/format +1 -0
- data/doc/format.rdoc +477 -0
- data/doc/format.re +19 -0
- data/doc/format_idg.rdoc +180 -0
- data/doc/ruby-uuid/README +11 -0
- data/doc/ruby-uuid/README.ja +34 -0
- data/doc/sample.css +17 -0
- data/doc/sample.yaml +8 -4
- data/lib/lineinput.rb +1 -1
- data/lib/review/book.rb +43 -36
- data/lib/review/builder.rb +78 -33
- data/lib/review/compiler.rb +45 -48
- data/lib/review/epubbuilder.rb +1 -675
- data/lib/review/exception.rb +1 -1
- data/lib/review/htmlbuilder.rb +627 -49
- data/lib/review/htmlutils.rb +5 -0
- data/lib/review/idgxmlbuilder.rb +239 -250
- data/lib/review/index.rb +84 -7
- data/lib/review/latexbuilder.rb +261 -42
- data/lib/review/latexutils.rb +15 -6
- data/lib/review/preprocessor.rb +40 -6
- data/lib/review/textutils.rb +22 -0
- data/lib/review/topbuilder.rb +4 -1
- data/lib/uuid.rb +312 -0
- data/review.gemspec +44 -12
- data/test/CHAPS +2 -0
- data/test/bib.re +13 -0
- data/test/test.re +43 -0
- data/test/test_book.rb +1191 -0
- data/test/test_builder.rb +147 -0
- data/test/test_htmlbuilder.rb +191 -10
- data/test/test_htmlutils.rb +24 -0
- data/test/test_idgxmlbuilder.rb +310 -0
- data/test/test_index.rb +15 -0
- data/test/test_latexbuilder.rb +217 -6
- data/test/test_lineinput.rb +198 -0
- data/test/test_textutils.rb +68 -0
- data/test/test_uuid.rb +156 -0
- metadata +43 -10
- data/doc/format.txt +0 -434
- data/doc/format_idg.txt +0 -194
- data/doc/format_sjis.txt +0 -313
- data/setup.rb +0 -1587
- data/test/test_epubbuilder.rb +0 -73
data/test/test_epubbuilder.rb
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
require 'review/compiler'
|
3
|
-
require 'review/book'
|
4
|
-
require 'review/epubbuilder'
|
5
|
-
|
6
|
-
class EPUBBuidlerTest < Test::Unit::TestCase
|
7
|
-
include ReVIEW
|
8
|
-
|
9
|
-
def setup
|
10
|
-
@builder = EPUBBuilder.new()
|
11
|
-
@param = {
|
12
|
-
"secnolevel" => 2, # for IDGXMLBuilder, EPUBBuilder
|
13
|
-
"inencoding" => "UTF-8",
|
14
|
-
"outencoding" => "UTF-8",
|
15
|
-
"subdirmode" => nil,
|
16
|
-
"stylesheet" => nil, # for EPUBBuilder
|
17
|
-
}
|
18
|
-
compiler = ReVIEW::Compiler.new(@builder)
|
19
|
-
compiler.setParameter(@param)
|
20
|
-
chapter = Chapter.new(nil, 1, '-', nil, StringIO.new)
|
21
|
-
chapter.setParameter(@param)
|
22
|
-
location = Location.new(nil, nil)
|
23
|
-
@builder.bind(compiler, chapter, location)
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_headline_level1
|
27
|
-
@builder.headline(1,"test","this is test.")
|
28
|
-
assert_equal %Q|<h1 id='test'><a id="h1" />第1章 this is test.</h1>\n|, @builder.raw_result
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_headline_level1_without_secno
|
32
|
-
@param["secnolevel"] = 0
|
33
|
-
@builder.headline(1,"test","this is test.")
|
34
|
-
assert_equal %Q|<h1 id='test'><a id="h1" />this is test.</h1>\n|, @builder.raw_result
|
35
|
-
end
|
36
|
-
|
37
|
-
def test_headline_level2
|
38
|
-
@builder.headline(2,"test","this is test.")
|
39
|
-
assert_equal %Q|\n<h2 id='test'><a id="h1-1" />1.1 this is test.</h2>\n|, @builder.raw_result
|
40
|
-
end
|
41
|
-
|
42
|
-
def test_headline_level3
|
43
|
-
@builder.headline(3,"test","this is test.")
|
44
|
-
assert_equal %Q|\n<h3 id='test'><a id="h1-0-1" />this is test.</h3>\n|, @builder.raw_result
|
45
|
-
end
|
46
|
-
|
47
|
-
|
48
|
-
def test_headline_level3_with_secno
|
49
|
-
@param["secnolevel"] = 3
|
50
|
-
@builder.headline(3,"test","this is test.")
|
51
|
-
assert_equal %Q|\n<h3 id='test'><a id="h1-0-1" />1.0.1 this is test.</h3>\n|, @builder.raw_result
|
52
|
-
end
|
53
|
-
|
54
|
-
def test_label
|
55
|
-
@builder.label("label_test")
|
56
|
-
assert_equal %Q|<a id="label_test" />\n|, @builder.raw_result
|
57
|
-
end
|
58
|
-
|
59
|
-
def test_href
|
60
|
-
ret = @builder.compile_href("http://github.com", "GitHub")
|
61
|
-
assert_equal %Q|<a href="http://github.com" class="link">GitHub</a>|, ret
|
62
|
-
end
|
63
|
-
|
64
|
-
def test_href_without_label
|
65
|
-
ret = @builder.compile_href("http://github.com",nil)
|
66
|
-
assert_equal %Q|<a href="http://github.com" class="link">http://github.com</a>|, ret
|
67
|
-
end
|
68
|
-
|
69
|
-
def test_inline_raw
|
70
|
-
ret = @builder.inline_raw("@<tt>{inline}")
|
71
|
-
assert_equal %Q|@<tt>{inline}|, ret
|
72
|
-
end
|
73
|
-
end
|