review 2.5.0 → 3.0.0.preview1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +28 -10
  3. data/.travis.yml +11 -2
  4. data/NEWS.ja.md +89 -17
  5. data/NEWS.md +92 -0
  6. data/README.md +1 -1
  7. data/Rakefile +0 -13
  8. data/bin/review-catalog-converter +83 -37
  9. data/bin/review-check +17 -5
  10. data/bin/review-compile +1 -1
  11. data/bin/review-index +6 -0
  12. data/bin/review-init +3 -155
  13. data/bin/review-preproc +0 -5
  14. data/bin/review-validate +21 -7
  15. data/bin/review-vol +13 -5
  16. data/doc/config.yml.sample +12 -7
  17. data/doc/config.yml.sample-simple +1 -1
  18. data/doc/format.ja.md +39 -3
  19. data/doc/format.md +39 -3
  20. data/doc/format_idg.ja.md +0 -4
  21. data/doc/pdfmaker.ja.md +1 -1
  22. data/doc/pdfmaker.md +1 -1
  23. data/doc/sample.css +7 -0
  24. data/lib/epubmaker/content.rb +31 -12
  25. data/lib/epubmaker/epubcommon.rb +10 -3
  26. data/lib/epubmaker/epubv2.rb +11 -3
  27. data/lib/epubmaker/epubv3.rb +11 -3
  28. data/lib/epubmaker/producer.rb +55 -20
  29. data/lib/review/book/base.rb +63 -48
  30. data/lib/review/book/chapter.rb +19 -7
  31. data/lib/review/book/compilable.rb +5 -20
  32. data/lib/review/book/image_finder.rb +10 -3
  33. data/lib/review/book/index.rb +30 -9
  34. data/lib/review/book/part.rb +9 -6
  35. data/lib/review/book.rb +0 -14
  36. data/lib/review/builder.rb +110 -18
  37. data/lib/review/catalog.rb +24 -4
  38. data/lib/review/compiler.rb +3 -1
  39. data/lib/review/configure.rb +43 -9
  40. data/lib/review/epubmaker/reviewheaderlistener.rb +57 -0
  41. data/lib/review/epubmaker.rb +129 -85
  42. data/lib/review/htmlbuilder.rb +76 -58
  43. data/lib/review/htmlutils.rb +20 -13
  44. data/lib/review/i18n.rb +6 -2
  45. data/lib/review/idgxmlbuilder.rb +52 -41
  46. data/lib/review/init.rb +194 -0
  47. data/lib/review/latexbuilder.rb +118 -34
  48. data/lib/review/latexutils.rb +5 -5
  49. data/lib/review/logger.rb +2 -1
  50. data/lib/review/makerhelper.rb +1 -1
  51. data/lib/review/markdownbuilder.rb +66 -6
  52. data/lib/review/md2inaobuilder.rb +2 -2
  53. data/lib/review/pdfmaker.rb +74 -22
  54. data/lib/review/plaintextbuilder.rb +8 -4
  55. data/lib/review/preprocessor.rb +14 -17
  56. data/lib/review/sec_counter.rb +8 -2
  57. data/lib/review/textmaker.rb +2 -2
  58. data/lib/review/textutils.rb +9 -2
  59. data/lib/review/tocparser.rb +7 -4
  60. data/lib/review/tocprinter.rb +3 -1
  61. data/lib/review/version.rb +1 -1
  62. data/lib/review/webmaker.rb +19 -7
  63. data/lib/review/webtocprinter.rb +8 -4
  64. data/review.gemspec +4 -3
  65. data/templates/latex/config.erb +84 -0
  66. data/templates/latex/layout.tex.erb +76 -361
  67. data/templates/latex/review-jlreq/README.md +22 -0
  68. data/templates/latex/review-jlreq/review-base.sty +178 -0
  69. data/templates/latex/review-jlreq/review-custom.sty +1 -0
  70. data/templates/latex/review-jlreq/review-jlreq.cls +141 -0
  71. data/templates/latex/review-jlreq/review-style.sty +149 -0
  72. data/templates/latex/review-jlreq/reviewmacro.sty +8 -0
  73. data/templates/latex/review-jsbook/jumoline.sty +310 -0
  74. data/templates/latex/review-jsbook/plistings.sty +326 -0
  75. data/templates/latex/review-jsbook/review-base.sty +405 -0
  76. data/templates/latex/review-jsbook/review-custom.sty +1 -0
  77. data/templates/latex/review-jsbook/review-style.sty +38 -0
  78. data/templates/latex/review-jsbook/reviewmacro.sty +8 -0
  79. data/templates/latex-compat2/layout.tex.erb +387 -0
  80. data/test/assets/test_template.tex +105 -235
  81. data/test/assets/test_template_backmatter.tex +133 -14
  82. data/test/book_test_helper.rb +1 -1
  83. data/test/run_test.rb +2 -0
  84. data/test/sample-book/src/Rakefile +11 -6
  85. data/test/sample-book/src/config.yml +2 -2
  86. data/test/sample-book/src/sty/reviewmacro.sty +1 -39
  87. data/test/sample-book/src/style.css +6 -0
  88. data/test/syntax-book/config.yml +1 -1
  89. data/test/test_book.rb +13 -16
  90. data/test/test_book_chapter.rb +4 -10
  91. data/test/test_book_part.rb +4 -3
  92. data/test/test_catalog.rb +15 -4
  93. data/test/test_helper.rb +2 -2
  94. data/test/test_htmlbuilder.rb +78 -10
  95. data/test/test_htmlutils.rb +12 -5
  96. data/test/test_idgxmlbuilder.rb +1 -1
  97. data/test/test_latexbuilder.rb +94 -49
  98. data/test/test_latexbuilder_v2.rb +1077 -0
  99. data/test/test_logger.rb +20 -0
  100. data/test/test_markdownbuilder.rb +10 -0
  101. data/test/test_pdfmaker.rb +6 -7
  102. data/test/test_plaintextbuilder.rb +1 -1
  103. data/test/test_review_ext.rb +0 -1
  104. data/test/test_rstbuilder.rb +1 -1
  105. data/test/test_topbuilder.rb +19 -7
  106. data/test/test_webtocprinter.rb +14 -14
  107. data/{test/sample-book/src/vendor → vendor}/jumoline/README +0 -0
  108. data/{test/sample-book/src/vendor → vendor}/jumoline/jumoline.dtx +0 -0
  109. data/{test/sample-book/src/vendor → vendor}/jumoline/jumoline.ins +0 -0
  110. data/{test/sample-book/src/vendor → vendor}/jumoline/lppl.txt +0 -0
  111. data/vendor/plistings/.gitignore +9 -0
  112. data/vendor/plistings/LICENSE +21 -0
  113. data/vendor/plistings/README.md +18 -0
  114. data/vendor/plistings/plistings.sty +326 -0
  115. data/vendor/plistings/test1.tex +174 -0
  116. data/vendor/plistings/test2.tex +54 -0
  117. metadata +48 -19
  118. data/lib/review/unfold.rb +0 -129
  119. data/test/CHAPS +0 -2
  120. data/test/bib.re +0 -13
  121. data/test/test.re +0 -43
