review 3.2.0 → 4.0.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.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +26 -4
  3. data/.travis.yml +1 -1
  4. data/NEWS.ja.md +97 -1
  5. data/NEWS.md +97 -1
  6. data/bin/review-catalog-converter +1 -1
  7. data/bin/review-check +5 -5
  8. data/bin/review-checkdep +1 -1
  9. data/bin/review-compile +5 -5
  10. data/bin/review-idgxmlmaker +16 -0
  11. data/bin/review-index +7 -7
  12. data/bin/review-preproc +9 -9
  13. data/bin/review-validate +2 -2
  14. data/bin/review-vol +5 -5
  15. data/doc/config.yml.sample +14 -6
  16. data/doc/config.yml.sample-simple +1 -1
  17. data/doc/format.ja.md +15 -5
  18. data/doc/format.md +30 -18
  19. data/doc/pdfmaker.ja.md +1 -1
  20. data/doc/pdfmaker.md +1 -1
  21. data/lib/review/book.rb +1 -1
  22. data/lib/review/book/base.rb +23 -63
  23. data/lib/review/book/chapter.rb +18 -3
  24. data/lib/review/book/compilable.rb +5 -0
  25. data/lib/review/book/index.rb +26 -65
  26. data/lib/review/book/index/item.rb +40 -0
  27. data/lib/review/book/part.rb +22 -2
  28. data/lib/review/builder.rb +60 -40
  29. data/lib/review/catalog.rb +12 -15
  30. data/lib/review/compiler.rb +68 -36
  31. data/lib/review/configure.rb +10 -7
  32. data/lib/review/epubmaker.rb +5 -2
  33. data/lib/review/htmlbuilder.rb +24 -71
  34. data/lib/review/htmlutils.rb +2 -3
  35. data/lib/review/i18n.rb +2 -2
  36. data/lib/review/idgxmlbuilder.rb +101 -55
  37. data/lib/review/idgxmlmaker.rb +184 -0
  38. data/lib/review/init-web/finish.html +10 -0
  39. data/lib/review/init-web/index.html +190 -0
  40. data/lib/review/init-web/review-layout-design.js +691 -0
  41. data/lib/review/init.rb +110 -26
  42. data/lib/review/latexbuilder.rb +76 -54
  43. data/lib/review/lineinput.rb +1 -1
  44. data/lib/review/logger.rb +4 -8
  45. data/lib/review/makerhelper.rb +6 -4
  46. data/lib/review/markdownbuilder.rb +25 -38
  47. data/lib/review/md2inaobuilder.rb +3 -5
  48. data/lib/review/pdfmaker.rb +15 -15
  49. data/lib/review/plaintextbuilder.rb +67 -76
  50. data/lib/review/preprocessor.rb +13 -13
  51. data/lib/review/rstbuilder.rb +31 -31
  52. data/lib/review/textmaker.rb +13 -3
  53. data/lib/review/textutils.rb +77 -2
  54. data/lib/review/tocparser.rb +17 -17
  55. data/lib/review/tocprinter.rb +8 -8
  56. data/lib/review/topbuilder.rb +76 -57
  57. data/lib/review/update.rb +16 -16
  58. data/lib/review/version.rb +1 -1
  59. data/lib/review/webmaker.rb +2 -2
  60. data/lib/review/yamlloader.rb +3 -0
  61. data/review.gemspec +4 -3
  62. data/samples/sample-book/README.md +7 -2
  63. data/samples/sample-book/src/.gitignore +153 -0
  64. data/samples/sample-book/src/config-jlreq.yml +6 -0
  65. data/samples/sample-book/src/lib/tasks/review.rake +20 -9
  66. data/samples/sample-book/src/lib/tasks/z01_copy_sty.rake +14 -8
  67. data/samples/syntax-book/ch03.re +3 -6
  68. data/samples/syntax-book/config-jlreq.yml +5 -0
  69. data/samples/syntax-book/lib/tasks/review.rake +7 -7
  70. data/samples/syntax-book/lib/tasks/z01_copy_sty.rake +14 -8
  71. data/templates/latex/config.erb +6 -0
  72. data/templates/latex/layout.tex.erb +1 -0
  73. data/templates/latex/review-jlreq/review-base.sty +93 -31
  74. data/templates/latex/review-jlreq/review-jlreq.cls +6 -0
  75. data/templates/latex/review-jlreq/review-style.sty +3 -0
  76. data/templates/latex/review-jsbook/README.md +39 -0
  77. data/templates/latex/review-jsbook/review-base.sty +65 -10
  78. data/templates/latex/review-jsbook/review-jsbook.cls +4 -0
  79. data/templates/latex/review-jsbook/review-style.sty +4 -1
  80. data/test/assets/test_template.tex +11 -3
  81. data/test/assets/test_template_backmatter.tex +11 -3
  82. data/test/test_book.rb +65 -19
  83. data/test/test_catalog.rb +18 -42
  84. data/test/test_catalog_converter_cmd.rb +1 -1
  85. data/test/test_epubmaker_cmd.rb +2 -2
  86. data/test/test_helper.rb +1 -1
  87. data/test/test_htmlbuilder.rb +144 -55
  88. data/test/test_i18n.rb +25 -25
  89. data/test/test_idgxmlbuilder.rb +60 -18
  90. data/test/test_image_finder.rb +6 -6
  91. data/test/test_latexbuilder.rb +128 -24
  92. data/test/test_latexbuilder_v2.rb +23 -23
  93. data/test/test_logger.rb +14 -1
  94. data/test/test_makerhelper.rb +3 -3
  95. data/test/test_markdownbuilder.rb +45 -4
  96. data/test/test_md2inaobuilder.rb +12 -2
  97. data/test/test_pdfmaker.rb +1 -1
  98. data/test/test_pdfmaker_cmd.rb +1 -1
  99. data/test/test_plaintextbuilder.rb +31 -6
  100. data/test/test_rstbuilder.rb +33 -4
  101. data/test/test_textutils.rb +109 -2
  102. data/test/test_topbuilder.rb +35 -7
  103. data/test/test_update.rb +17 -8
  104. data/test/test_yamlloader.rb +13 -0
  105. metadata +26 -2
