review 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/COPYING +515 -0
  2. data/ChangeLog +1278 -0
  3. data/README.rdoc +21 -0
  4. data/Rakefile +42 -0
  5. data/VERSION +1 -0
  6. data/bin/review-check +190 -0
  7. data/bin/review-checkdep +63 -0
  8. data/bin/review-compile +165 -0
  9. data/bin/review-epubmaker +525 -0
  10. data/bin/review-index +108 -0
  11. data/bin/review-preproc +140 -0
  12. data/bin/review-validate +51 -0
  13. data/bin/review-vol +106 -0
  14. data/doc/format.re +486 -0
  15. data/doc/format.txt +434 -0
  16. data/doc/format_idg.txt +194 -0
  17. data/doc/format_sjis.txt +313 -0
  18. data/doc/sample.css +91 -0
  19. data/doc/sample.yaml +46 -0
  20. data/lib/lineinput.rb +155 -0
  21. data/lib/review/book.rb +580 -0
  22. data/lib/review/builder.rb +274 -0
  23. data/lib/review/compat.rb +22 -0
  24. data/lib/review/compiler.rb +483 -0
  25. data/lib/review/epubbuilder.rb +692 -0
  26. data/lib/review/ewbbuilder.rb +382 -0
  27. data/lib/review/exception.rb +21 -0
  28. data/lib/review/htmlbuilder.rb +370 -0
  29. data/lib/review/htmllayout.rb +19 -0
  30. data/lib/review/htmlutils.rb +27 -0
  31. data/lib/review/idgxmlbuilder.rb +1078 -0
  32. data/lib/review/index.rb +224 -0
  33. data/lib/review/latexbuilder.rb +420 -0
  34. data/lib/review/latexindex.rb +35 -0
  35. data/lib/review/latexutils.rb +52 -0
  36. data/lib/review/preprocessor.rb +520 -0
  37. data/lib/review/textutils.rb +19 -0
  38. data/lib/review/tocparser.rb +333 -0
  39. data/lib/review/tocprinter.rb +220 -0
  40. data/lib/review/topbuilder.rb +572 -0
  41. data/lib/review/unfold.rb +138 -0
  42. data/lib/review/volume.rb +66 -0
  43. data/lib/review.rb +4 -0
  44. data/review.gemspec +93 -0
  45. data/setup.rb +1587 -0
  46. data/test/test_epubbuilder.rb +73 -0
  47. data/test/test_helper.rb +2 -0
  48. data/test/test_htmlbuilder.rb +42 -0
  49. data/test/test_latexbuilder.rb +74 -0
  50. metadata +122 -0