@@ -0,0 +1,174 @@
1
+ %#!ptex2pdf -l -e -u test1.tex
2
+ \ifdefined\directlua
3
+ \documentclass{ltjarticle}
4
+ \usepackage{listings,xcolor}
5
+ \else
6
+ \documentclass[dvipdfmx]{ujarticle}
7
+ \usepackage{plistings,xcolor}
8
+ \def\zw{zw}
9
+ \fi
10
+ \usepackage{amsmath,showexpl,comment}
11
+ \usepackage
12
+ [
13
+ papersize={100mm,100mm},
14
+ hmargin={5mm,5mm},
15
+ vmargin={5mm,5mm}
16
+ ]{geometry}
17
+ \pagestyle{empty}
18
+
19
+ \lstset
20
+ {
21
+ language=sh, extendedchars=false,
22
+ backgroundcolor=\color[gray]{.75},
23
+ breaklines=true,
24
+ explpreset={columns=fixed},
25
+ basewidth={0.5\zw, 0.45em},
26
+ numbers=left,numberstyle=\tiny, numbersep=2pt,
27
+ }
28
+
29
+ \lstnewenvironment{env}[1]
30
+ {
31
+ \ifx\relax#1\else
32
+ \renewcommand{\lstlistingname}{ex}
33
+ \lstset
34
+ {
35
+ caption=#1,
36
+ }
37
+ \fi
38
+ }{}
39
+ \def\rmdefault{qpl}
40
+ \def\ttdefault{qcr}
41
+ \def\cs#1{\hbox{\texttt{\textbackslash #1}}}
42
+ \begin{document}
43
+
44
+ This test file is based on a.tex\footnote{This can be downloaded from {\tt https://gist.github.com/1574793}.} by x19290.
45
+
46
+
47
+ \textbf{SOLVED}: bad folding and not slanted problems are common in pLaTeX and LuaTeX-ja.
48
+
49
+ The cause of the latter problem is that Japanese fonts don't have italic shape by default.
50
+ In this document, we define them by
51
+ \begin{lstlisting}[language={[AlLaTeX]TeX}, basicstyle=\ttfamily]
52
+ \DeclareFontShape{JY3}{mc}{m}{sl}{<-> s * [0.92489] psft:Ryumin-Light:jfm=ujis;slant=0.167}{}
53
+ \DeclareFontShape{JY3}{mc}{m}{it}{<-> ssub* mc/m/sl}{}
54
+ \end{lstlisting}
55
+
56
+ \newpage
57
+
58
+ We also avoid white band problem, by setting the value of \cs{lineskiplimit} to
59
+ \begin{multline}
60
+ -\min(\cs{cht}-\cs{ht}\cs{strutbox}, 0)\\
61
+ -\min(\cs{cdp}-\cs{dp}\cs{strutbox}, 0).
62
+ \end{multline}
63
+
64
+ Note: we still have a white band if the first line is line-broken.
65
+
66
+ \begin{env}{\relax}aa
67
+ #!/bin/sh
68
+ #長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い
69
+ #超長い長い長い長い長い長い長い長い長い長い長い長い長い,長い長い長い長い長い長い
70
+ #長い長い長い長い長い長い長い長い長い長い長い長い,長い長い長い長い長い長い
71
+ #I.長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長いI
72
+ 長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い
73
+ #IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII
74
+ IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII
75
+ \end{env}
76
+
77
+ \newpage
78
+
79
+ \textbf{SOLVED}: LuaTeX-ja specific problem:
80
+ when the \emph{begin} line of a listings environment ends with JAchar,
81
+ the first line of the listing is not rendered.
82
+
83
+ \begin{env}{problem; shebang not rendered --- 問題}
84
+ #!/bin/bash
85
+ :
86
+ \end{env}
87
+
88
+ \begin{LTXexample}[language=TeX]
89
+ え!1あ,い・あ)う(え
90
+ え!2あ
91
+ \end{LTXexample}
92
+
93
+ \begin{lstlisting}
94
+ え!1あアイウエオ
95
+ え!2あ
96
+ \end{lstlisting}
97
+ \newpage
98
+ \textbf{Ticket \#29311}
99
+
100
+ \begin{env}{\relax}
101
+ 長い長い長い長い長い長い長い長い長い長い長い長aaa長い::い長い
102
+ 長い長い長い長い長い長い長い長い長い長い長い長aaaa長い::い長い
103
+ 長い長い長い長い長い長い長い長い長い長い長い長い長い,長い長い
104
+ あ長い長い長い長い長い長い長い長い長い長い長い長い長い,長い長い
105
+ 長い長い長い長い長い長い長い長い長い長い長い長い長a,::い長い
106
+ 長い長い長い長い長い長い長い長い長い長い長い長い長aa,::い長い
107
+ 長い長い長い長い長い長い長い長い長い長い長い長い長aaa,::い長い
108
+ 長い長い長い長い長い長い長い長い長い長い長い長い長aaaa,::い長い
109
+ 長い長い長い長い長い長い長い長い長い長い長い長い長い,,::い長い
110
+ 長い長い長い長い長い長い長い長い長い長い長い長(い長い
111
+ 長い長い長い長い長い長い長い長い長い長い長いaa(い長い
112
+ 長い長い長い長い長い長い長い長い長い長い長い長(aa長い
113
+ 長い長い長い長い長い長い長い長い長い長い長い長い)(長い
114
+ あ長い長い長い長い長い長い長い長い長い長い長い長い)(長い
115
+ \end{env}
116
+
117
+ 下の行において,最初の「1」の場所がずれてしまうのは半ば仕方がないとも言える.
118
+ 1行目では,「1234567890」が前後・文字間に計11箇所の等量の空白を入れて10全角の領域に
119
+ 出力されているのに対し,2,~3行目では「1」が全角幅に左右中央で出力されているからである.
120
+ \begin{lstlisting}[basewidth=1em, basicstyle=\tt]
121
+ 1234567890
122
+ 1あ,23
123
+ 1あ2,3
124
+ 1234567890
125
+ \end{lstlisting}
126
+
127
+ \texttt{doubleletterspace}オプションを指定すると,出力単位中の文字と文字の間隔を2倍にするため,
128
+ 下の例の「1」のように,各文字の垂直位置が揃いやすくなる.
129
+ \begin{lstlisting}[doubleletterspace, basewidth=1em, basicstyle=\tt]
130
+ 1234567890
131
+ 1あ,23
132
+ 1あ2,3
133
+ 1)2,3
134
+ 1234567890
135
+ \end{lstlisting}
136
+
137
+
138
+ \newpage
139
+ \textbf{Ticket \#34786}
140
+
141
+ foo \lstinline[basicstyle=\tt]!b a{}#shr! baz あ
142
+
143
+ foo \lstinline[basicstyle=\tt]!bxxa{}#shr! baz あ
144
+
145
+ あ\lstinline[basicstyle=\tt]{bar s}hoge
146
+
147
+ あ\lstinline[basicstyle=\tt]{bar..{a}hoge
148
+
149
+ foo \lstinline[basicstyle=\tt\gtfamily]!あexit 0; #shbar! baz あ
150
+
151
+ あ\lstinline[basicstyle=\tt]{いbexit #sh$ar}hoge
152
+
153
+ \bigskip
154
+ \textbf{Ticket \#35484}
155
+
156
+ \colorbox{red}{\lstinline!aiu#sheoxyz!}
157
+ \colorbox{red}{\lstinline!あいexit 0;#shうえお!}
158
+
159
+
160
+ \colorbox{red}{\lstinline{aiu#sheoxyz}}
161
+ \colorbox{red}{\lstinline{あいexit 0;#shうえお}}
162
+
163
+ \bigskip
164
+ \textbf{escape to \LaTeX}
165
+
166
+ あおいうえお
167
+ %\tracingall
168
+ \begin{lstlisting}[commentstyle=\color{green}\bfseries,
169
+ frame=single,language=TeX, escapechar=!]
170
+ ABCXYZあい!\color{blue}あ$a_{ijk}\times\hbox{ほげ}$いうえ!うえ% あいうえおAIg
171
+ あいうえお!\西暦\today\和暦\today!abcdef
172
+ \end{lstlisting}
173
+ あいうえお
174
+ \end{document}
@@ -0,0 +1,54 @@
1
+ %#!ptex2pdf -l -e test2.tex
2
+ \ifdefined\directlua
3
+ \documentclass{ltjsarticle}
4
+ \usepackage{listings,xcolor}
5
+ \else
6
+ \documentclass[uplatex,dvipdfmx]{jsarticle}
7
+ \usepackage{plistings,xcolor}
8
+ \def\zw{zw}
9
+ \fi
10
+ \usepackage{lmodern}
11
+ \usepackage{showexpl}
12
+ \lstset{
13
+ language=C, frame=trbl, framesep=5pt,
14
+ commentstyle=\color{green!50!black},
15
+ basicstyle=\ttfamily, basewidth=0.5em,
16
+ keywordstyle=\bfseries\color{blue},
17
+ }
18
+ \begin{document}
19
+ \begin{lstlisting}
20
+ #define N 6
21
+ #define ARSZ 2*N
22
+ #define ARY unsigned int
23
+ /* 1 次元配列 ARY data[ARSZ] をテーブルだと思う */
24
+ /* ARY は 32bit 符号なし整数と仮定.すると各行 1変数で済む */
25
+
26
+ /* 読みだし */
27
+ inline ARY read(const ARY data[], const int row, const int col) {
28
+ return data[row] & ((ARY)1)<<col;
29
+ }
30
+ /* 書き込み */
31
+ inline void mark(ARY data[], const int row, const int col) {
32
+ data[row] |= ((ARY)1)<<col;
33
+ }
34
+
35
+ unsigned long long counter;
36
+ /* 「次に探索」 */
37
+ int next_pos_x, next_pos_y;
38
+ /* pos_history[i][k] は,i 番の短冊の (k-1) 番目の cellの位置を
39
+ pack(row, col) = (row << 8) + col という 16ビット整数として管理する.*/
40
+ int pos_history[(N*N)<<2];
41
+ #define pack(x,y) ((x)<<8)+(y)
42
+ \end{lstlisting}
43
+
44
+ \lstinputlisting[language={[LaTeX]TeX}]{\jobname.tex}
45
+
46
+ {\catcode`\^^@=12 \global\let\NUL=^^@
47
+ \begin{LTXexample}
48
+ \西暦\today,\和暦\today
49
+ \par{\ttfamily\meaning\西暦}
50
+ a\NUL a^^@a
51
+ \end{LTXexample}}
52
+ なお,\lstinline|^^@|~(\lstinline|\0|) を陽にソース中に書いた場合は
53
+ エラーが発生する.
54
+ \end{document}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: review
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 3.0.0.preview1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kmuto
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-03-01 00:00:00.000000000 Z
12
+ date: 2018-06-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: image_size
@@ -87,14 +87,28 @@ dependencies:
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: 0.52.0
90
+ version: 0.57.2
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: 0.52.0
97
+ version: 0.57.2
98
+ - !ruby/object:Gem::Dependency
99
+ name: simplecov
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
98
112
  - !ruby/object:Gem::Dependency
99
113
  name: test-unit
100
114
  requirement: !ruby/object:Gem::Requirement
@@ -217,6 +231,7 @@ files:
217
231
  - lib/review/converter.rb
218
232
  - lib/review/epubbuilder.rb
219
233
  - lib/review/epubmaker.rb
234
+ - lib/review/epubmaker/reviewheaderlistener.rb
220
235
  - lib/review/exception.rb
221
236
  - lib/review/extentions.rb
222
237
  - lib/review/extentions/hash.rb
@@ -228,6 +243,7 @@ files:
228
243
  - lib/review/i18n.rb
229
244
  - lib/review/i18n.yml
230
245
  - lib/review/idgxmlbuilder.rb
246
+ - lib/review/init.rb
231
247
  - lib/review/latexbuilder.rb
232
248
  - lib/review/latexindex.rb
233
249
  - lib/review/latexutils.rb
@@ -248,7 +264,6 @@ files:
248
264
  - lib/review/tocparser.rb
249
265
  - lib/review/tocprinter.rb
250
266
  - lib/review/topbuilder.rb
251
- - lib/review/unfold.rb
252
267
  - lib/review/version.rb
253
268
  - lib/review/webmaker.rb
254
269
  - lib/review/webtocprinter.rb
@@ -258,14 +273,27 @@ files:
258
273
  - templates/README.md
259
274
  - templates/html/layout-html5.html.erb
260
275
  - templates/html/layout-xhtml1.html.erb
276
+ - templates/latex-compat2/layout.tex.erb
277
+ - templates/latex/config.erb
261
278
  - templates/latex/layout.tex.erb
279
+ - templates/latex/review-jlreq/README.md
280
+ - templates/latex/review-jlreq/review-base.sty
281
+ - templates/latex/review-jlreq/review-custom.sty
282
+ - templates/latex/review-jlreq/review-jlreq.cls
283
+ - templates/latex/review-jlreq/review-style.sty
284
+ - templates/latex/review-jlreq/reviewmacro.sty
285
+ - templates/latex/review-jsbook/jumoline.sty
286
+ - templates/latex/review-jsbook/plistings.sty
287
+ - templates/latex/review-jsbook/review-base.sty
288
+ - templates/latex/review-jsbook/review-custom.sty
289
+ - templates/latex/review-jsbook/review-style.sty
290
+ - templates/latex/review-jsbook/reviewmacro.sty
262
291
  - templates/ncx/epubv2.ncx.erb
263
292
  - templates/opf/epubv2.opf.erb
264
293
  - templates/opf/epubv3.opf.erb
265
294
  - templates/web/html/layout-html5.html.erb
266
295
  - templates/web/html/layout-xhtml1.html.erb
267
296
  - templates/xml/container.xml.erb
268
- - test/CHAPS
269
297
  - test/assets/black.eps
270
298
  - test/assets/fit.png
271
299
  - test/assets/large.gif
@@ -275,7 +303,6 @@ files:
275
303
  - test/assets/test.xml.erb
276
304
  - test/assets/test_template.tex
277
305
  - test/assets/test_template_backmatter.tex
278
- - test/bib.re
279
306
  - test/book_test_helper.rb
280
307
  - test/run_test.rb
281
308
  - test/sample-book/README.md
@@ -293,10 +320,6 @@ files:
293
320
  - test/sample-book/src/sty/reviewmacro.sty
294
321
  - test/sample-book/src/style-web.css
295
322
  - test/sample-book/src/style.css
296
- - test/sample-book/src/vendor/jumoline/README
297
- - test/sample-book/src/vendor/jumoline/jumoline.dtx
298
- - test/sample-book/src/vendor/jumoline/jumoline.ins
299
- - test/sample-book/src/vendor/jumoline/lppl.txt
300
323
  - test/syntax-book/Gemfile
301
324
  - test/syntax-book/Rakefile
302
325
  - test/syntax-book/appA.re
@@ -322,7 +345,6 @@ files:
322
345
  - test/syntax-book/sty/reviewmacro.sty
323
346
  - test/syntax-book/style.css
324
347
  - test/syntax-book/syntax.dic
325
- - test/test.re
326
348
  - test/test_book.rb
327
349
  - test/test_book_chapter.rb
328
350
  - test/test_book_part.rb
@@ -345,8 +367,10 @@ files:
345
367
  - test/test_image_finder.rb
346
368
  - test/test_index.rb
347
369
  - test/test_latexbuilder.rb
370
+ - test/test_latexbuilder_v2.rb
348
371
  - test/test_lineinput.rb
349
372
  - test/test_location.rb
373
+ - test/test_logger.rb
350
374
  - test/test_makerhelper.rb
351
375
  - test/test_markdownbuilder.rb
352
376
  - test/test_md2inaobuilder.rb
@@ -363,6 +387,16 @@ files:
363
387
  - test/test_webtocprinter.rb
364
388
  - test/test_yamlloader.rb
365
389
  - test/test_zip_exporter.rb
390
+ - vendor/jumoline/README
391
+ - vendor/jumoline/jumoline.dtx
392
+ - vendor/jumoline/jumoline.ins
393
+ - vendor/jumoline/lppl.txt
394
+ - vendor/plistings/.gitignore
395
+ - vendor/plistings/LICENSE
396
+ - vendor/plistings/README.md
397
+ - vendor/plistings/plistings.sty
398
+ - vendor/plistings/test1.tex
399
+ - vendor/plistings/test2.tex
366
400
  homepage: http://github.com/kmuto/review
367
401
  licenses:
368
402
  - LGPL
@@ -388,7 +422,6 @@ signing_key:
388
422
  specification_version: 4
389
423
  summary: 'Re:VIEW: a easy-to-use digital publishing system'
390
424
  test_files:
391
- - test/CHAPS
392
425
  - test/assets/black.eps
393
426
  - test/assets/fit.png
394
427
  - test/assets/large.gif
@@ -398,7 +431,6 @@ test_files:
398
431
  - test/assets/test.xml.erb
399
432
  - test/assets/test_template.tex
400
433
  - test/assets/test_template_backmatter.tex
401
- - test/bib.re
402
434
  - test/book_test_helper.rb
403
435
  - test/run_test.rb
404
436
  - test/sample-book/README.md
@@ -416,10 +448,6 @@ test_files:
416
448
  - test/sample-book/src/sty/reviewmacro.sty
417
449
  - test/sample-book/src/style-web.css
418
450
  - test/sample-book/src/style.css
419
- - test/sample-book/src/vendor/jumoline/README
420
- - test/sample-book/src/vendor/jumoline/jumoline.dtx
421
- - test/sample-book/src/vendor/jumoline/jumoline.ins
422
- - test/sample-book/src/vendor/jumoline/lppl.txt
423
451
  - test/syntax-book/Gemfile
424
452
  - test/syntax-book/Rakefile
425
453
  - test/syntax-book/appA.re
@@ -445,7 +473,6 @@ test_files:
445
473
  - test/syntax-book/sty/reviewmacro.sty
446
474
  - test/syntax-book/style.css
447
475
  - test/syntax-book/syntax.dic
448
- - test/test.re
449
476
  - test/test_book.rb
450
477
  - test/test_book_chapter.rb
451
478
  - test/test_book_part.rb
@@ -468,8 +495,10 @@ test_files:
468
495
  - test/test_image_finder.rb
469
496
  - test/test_index.rb
470
497
  - test/test_latexbuilder.rb
498
+ - test/test_latexbuilder_v2.rb
471
499
  - test/test_lineinput.rb
472
500
  - test/test_location.rb
501
+ - test/test_logger.rb
473
502
  - test/test_makerhelper.rb
474
503
  - test/test_markdownbuilder.rb
475
504
  - test/test_md2inaobuilder.rb
data/lib/review/unfold.rb DELETED
@@ -1,129 +0,0 @@
1
- # Copyright (c) 2007-2017 Kenshi Muto
2
- # 2002-2007 Minero Aoki
3
- #
4
- # This program is free software.
5
- # You can distribute or modify this program under the terms of
6
- # the GNU LGPL, Lesser General Public License version 2.1.
7
- # For details of LGPL, see the file "COPYING".
8
- #
9
-
10
- require 'review/preprocessor'
11
- require 'stringio'
12
-
13
- module ReVIEW
14
- class WrongInput < Error; end
15
-
16
- class Unfold
17
- # unfold paragraphs and strip preprocessor tags.
18
- def self.unfold_author_source(s)
19
- unfold(Preprocessor::Strip.new(StringIO.new(s)))
20
- end
21
-
22
- def self.unfold(f)
23
- new.unfold(f)
24
- end
25
-
26
- def initialize(indent_paragraph = false)
27
- @indent_paragraph = indent_paragraph
28
- end
29
-
30
- # unfold(f) -> String
31
- # unfold(input, output) -> nil
32
- def unfold(input, output = nil)
33
- if output
34
- @output = output
35
- do_unfold input
36
- nil
37
- else
38
- @output = StringIO.new
39
- do_unfold input
40
- @output.string
41
- end
42
- end
43
-
44
- private
45
-
46
- ZSPACE = "\241\241".freeze # EUC-JP zen-kaku space
47
-
48
- def do_unfold(input)
49
- @blank_needed = false
50
- first = true
51
- indent = @indent_paragraph ? ZSPACE : ''
52
- f = LineInput.new(input)
53
- f.each_line do |line|
54
- case line
55
- when /\A\#@/
56
- raise "must not happen: input includes preproc directive: #{line.inspect}"
57
- when /\A=/
58
- if first
59
- first = false
60
- else
61
- blank
62
- end
63
- println line
64
- # blank
65
- when /\A\s+\*/
66
- blank
67
- println line
68
- skip_block f, /\A\s+\*|\A\s+\S/
69
- blank
70
- when /\A\s+\d+\./
71
- blank
72
- println line
73
- skip_block f, /\A\s+\d+\.|\A\s+\S/
74
- blank
75
- when /\A:/
76
- blank
77
- println line
78
- skip_block f, /\A:|\A\s+\S/
79
- blank
80
- when %r{\A//\w.*\{\s*\z}
81
- blank
82
- println line
83
- f.until_terminator(%r{\A//\}}) do |s|
84
- println s
85
- end
86
- println '//}'
87
- blank
88
- when %r{\A//\w}
89
- blank
90
- println line
91
- blank
92
- when /\A\S/
93
- if %r{\A//\[} =~ line
94
- $stderr.puts "warning: #{f.path}:#{f.lineno}: paragraph begin with `//['; missing ReVIEW directive name?"
95
- end
96
- flush_blank
97
- @output.print indent + line.rstrip
98
- f.until_match(%r{\A\s*\z|\A//\w}) { |s| @output.print s.rstrip }
99
- @output.puts
100
- else
101
- unless line.strip.empty?
102
- raise WrongInput, "#{f.path}:#{f.lineno}: wrong input: #{line.inspect}"
103
- end
104
- end
105
- end
106
- end
107
-
108
- def skip_block(f, re)
109
- f.while_match(re) do |line|
110
- @output.puts line.rstrip
111
- end
112
- end
113
-
114
- def blank
115
- @blank_needed = true
116
- end
117
-
118
- def println(s)
119
- flush_blank
120
- @output.puts s.rstrip
121
- end
122
-
123
- def flush_blank
124
- return unless @blank_needed
125
- @output.puts
126
- @blank_needed = false
127
- end
128
- end
129
- end # module ReVIEW
data/test/CHAPS DELETED
@@ -1,2 +0,0 @@
1
- test.re
2
- bib.re
data/test/bib.re DELETED
@@ -1,13 +0,0 @@
1
-
2
- //bibpaper[lins][Lins, 1991]{
3
- Refael D. Lins. A shared memory architecture for parallel study of
4
- algorithums for cyclic reference_counting. Technical Report 92,
5
- Computing Laboratory, The University of Kent at Canterbury , August
6
- 1991
7
- //}
8
-
9
- //bibpaper[nari][nari, 1991]{
10
- nari paper
11
- //}
12
-
13
- //bibpaper[nari][Hogefuge]
data/test/test.re DELETED
@@ -1,43 +0,0 @@
1
- = 見出し
2
- 以下を実行
3
- //emlist{
4
- ./bin/review-compile --hdnumberingmode test.re --target=html
5
- }
6
- == 節1
7
-
8
- == 節2
9
-
10
- ==[column]コラム
11
-
12
- == 節3
13
-
14
- ソースコードの引用
15
-
16
- //source[/hello/world.rb]{
17
- puts "hello world!"
18
- //}
19
-
20
- ■行番号付きキャプションなしリスト
21
- //emlistnum{
22
- hoge
23
- fuge
24
- //}
25
-
26
- ■行番号付きキャプションありリスト
27
- //listnum[hoge][ほげ]{
28
- hoge
29
- fuge
30
- //}
31
-
32
- ほげは@<list>{hoge}でもわかるとおり
33
-
34
- ■本文中でのソースコード引用
35
- 擬似コード内のの@<code>{p = obj.ref_cnt}では…
36
-
37
- ■参考文献の参照方法
38
- …がしられています( @<bib>{lins} )
39
-
40
-
41
- //emlist{
42
- hoge
43
- //}