@@ -247,7 +247,7 @@ EOS
247
247
 
248
248
  def test_inline_hd_chap
249
249
  def @chapter.headline_index
250
- items = [Book::HeadlineIndex::Item.new('chap1|test', [1, 1], 'te_st')]
250
+ items = [Book::Index::Item.new('chap1|test', [1, 1], 'te_st')]
251
251
  Book::HeadlineIndex.new(items, self)
252
252
  end
253
253
 
@@ -307,7 +307,7 @@ EOS
307
307
  end
308
308
 
309
309
  def test_dlist
310
- actual = compile_block(": foo\n foo.\n bar.\n")
310
+ actual = compile_block(" : foo\n foo.\n bar.\n")
311
311
  expected = <<-EOS
312
312
 
313
313
  \\begin{description}
@@ -315,12 +315,23 @@ EOS
315
315
  foo.
316
316
  bar.
317
317
  \\end{description}
318
+ EOS
319
+ assert_equal expected, actual
320
+
321
+ @book.config['join_lines_by_lang'] = true
322
+ actual = compile_block(" : foo\n foo.\n bar.\n")
323
+ expected = <<-EOS
324
+
325
+ \\begin{description}
326
+ \\item[foo] \\mbox{} \\\\
327
+ foo. bar.
328
+ \\end{description}
318
329
  EOS
319
330
  assert_equal expected, actual
320
331
  end
321
332
 
322
333
  def test_dlist_with_bracket
323
- actual = compile_block(": foo[bar]\n foo.\n bar.\n")
334
+ actual = compile_block(" : foo[bar]\n foo.\n bar.\n")
324
335
  expected = <<-EOS
325
336
 
326
337
  \\begin{description}
@@ -328,6 +339,17 @@ EOS
328
339
  foo.
329
340
  bar.
330
341
  \\end{description}
342
+ EOS
343
+ assert_equal expected, actual
344
+
345
+ @book.config['join_lines_by_lang'] = true
346
+ actual = compile_block(" : foo[bar]\n foo.\n bar.\n")
347
+ expected = <<-EOS
348
+
349
+ \\begin{description}
350
+ \\item[foo\\lbrack{}bar\\rbrack{}] \\mbox{} \\\\
351
+ foo. bar.
352
+ \\end{description}
331
353
  EOS
332
354
  assert_equal expected, actual
333
355
  end