@@ -0,0 +1,73 @@
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|@&lt;tt&gt;{inline}|, ret
72
+ end
73
+ end
@@ -0,0 +1,2 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib/')
2
+ require 'test/unit'
@@ -0,0 +1,42 @@
1
+ require 'test_helper'
2
+ require 'review/compiler'
3
+ require 'review/book'
4
+ require 'review/htmlbuilder'
5
+
6
+ class HTMLBuidlerTest < Test::Unit::TestCase
7
+ include ReVIEW
8
+
9
+ def setup
10
+ @builder = HTMLBuilder.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'>this is test.</h1>\n|, @builder.result
29
+ end
30
+
31
+ def test_headline_level2
32
+ @builder.headline(2,"test","this is test.")
33
+ assert_equal %Q|\n<h2 id='test'>this is test.</h2>\n|, @builder.result
34
+ end
35
+
36
+ def test_headline_level3
37
+ @builder.headline(3,"test","this is test.")
38
+ assert_equal %Q|\n<h3 id='test'>this is test.</h3>\n|, @builder.result
39
+ end
40
+
41
+
42
+ end
@@ -0,0 +1,74 @@
1
+ require 'test_helper'
2
+ require 'review/compiler'
3
+ require 'review/book'
4
+ require 'review/latexbuilder'
5
+
6
+ class LATEXBuidlerTest < Test::Unit::TestCase
7
+ include ReVIEW
8
+
9
+ def setup
10
+ @builder = LATEXBuilder.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|\\chapter{this is test.}\n|, @builder.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|\\chapter*{this is test.}\n|, @builder.result
35
+ end
36
+
37
+ def test_headline_level2
38
+ @builder.headline(2,"test","this is test.")
39
+ assert_equal %Q|\\section{this is test.}\n|, @builder.result
40
+ end
41
+
42
+ def test_headline_level3
43
+ @builder.headline(3,"test","this is test.")
44
+ assert_equal %Q|\\subsection*{this is test.}\n|, @builder.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|\\subsection{this is test.}\n|, @builder.result
52
+ end
53
+
54
+ def test_label
55
+ @builder.label("label_test")
56
+ assert_equal %Q|\\label{label_test}\n|, @builder.result
57
+ end
58
+
59
+ def test_href
60
+ ret = @builder.compile_href("http://github.com", "GitHub")
61
+ assert_equal %Q|\\href{http://github.com}{GitHub}|, ret
62
+ end
63
+
64
+ def test_href_without_label
65
+ ret = @builder.compile_href("http://github.com",nil)
66
+ assert_equal %Q|\\href{http://github.com}{http://github.com}|, ret
67
+ end
68
+
69
+ def test_href_with_underscore
70
+ ret = @builder.compile_href("http://example.com/aaa/bbb", "AAA_BBB")
71
+ assert_equal %Q|\\href{http://example.com/aaa/bbb}{AAA\\symbol{\"5F}BBB}|, ret
72
+ end
73
+
74
+ end
metadata ADDED
@@ -0,0 +1,122 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: review
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 6
8
+ - 0
9
+ version: 0.6.0
10
+ platform: ruby
11
+ authors:
12
+ - kmuto
13
+ - takahashim
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-07-15 00:00:00 +09:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description: ReVIEW is a digital publishing system for books and ebooks. It supports InDesin, EPUB and LaTeX.
23
+ email: kmuto@debian.org
24
+ executables:
25
+ - review-check
26
+ - review-checkdep
27
+ - review-compile
28
+ - review-epubmaker
29
+ - review-index
30
+ - review-preproc
31
+ - review-validate
32
+ - review-vol
33
+ extensions: []
34
+
35
+ extra_rdoc_files:
36
+ - ChangeLog
37
+ - README.rdoc
38
+ files:
39
+ - COPYING
40
+ - ChangeLog
41
+ - README.rdoc
42
+ - Rakefile
43
+ - VERSION
44
+ - bin/review-check
45
+ - bin/review-checkdep
46
+ - bin/review-compile
47
+ - bin/review-epubmaker
48
+ - bin/review-index
49
+ - bin/review-preproc
50
+ - bin/review-validate
51
+ - bin/review-vol
52
+ - doc/format.re
53
+ - doc/format.txt
54
+ - doc/format_idg.txt
55
+ - doc/format_sjis.txt
56
+ - doc/sample.css
57
+ - doc/sample.yaml
58
+ - lib/lineinput.rb
59
+ - lib/review.rb
60
+ - lib/review/book.rb
61
+ - lib/review/builder.rb
62
+ - lib/review/compat.rb
63
+ - lib/review/compiler.rb
64
+ - lib/review/epubbuilder.rb
65
+ - lib/review/ewbbuilder.rb
66
+ - lib/review/exception.rb
67
+ - lib/review/htmlbuilder.rb
68
+ - lib/review/htmllayout.rb
69
+ - lib/review/htmlutils.rb
70
+ - lib/review/idgxmlbuilder.rb
71
+ - lib/review/index.rb
72
+ - lib/review/latexbuilder.rb
73
+ - lib/review/latexindex.rb
74
+ - lib/review/latexutils.rb
75
+ - lib/review/preprocessor.rb
76
+ - lib/review/textutils.rb
77
+ - lib/review/tocparser.rb
78
+ - lib/review/tocprinter.rb
79
+ - lib/review/topbuilder.rb
80
+ - lib/review/unfold.rb
81
+ - lib/review/volume.rb
82
+ - review.gemspec
83
+ - setup.rb
84
+ - test/test_epubbuilder.rb
85
+ - test/test_helper.rb
86
+ - test/test_htmlbuilder.rb
87
+ - test/test_latexbuilder.rb
88
+ has_rdoc: true
89
+ homepage: http://github.com/kmuto/review
90
+ licenses: []
91
+
92
+ post_install_message:
93
+ rdoc_options:
94
+ - --charset=UTF-8
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ segments:
102
+ - 0
103
+ version: "0"
104
+ required_rubygems_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ segments:
109
+ - 0
110
+ version: "0"
111
+ requirements: []
112
+
113
+ rubyforge_project:
114
+ rubygems_version: 1.3.6
115
+ signing_key:
116
+ specification_version: 3
117
+ summary: "ReVIEW: a easy-to-use digital publishing system"
118
+ test_files:
119
+ - test/test_epubbuilder.rb
120
+ - test/test_helper.rb
121
+ - test/test_htmlbuilder.rb
122
+ - test/test_latexbuilder.rb