@@ -706,6 +728,18 @@ EOS
706
728
  \\begin{quote}
707
729
  foobar
708
730
 
731
+ buz
732
+ \\end{quote}
733
+ EOS
734
+ assert_equal expected, actual
735
+
736
+ @book.config['join_lines_by_lang'] = true
737
+ actual = compile_block("//quote{\nfoo\nbar\n\nbuz\n//}\n")
738
+ expected = <<-EOS
739
+
740
+ \\begin{quote}
741
+ foo bar
742
+
709
743
  buz
710
744
  \\end{quote}
711
745
  EOS
@@ -731,6 +765,18 @@ EOS
731
765
  \\begin{flushright}
732
766
  foobar
733
767
 
768
+ buz
769
+ \\end{flushright}
770
+ EOS
771
+ assert_equal expected, actual
772
+
773
+ @book.config['join_lines_by_lang'] = true
774
+ actual = compile_block("//flushright{\nfoo\nbar\n\nbuz\n//}\n")
775
+ expected = <<-EOS
776
+
777
+ \\begin{flushright}
778
+ foo bar
779
+
734
780
  buz
735
781
  \\end{flushright}
736
782
  EOS
@@ -744,6 +790,18 @@ EOS
744
790
  \\begin{center}
745
791
  foobar
746
792
 
793
+ buz
794
+ \\end{center}
795
+ EOS
796
+ assert_equal expected, actual
797
+
798
+ @book.config['join_lines_by_lang'] = true
799
+ actual = compile_block("//centering{\nfoo\nbar\n\nbuz\n//}\n")
800
+ expected = <<-EOS
801
+
802
+ \\begin{center}
803
+ foo bar
804
+
747
805
  buz
748
806
  \\end{center}
749
807
  EOS
@@ -769,13 +827,23 @@ bar
769
827
 
770
828
  foo2
771
829
  bar2
830
+ EOS
831
+ assert_equal expected, actual
832
+
833
+ @book.config['join_lines_by_lang'] = true
834
+ actual = compile_block("//noindent\nfoo\nbar\n\nfoo2\nbar2\n")
835
+ expected = <<-EOS
836
+ \\noindent
837
+ foo bar
838
+
839
+ foo2 bar2
772
840
  EOS
773
841
  assert_equal expected, actual
774
842
  end
775
843
 
776
844
  def test_image
777
845
  def @chapter.image(_id)
778
- item = Book::ImageIndex::Item.new('sampleimg', 1)
846
+ item = Book::Index::Item.new('sampleimg', 1)
779
847
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
780
848
  item
781
849
  end
@@ -793,7 +861,7 @@ EOS
793
861
 
794
862
  def test_image_with_metric
795
863
  def @chapter.image(_id)
796
- item = Book::ImageIndex::Item.new('sampleimg', 1)
864
+ item = Book::Index::Item.new('sampleimg', 1)
797
865
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
798
866
  item
799
867
  end
@@ -811,7 +879,7 @@ EOS
811
879
 
812
880
  def test_image_with_metric_width
813
881
  def @chapter.image(_id)
814
- item = Book::ImageIndex::Item.new('sampleimg', 1)
882
+ item = Book::Index::Item.new('sampleimg', 1)
815
883
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
816
884
  item
817
885
  end
@@ -830,7 +898,7 @@ EOS
830
898
 
831
899
  def test_image_with_metric2
832
900
  def @chapter.image(_id)
833
- item = Book::ImageIndex::Item.new('sampleimg', 1)
901
+ item = Book::Index::Item.new('sampleimg', 1)
834
902
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
835
903
  item
836
904
  end
@@ -848,7 +916,7 @@ EOS
848
916
 
849
917
  def test_image_with_metric2_width
850
918
  def @chapter.image(_id)
851
- item = Book::ImageIndex::Item.new('sampleimg', 1)
919
+ item = Book::Index::Item.new('sampleimg', 1)
852
920
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
853
921
  item
854
922
  end
@@ -867,7 +935,7 @@ EOS
867
935
 
868
936
  def test_indepimage
869
937
  def @chapter.image(_id)
870
- item = Book::ImageIndex::Item.new('sampleimg', 1)
938
+ item = Book::Index::Item.new('sampleimg', 1)
871
939
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
872
940
  item
873
941
  end
@@ -884,7 +952,7 @@ EOS
884
952
 
885
953
  def test_indepimage_without_caption
886
954
  def @chapter.image(_id)
887
- item = Book::ImageIndex::Item.new('sampleimg', 1)
955
+ item = Book::Index::Item.new('sampleimg', 1)
888
956
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
889
957
  item
890
958
  end
@@ -901,7 +969,7 @@ EOS
901
969
 
902
970
  def test_indepimage_with_metric
903
971
  def @chapter.image(_id)
904
- item = Book::ImageIndex::Item.new('sampleimg', 1)
972
+ item = Book::Index::Item.new('sampleimg', 1)
905
973
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
906
974
  item
907
975
  end
@@ -918,7 +986,7 @@ EOS
918
986
 
919
987
  def test_indepimage_with_metric_width
920
988
  def @chapter.image(_id)
921
- item = Book::ImageIndex::Item.new('sampleimg', 1)
989
+ item = Book::Index::Item.new('sampleimg', 1)
922
990
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
923
991
  item
924
992
  end
@@ -936,7 +1004,7 @@ EOS
936
1004
 
937
1005
  def test_indepimage_with_metric2
938
1006
  def @chapter.image(_id)
939
- item = Book::ImageIndex::Item.new('sampleimg', 1)
1007
+ item = Book::Index::Item.new('sampleimg', 1)
940
1008
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
941
1009
  item
942
1010
  end
@@ -953,7 +1021,7 @@ EOS
953
1021
 
954
1022
  def test_indepimage_without_caption_but_with_metric
955
1023
  def @chapter.image(_id)
956
- item = Book::ImageIndex::Item.new('sampleimg', 1)
1024
+ item = Book::Index::Item.new('sampleimg', 1)
957
1025
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
958
1026
  item
959
1027
  end
@@ -1107,7 +1175,7 @@ EOS
1107
1175
 
1108
1176
  def test_imgtable
1109
1177
  def @chapter.image(_id)
1110
- item = Book::ImageIndex::Item.new('sampleimg', 1, 'sample img')
1178
+ item = Book::Index::Item.new('sampleimg', 1, 'sample img')
1111
1179
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
1112
1180
  item
1113
1181
  end
@@ -1128,7 +1196,7 @@ EOS
1128
1196
 
1129
1197
  def test_bib
1130
1198
  def @chapter.bibpaper(_id)
1131
- Book::BibpaperIndex::Item.new('samplebib', 1, 'sample bib')
1199
+ Book::Index::Item.new('samplebib', 1, 'sample bib')
1132
1200
  end
1133
1201
 
1134
1202
  assert_equal '\\reviewbibref{[1]}{bib:samplebib}', compile_inline('@<bib>{samplebib}')
@@ -1136,7 +1204,7 @@ EOS
1136
1204
 
1137
1205
  def test_bibpaper
1138
1206
  def @chapter.bibpaper(_id)
1139
- Book::BibpaperIndex::Item.new('samplebib', 1, 'sample bib')
1207
+ Book::Index::Item.new('samplebib', 1, 'sample bib')
1140
1208
  end
1141
1209
 
1142
1210
  actual = compile_block("//bibpaper[samplebib][sample bib @<b>{bold}]{\na\nb\n//}\n")
@@ -1146,13 +1214,24 @@ EOS
1146
1214
 
1147
1215
  ab
1148
1216
 
1217
+ EOS
1218
+ assert_equal expected, actual
1219
+
1220
+ @book.config['join_lines_by_lang'] = true
1221
+ actual = compile_block("//bibpaper[samplebib][sample bib @<b>{bold}]{\na\nb\n//}\n")
1222
+ expected = <<-EOS
1223
+ [1] sample bib \\reviewbold{bold}
1224
+ \\label{bib:samplebib}
1225
+
1226
+ a b
1227
+
1149
1228
  EOS
1150
1229
  assert_equal expected, actual
1151
1230
  end
1152
1231
 
1153
1232
  def test_bibpaper_without_body
1154
1233
  def @chapter.bibpaper(_id)
1155
- Book::BibpaperIndex::Item.new('samplebib', 1, 'sample bib')
1234
+ Book::Index::Item.new('samplebib', 1, 'sample bib')
1156
1235
  end
1157
1236
 
1158
1237
  actual = compile_block("//bibpaper[samplebib][sample bib]\n")
@@ -1284,6 +1363,17 @@ EOS
1284
1363
  \\item BBB
1285
1364
  {-}BB
1286
1365
  \\end{itemize}
1366
+ EOS
1367
+ actual = compile_block(src)
1368
+ assert_equal expected, actual
1369
+
1370
+ @book.config['join_lines_by_lang'] = true
1371
+ expected = <<-EOS
1372
+
1373
+ \\begin{itemize}
1374
+ \\item AAA {-}AA
1375
+ \\item BBB {-}BB
1376
+ \\end{itemize}
1287
1377
  EOS
1288
1378
  actual = compile_block(src)
1289
1379
  assert_equal expected, actual
@@ -1305,6 +1395,20 @@ EOS
1305
1395
  1\\\\
1306
1396
  {-}BB
1307
1397
  \\end{itemize}
1398
+ EOS
1399
+ actual = compile_block(src)
1400
+ assert_equal expected, actual
1401
+
1402
+ @book.config['join_lines_by_lang'] = true
1403
+ expected = <<-EOS
1404
+
1405
+ \\begin{itemize}
1406
+ \\item AAA\\\\
1407
+ {-}AA
1408
+ \\item BBB\\\\
1409
+ 1\\\\
1410
+ {-}BB
1411
+ \\end{itemize}
1308
1412
  EOS
1309
1413
  actual = compile_block(src)
1310
1414
  assert_equal expected, actual
@@ -1530,24 +1634,24 @@ EOS
1530
1634
 
1531
1635
  def test_inline_imgref
1532
1636
  def @chapter.image(_id)
1533
- item = Book::ImageIndex::Item.new('sampleimg', 1, 'sample photo')
1637
+ item = Book::Index::Item.new('sampleimg', 1, 'sample photo')
1534
1638
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
1535
1639
  item
1536
1640
  end
1537
1641
 
1538
- actual = compile_block "@<imgref>{sampleimg}\n"
1642
+ actual = compile_block("@<imgref>{sampleimg}\n")
1539
1643
  expected = "\n\\reviewimageref{1.1}{image:chap1:sampleimg}「sample photo」\n"
1540
1644
  assert_equal expected, actual
1541
1645
  end
1542
1646
 
1543
1647
  def test_inline_imgref2
1544
1648
  def @chapter.image(_id)
1545
- item = Book::NumberlessImageIndex::Item.new('sampleimg', 1)
1649
+ item = Book::Index::Item.new('sampleimg', 1)
1546
1650
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
1547
1651
  item
1548
1652
  end
1549
1653
 
1550
- actual = compile_block "@<imgref>{sampleimg}\n"
1654
+ actual = compile_block("@<imgref>{sampleimg}\n")
1551
1655
  expected = "\n\\reviewimageref{1.1}{image:chap1:sampleimg}\n"
1552
1656
  assert_equal expected, actual
1553
1657
  end
@@ -1631,7 +1735,7 @@ EOB
1631
1735
  foo bar"\\reviewbackslash{}\\textless{}\\textgreater{}\\textunderscore{}@\\textless{}b\\textgreater{}\\{BAZ\\} \\reviewbold{bar"\\reviewbackslash{}\\textless{}\\textgreater{}\\textunderscore{}@\\textless{}b\\textgreater{}\\{BAZ\\}} [missing word: N]
1632
1736
  EOS
1633
1737
  assert_equal expected, actual
1634
- assert_match(/WARN -- : :1: word not bound: N/, io.string)
1738
+ assert_match(/WARN --: :1: word not bound: N/, io.string)
1635
1739
  end
1636
1740
  end
1637
1741
 
@@ -1714,7 +1818,7 @@ EOS
1714
1818
  end
1715
1819
 
1716
1820
  def @chapter.image(_id)
1717
- item = Book::NumberlessImageIndex::Item.new('sampleimg', 1)
1821
+ item = Book::Index::Item.new('sampleimg', 1)
1718
1822
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
1719
1823
  item
1720
1824
  end
@@ -221,7 +221,7 @@ EOS
221
221
 
222
222
  def test_inline_hd_chap
223
223
  def @chapter.headline_index
224
- items = [Book::HeadlineIndex::Item.new('chap1|test', [1, 1], 'te_st')]
224
+ items = [Book::Index::Item.new('chap1|test', [1, 1], 'te_st')]
225
225
  Book::HeadlineIndex.new(items, self)
226
226
  end
227
227
 
@@ -276,7 +276,7 @@ EOS
276
276
  end
277
277
 
278
278
  def test_dlist
279
- actual = compile_block(": foo\n foo.\n bar.\n")
279
+ actual = compile_block(" : foo\n foo.\n bar.\n")
280
280
  expected = <<-EOS
281
281
 
282
282
  \\begin{description}
@@ -289,7 +289,7 @@ EOS
289
289
  end
290
290
 
291
291
  def test_dlist_with_bracket
292
- actual = compile_block(": foo[bar]\n foo.\n bar.\n")
292
+ actual = compile_block(" : foo[bar]\n foo.\n bar.\n")
293
293
  expected = <<-EOS
294
294
 
295
295
  \\begin{description}
@@ -719,7 +719,7 @@ EOS
719
719
 
720
720
  def test_image
721
721
  def @chapter.image(_id)
722
- item = Book::ImageIndex::Item.new('sampleimg', 1)
722
+ item = Book::Index::Item.new('sampleimg', 1)
723
723
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
724
724
  item
725
725
  end
@@ -737,7 +737,7 @@ EOS
737
737
 
738
738
  def test_image_with_metric
739
739
  def @chapter.image(_id)
740
- item = Book::ImageIndex::Item.new('sampleimg', 1)
740
+ item = Book::Index::Item.new('sampleimg', 1)
741
741
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
742
742
  item
743
743
  end
@@ -755,7 +755,7 @@ EOS
755
755
 
756
756
  def test_image_with_metric_width
757
757
  def @chapter.image(_id)
758
- item = Book::ImageIndex::Item.new('sampleimg', 1)
758
+ item = Book::Index::Item.new('sampleimg', 1)
759
759
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
760
760
  item
761
761
  end
@@ -774,7 +774,7 @@ EOS
774
774
 
775
775
  def test_image_with_metric2
776
776
  def @chapter.image(_id)
777
- item = Book::ImageIndex::Item.new('sampleimg', 1)
777
+ item = Book::Index::Item.new('sampleimg', 1)
778
778
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
779
779
  item
780
780
  end
@@ -792,7 +792,7 @@ EOS
792
792
 
793
793
  def test_image_with_metric2_width
794
794
  def @chapter.image(_id)
795
- item = Book::ImageIndex::Item.new('sampleimg', 1)
795
+ item = Book::Index::Item.new('sampleimg', 1)
796
796
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
797
797
  item
798
798
  end
@@ -811,7 +811,7 @@ EOS
811
811
 
812
812
  def test_indepimage
813
813
  def @chapter.image(_id)
814
- item = Book::ImageIndex::Item.new('sampleimg', 1)
814
+ item = Book::Index::Item.new('sampleimg', 1)
815
815
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
816
816
  item
817
817
  end
@@ -828,7 +828,7 @@ EOS
828
828
 
829
829
  def test_indepimage_without_caption
830
830
  def @chapter.image(_id)
831
- item = Book::ImageIndex::Item.new('sampleimg', 1)
831
+ item = Book::Index::Item.new('sampleimg', 1)
832
832
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
833
833
  item
834
834
  end
@@ -845,7 +845,7 @@ EOS
845
845
 
846
846
  def test_indepimage_with_metric
847
847
  def @chapter.image(_id)
848
- item = Book::ImageIndex::Item.new('sampleimg', 1)
848
+ item = Book::Index::Item.new('sampleimg', 1)
849
849
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
850
850
  item
851
851
  end
@@ -862,7 +862,7 @@ EOS
862
862
 
863
863
  def test_indepimage_with_metric_width
864
864
  def @chapter.image(_id)
865
- item = Book::ImageIndex::Item.new('sampleimg', 1)
865
+ item = Book::Index::Item.new('sampleimg', 1)
866
866
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
867
867
  item
868
868
  end
@@ -880,7 +880,7 @@ EOS
880
880
 
881
881
  def test_indepimage_with_metric2
882
882
  def @chapter.image(_id)
883
- item = Book::ImageIndex::Item.new('sampleimg', 1)
883
+ item = Book::Index::Item.new('sampleimg', 1)
884
884
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
885
885
  item
886
886
  end
@@ -897,7 +897,7 @@ EOS
897
897
 
898
898
  def test_indepimage_without_caption_but_with_metric
899
899
  def @chapter.image(_id)
900
- item = Book::ImageIndex::Item.new('sampleimg', 1)
900
+ item = Book::Index::Item.new('sampleimg', 1)
901
901
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
902
902
  item
903
903
  end
@@ -1008,7 +1008,7 @@ EOS
1008
1008
 
1009
1009
  def test_imgtable
1010
1010
  def @chapter.image(_id)
1011
- item = Book::ImageIndex::Item.new('sampleimg', 1, 'sample img')
1011
+ item = Book::Index::Item.new('sampleimg', 1, 'sample img')
1012
1012
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
1013
1013
  item
1014
1014
  end
@@ -1029,7 +1029,7 @@ EOS
1029
1029
 
1030
1030
  def test_bib
1031
1031
  def @chapter.bibpaper(_id)
1032
- Book::BibpaperIndex::Item.new('samplebib', 1, 'sample bib')
1032
+ Book::Index::Item.new('samplebib', 1, 'sample bib')
1033
1033
  end
1034
1034
 
1035
1035
  assert_equal '\\reviewbibref{[1]}{bib:samplebib}', compile_inline('@<bib>{samplebib}')
@@ -1037,7 +1037,7 @@ EOS
1037
1037
 
1038
1038
  def test_bibpaper
1039
1039
  def @chapter.bibpaper(_id)
1040
- Book::BibpaperIndex::Item.new('samplebib', 1, 'sample bib')
1040
+ Book::Index::Item.new('samplebib', 1, 'sample bib')
1041
1041
  end
1042
1042
 
1043
1043
  actual = compile_block("//bibpaper[samplebib][sample bib @<b>{bold}]{\na\nb\n//}\n")
@@ -1053,7 +1053,7 @@ EOS
1053
1053
 
1054
1054
  def test_bibpaper_without_body
1055
1055
  def @chapter.bibpaper(_id)
1056
- Book::BibpaperIndex::Item.new('samplebib', 1, 'sample bib')
1056
+ Book::Index::Item.new('samplebib', 1, 'sample bib')
1057
1057
  end
1058
1058
 
1059
1059
  actual = compile_block("//bibpaper[samplebib][sample bib]\n")
@@ -1424,24 +1424,24 @@ EOS
1424
1424
 
1425
1425
  def test_inline_imgref
1426
1426
  def @chapter.image(_id)
1427
- item = Book::ImageIndex::Item.new('sampleimg', 1, 'sample photo')
1427
+ item = Book::Index::Item.new('sampleimg', 1, 'sample photo')
1428
1428
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
1429
1429
  item
1430
1430
  end
1431
1431
 
1432
- actual = compile_block "@<imgref>{sampleimg}\n"
1432
+ actual = compile_block("@<imgref>{sampleimg}\n")
1433
1433
  expected = "\n\\reviewimageref{1.1}{image:chap1:sampleimg}「sample photo」\n"
1434
1434
  assert_equal expected, actual
1435
1435
  end
1436
1436
 
1437
1437
  def test_inline_imgref2
1438
1438
  def @chapter.image(_id)
1439
- item = Book::NumberlessImageIndex::Item.new('sampleimg', 1)
1439
+ item = Book::Index::Item.new('sampleimg', 1)
1440
1440
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
1441
1441
  item
1442
1442
  end
1443
1443
 
1444
- actual = compile_block "@<imgref>{sampleimg}\n"
1444
+ actual = compile_block("@<imgref>{sampleimg}\n")
1445
1445
  expected = "\n\\reviewimageref{1.1}{image:chap1:sampleimg}\n"
1446
1446
  assert_equal expected, actual
1447
1447
  end
@@ -1580,7 +1580,7 @@ EOS
1580
1580
  end
1581
1581
 
1582
1582
  def @chapter.image(_id)
1583
- item = Book::NumberlessImageIndex::Item.new('sampleimg', 1)
1583
+ item = Book::Index::Item.new('sampleimg', 1)
1584
1584
  item.instance_eval { @path = './images/chap1-sampleimg.png' }
1585
1585
  item
1586
1586
  end