review 2.0.0.beta1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +66 -1
  3. data/.rubocop_todo.yml +617 -0
  4. data/.travis.yml +16 -1
  5. data/ChangeLog +48 -0
  6. data/Dockerfile +22 -0
  7. data/Gemfile +0 -1
  8. data/README.md +97 -0
  9. data/Rakefile +10 -11
  10. data/appveyor.yml +9 -0
  11. data/bin/review +46 -0
  12. data/bin/review-check +8 -21
  13. data/bin/review-compile +26 -43
  14. data/bin/review-index +9 -22
  15. data/bin/review-init +21 -25
  16. data/bin/review-preproc +9 -13
  17. data/bin/review-validate +1 -1
  18. data/bin/review-vol +3 -17
  19. data/bin/review-webmaker +15 -0
  20. data/doc/NEWS.ja.md +534 -0
  21. data/doc/NEWS.md +538 -0
  22. data/doc/catalog.ja.md +10 -18
  23. data/doc/catalog.md +5 -9
  24. data/doc/config.yml.sample +319 -0
  25. data/doc/customize_epub.ja.md +42 -0
  26. data/doc/format.ja.md +320 -288
  27. data/doc/format.md +277 -170
  28. data/doc/format_idg.ja.md +82 -175
  29. data/doc/pdfmaker.ja.md +61 -0
  30. data/doc/pdfmaker.md +65 -0
  31. data/doc/quickstart.ja.md +88 -98
  32. data/doc/quickstart.md +72 -110
  33. data/doc/sample.css +41 -0
  34. data/doc/writing_vertical.ja.md +55 -0
  35. data/doc/writing_vertical.md +5 -0
  36. data/lib/epubmaker/content.rb +3 -3
  37. data/lib/epubmaker/epubcommon.rb +173 -145
  38. data/lib/epubmaker/epubv2.rb +24 -77
  39. data/lib/epubmaker/epubv3.rb +72 -73
  40. data/lib/epubmaker/producer.rb +54 -30
  41. data/lib/lineinput.rb +48 -0
  42. data/lib/review/book.rb +0 -1
  43. data/lib/review/book/base.rb +47 -27
  44. data/lib/review/book/chapter.rb +48 -19
  45. data/lib/review/book/compilable.rb +10 -14
  46. data/lib/review/book/index.rb +10 -19
  47. data/lib/review/book/page_metric.rb +0 -10
  48. data/lib/review/book/part.rb +17 -3
  49. data/lib/review/builder.rb +84 -68
  50. data/lib/review/catalog.rb +5 -1
  51. data/lib/review/compiler.rb +327 -4657
  52. data/lib/review/configure.rb +84 -10
  53. data/lib/review/converter.rb +28 -0
  54. data/lib/review/epubbuilder.rb +1 -1
  55. data/lib/review/epubmaker.rb +142 -158
  56. data/lib/review/ewbbuilder.rb +5 -5
  57. data/lib/review/exception.rb +1 -1
  58. data/lib/review/extentions.rb +1 -1
  59. data/lib/review/extentions/hash.rb +15 -0
  60. data/lib/review/extentions/string.rb +2 -1
  61. data/lib/review/htmlbuilder.rb +364 -348
  62. data/lib/review/htmltoc.rb +44 -0
  63. data/lib/review/htmlutils.rb +12 -6
  64. data/lib/review/i18n.rb +78 -6
  65. data/lib/review/i18n.yml +7 -4
  66. data/lib/review/idgxmlbuilder.rb +226 -267
  67. data/lib/review/latexbuilder.rb +281 -274
  68. data/lib/review/latexutils.rb +56 -49
  69. data/lib/review/makerhelper.rb +8 -4
  70. data/lib/review/markdownbuilder.rb +80 -124
  71. data/lib/review/pdfmaker.rb +197 -138
  72. data/lib/review/preprocessor.rb +16 -67
  73. data/lib/review/template.rb +24 -0
  74. data/lib/review/textbuilder.rb +1 -1
  75. data/lib/review/textutils.rb +18 -24
  76. data/lib/review/tocparser.rb +51 -106
  77. data/lib/review/tocprinter.rb +61 -117
  78. data/lib/review/topbuilder.rb +119 -126
  79. data/lib/review/unfold.rb +2 -2
  80. data/lib/review/version.rb +1 -1
  81. data/lib/review/webmaker.rb +302 -0
  82. data/lib/review/webtocprinter.rb +48 -0
  83. data/lib/review/yamlloader.rb +47 -0
  84. data/review.gemspec +3 -3
  85. data/templates/html/layout-html5.html.erb +17 -0
  86. data/templates/html/layout-xhtml1.html.erb +20 -0
  87. data/{lib/review → templates/latex}/layout.tex.erb +107 -115
  88. data/templates/ncx/epubv2.ncx.erb +11 -0
  89. data/templates/opf/epubv2.opf.erb +21 -0
  90. data/templates/opf/epubv3.opf.erb +18 -0
  91. data/templates/web/html/layout-html5.html.erb +56 -0
  92. data/templates/web/html/layout-xhtml1.html.erb +20 -0
  93. data/templates/xml/container.xml.erb +6 -0
  94. data/test/assets/test.xml.erb +3 -0
  95. data/test/assets/test_template.tex +28 -71
  96. data/test/assets/test_template_backmatter.tex +1 -9
  97. data/test/sample-book/src/Rakefile +12 -3
  98. data/{doc/sample.yml → test/sample-book/src/config-epub2.yml} +92 -147
  99. data/test/sample-book/src/config.yml +40 -154
  100. data/test/sample-book/src/style-web.css +45 -0
  101. data/test/sample-book/src/style.css +23 -1
  102. data/test/test.re +1 -1
  103. data/test/test_book.rb +15 -17
  104. data/test/test_book_chapter.rb +2 -80
  105. data/test/test_book_part.rb +1 -1
  106. data/test/test_builder.rb +28 -6
  107. data/test/test_catalog.rb +17 -0
  108. data/test/test_compiler.rb +14 -59
  109. data/test/test_configure.rb +94 -0
  110. data/test/test_converter.rb +21 -0
  111. data/test/test_epub3maker.rb +155 -3
  112. data/test/test_epubmaker.rb +245 -30
  113. data/test/test_epubmaker_cmd.rb +2 -2
  114. data/test/test_extentions_hash.rb +60 -0
  115. data/test/test_helper.rb +4 -47
  116. data/test/test_htmlbuilder.rb +282 -175
  117. data/test/test_htmltoc.rb +33 -0
  118. data/test/test_i18n.rb +134 -70
  119. data/test/test_idgxmlbuilder.rb +58 -39
  120. data/test/test_latexbuilder.rb +132 -14
  121. data/test/test_lineinput.rb +5 -26
  122. data/test/test_makerhelper.rb +6 -4
  123. data/test/test_markdownbuilder.rb +23 -5
  124. data/test/test_pdfmaker.rb +86 -20
  125. data/test/test_pdfmaker_cmd.rb +1 -3
  126. data/test/test_review_ext.rb +1 -1
  127. data/test/test_template.rb +27 -0
  128. data/test/test_textutils.rb +36 -0
  129. data/test/test_tocparser.rb +25 -0
  130. data/test/test_topbuilder.rb +34 -2
  131. data/test/test_yamlloader.rb +188 -0
  132. metadata +71 -29
  133. data/README.rdoc +0 -81
  134. data/bin/review-epubmaker-legacy +0 -1024
  135. data/doc/ruby-uuid/README +0 -11
  136. data/doc/ruby-uuid/README.ja +0 -34
  137. data/lib/review/compiler/literals_1_8.kpeg +0 -19
  138. data/lib/review/compiler/literals_1_8.rb +0 -432
  139. data/lib/review/compiler/literals_1_9.kpeg +0 -22
  140. data/lib/review/compiler/literals_1_9.rb +0 -435
  141. data/lib/review/extentions/array.rb +0 -25
  142. data/lib/review/htmllayout.rb +0 -41
  143. data/lib/review/inaobuilder.rb +0 -357
  144. data/lib/review/location.rb +0 -24
  145. data/lib/review/node.rb +0 -267
  146. data/lib/review/review.kpeg +0 -724
  147. data/lib/uuid.rb +0 -312
  148. data/rubocop-todo.yml +0 -456
  149. data/test/test_inaobuilder.rb +0 -247
  150. data/test/test_uuid.rb +0 -157
@@ -2,7 +2,10 @@
2
2
 
3
3
  The document is a brief guide for Re:VIEW markup syntax.
4
4
 
5
- Re:VIEW is based on EWB of ASCII, influenced RD and other Wiki system's syntax.
5
+ Re:VIEW is based on EWB of ASCII (now KADOKAWA), influenced RD and other Wiki system's syntax.
6
+
7
+ This document explains about the format of Re:VIEW 2.0.
8
+
6
9
 
7
10
  ## Paragraph
8
11
 
@@ -22,6 +25,7 @@ Two empty lines or more are same as one empty line.
22
25
  ## Chapter, Section, Subsection (headings)
23
26
 
24
27
  Chapters, sections, subsections, subsubsections use `=`, `==`, `===`, `====`, `=====`.
28
+ You should add one or more spaces after `=`.
25
29
 
26
30
  Usage:
27
31
 
@@ -39,9 +43,11 @@ Usage:
39
43
 
40
44
  Headings should not have any spaces before title; if line head has space, it is as paragraph.
41
45
 
46
+ You should add emply lines between Paragraphs and Headings.
47
+
42
48
  ## Column
43
49
 
44
- `[column]` in heading are column's caption.
50
+ `[column]` in a heading are column's caption.
45
51
 
46
52
  Usage:
47
53
 
@@ -75,9 +81,15 @@ Compiler-compiler is ...
75
81
  blah, blah, blah (this is paragraphs outside of the column)
76
82
  ```
77
83
 
84
+ There are some more options of headings.
85
+
86
+ * `[nonum]` : no numbering, but add it into TOC (Table of Contents).
87
+ * `[nodisp]` : not display in document, only in TOC.
88
+ * `[notoc]` : no numbering, not in TOC.
89
+
78
90
  ## Itemize
79
91
 
80
- Itemize (ul in HTML) use ` *` (one space char and asterisk).
92
+ Itemize (ul in HTML) uses ` *` (one space char and asterisk).
81
93
 
82
94
  Nested itemize is like ` **`, ` ***`.
83
95
 
@@ -94,9 +106,11 @@ Usage:
94
106
  In itemize, you must write one more space character at line head.
95
107
  When you use `*` without spaces in line head, it's just paragraph.
96
108
 
97
- ## Ordered itemize
109
+ You should add emply lines between Paragraphs and Itemize (same as Ordered and Non-Orderd).
98
110
 
99
- Ordered itemize (ol in HTML) use ` 1. ...`, ` 2. ...`, ` 3. ...`.
111
+ ## Ordered Itemize
112
+
113
+ Ordered itemize (ol in HTML) uses ` 1. ...`, ` 2. ...`, ` 3. ...`.
100
114
  They aren't nested.
101
115
 
102
116
  Usage:
@@ -142,7 +156,44 @@ After dt line, space-indented lines are descriptions(dd in HTML).
142
156
 
143
157
  You can use inline markup in texts of lists.
144
158
 
145
- ## Code list
159
+ ## Block Commands and Inline Commands
160
+
161
+ With the exception of headings and lists, Re:VIEW supports consistent syntax.
162
+
163
+ Block commands are used for multiple lines to add some actions (ex. decoration).
164
+
165
+ The syntax of block commands is below:
166
+
167
+ ```
168
+ //command[option1][option2]...{
169
+ (content lines, sometimes separated by empty lines)
170
+ ...
171
+ //}
172
+ ```
173
+
174
+ If there is no options, the begining line is just `//command{`. When you want to use a character `]`, you must use escaping `\]`.
175
+
176
+ Some block commands has no content.
177
+
178
+ ```
179
+ //command[option1][option2]...
180
+ ```
181
+
182
+ Inline commands are used in block, paragraphes, headings, block contents and block options.
183
+
184
+ ```
185
+ @<command>{content}
186
+ ```
187
+
188
+ When you want to use a character `}` in inline content, you must use escaping `\}`.
189
+
190
+ There are some limitations in blocks and inlines.
191
+
192
+ * Block commands do not support nestins. You cannot write blocks in another block.
193
+ * You cannot write headings and itemize in block contents.
194
+ * Inline commands also do not support nestins. You cannot write inlines in another inline.
195
+
196
+ ## Code List
146
197
 
147
198
  Code list like source codes is `//list`. If you don't need numbers, you can use ``em`` prefix (as embedded). If you need line numbers, you can use ``num`` postfix. So you can use four types of lists.
148
199
 
@@ -179,7 +230,7 @@ puts "hello world!"
179
230
  Usage:
180
231
 
181
232
  ```review
182
- //emlist[][ruby]{
233
+ //emlist[][c]{
183
234
  printf("hello");
184
235
  //}
185
236
  ```
@@ -192,14 +243,16 @@ puts "hello world!"
192
243
  //}
193
244
  ```
194
245
 
246
+ The Language option is used for highlightings.
195
247
 
196
248
  You can use inline markup in blocks.
197
249
 
198
250
  When you refer a list like `see list X`, you can use an ID in `//list`
199
251
  such as `@<list>{main}`.
200
252
 
253
+ When you refer a list in the other chapter, you can use an ID with chapter ID, such like `@<list>{advanced|main}`, to refer a list `main` in `advanced.re`.
201
254
 
202
- ### Quoting source code
255
+ ### Quoting Source Code
203
256
 
204
257
  `//source` is for quoting source code. filename is mandatory.
205
258
 
@@ -222,7 +275,7 @@ Usage:
222
275
  When you ..., see @<list>{hello}.
223
276
  ```
224
277
 
225
- ## Inline source code
278
+ ## Inline Source Code
226
279
 
227
280
  You can use `@<code>{...}` in inline context.
228
281
 
@@ -232,15 +285,16 @@ Usage:
232
285
  @<code>{p = obj.ref_cnt}
233
286
  ```
234
287
 
235
- ## Shell session
288
+ ## Shell Session
236
289
 
237
290
  When you want to show command line operation, you can use `//cmd{ ... //}`.
291
+ You can use inline commands in this command.
238
292
 
239
293
  Usage:
240
294
 
241
295
  ```
242
296
  //cmd{
243
- $ ls /
297
+ $ @<b>{ls /}
244
298
  //}
245
299
  ```
246
300
 
@@ -267,6 +321,8 @@ V1 --> V6 --|
267
321
  //}
268
322
  ```
269
323
 
324
+ The third option is used to define the scale of images. `scale=X` is scaling for page width (`scale=0.5` makes image width to be half of page width).
325
+
270
326
  When you want to refer images such as "see figure 1.", you can use
271
327
  inline reference markup like `@<img>{unixhistory}`.
272
328
 
@@ -291,6 +347,10 @@ The order of finding image is as follows. The first matched one is used.
291
347
  * ``<id>`` is the ID of the first argument of `//image`. You should use only printable ASCII characters as ID.
292
348
  * ``<ext>`` is file extensions of Re:VIEW. They are different by the builder you use.
293
349
 
350
+ ### Inline Images
351
+
352
+ When you want to use images in paragraph, you can use the inline command `@<icon>{ID}`. The order of finding images are same as `//image`.
353
+
294
354
  ## Images without caption counter
295
355
 
296
356
  `//indepimage[filename][caption]` makes images without caption counter.
@@ -351,7 +411,21 @@ When you want to write "see table X", you can write `@<table>{envvars}`.
351
411
 
352
412
  You can use inline markup in the tables.
353
413
 
354
- ## Quoting text
414
+ ### Complex Table
415
+
416
+ If you want to use complex tables, you can use `imgtable` block command with an image of the table. `imgtable` supports numbering and `@<table>`.
417
+
418
+ Usage:
419
+
420
+ ```
421
+ //imgtable[complexmatrix][very complex table]{
422
+ to use image "complexmatrix".
423
+ The rule of finding images is same as image command.
424
+ //}
425
+ ```
426
+
427
+
428
+ ## Quoting Text
355
429
 
356
430
  You can use `//quote{ 〜 //}` as quotations.
357
431
 
@@ -365,6 +439,22 @@ Seeing is believing.
365
439
 
366
440
  You can use inline markup in quotations.
367
441
 
442
+ ## Short column
443
+
444
+ Some block commands are used for short column.
445
+
446
+ * `//note[caption]{ 〜 //}`
447
+ * `//memo[caption]{ 〜 //}`
448
+ * `//tip[caption]{ 〜 //}`
449
+ * `//info[caption]{ 〜 //}`
450
+ * `//warning[caption]{ 〜 //}`
451
+ * `//important[caption]{ 〜 //}`
452
+ * `//caution[caption]{ 〜 //}`
453
+ * `//notice[caption]{ 〜 //}`
454
+
455
+ `[caption]` is optional.
456
+
457
+ The content is like paragraph; separated by empty lines.
368
458
 
369
459
  ## Footnotes
370
460
 
@@ -383,7 +473,7 @@ is in footnotes.
383
473
 
384
474
  Note that In LATEXBuilder, you should use `footnotetext` option to use `@<fn>{...}` in columns and tables.
385
475
 
386
- ### --footnotetext option
476
+ ### `--footnotetext` option
387
477
 
388
478
  When you want to use `footnotetext` option, you can add `--footnotetext` with `params` in config.yml.
389
479
  With this option, you can use footnote in tables and short notes.
@@ -429,7 +519,7 @@ Usage:
429
519
  … is the well-known project.(@<bib>{lins})
430
520
  ```
431
521
 
432
- ## Lead sentences
522
+ ## Lead Sentences
433
523
 
434
524
  lead sentences are `//lead{ ... //}`.
435
525
  You can write as `//read{ ... //}`.
@@ -443,7 +533,7 @@ and I show the way how to write a program in Linux.
443
533
  //}
444
534
  ```
445
535
 
446
- ## TeX equations
536
+ ## TeX Equations
447
537
 
448
538
  You can use `//texequation{ ... //}` to insert mathematical equations of LaTeX.
449
539
 
@@ -460,11 +550,89 @@ Usage:
460
550
  `//noindent` is a tag for spacing.
461
551
 
462
552
 
463
- * `//noindent` : ingore indentation immediately following line. (in HTML, use noindent class)
553
+ * `//noindent` : ingore indentation immediately following line. (in HTML, add `noindent` class)
464
554
 
465
555
 
466
556
  `//linebreak` and `//pagebreak` will be obsoleted.
467
557
 
558
+
559
+ ## Referring headings
560
+
561
+ There are 3 inline commands to refer a chapter. These references use Chapter ID. The Chapter ID is filename of chapter without extentions. For example, Chapter ID of `advanced.re` is `advance`.
562
+
563
+ * `@<chap>{ChapterID}` : chapter number (ex. `Chapter 17`).
564
+ * `@<title>{ChapterID}` : chapter title
565
+ * `@<chapref>{ChapterID}` : chapter number and chapter title (ex. `Chapter 17. other topics`).
566
+
567
+ `@<hd>` generate referred section title and section number.
568
+ You can use deeper section with separator `|`.
569
+
570
+ Usage:
571
+
572
+ ```
573
+ @<hd>{intro|first section}
574
+ ```
575
+
576
+ If section title is unique, `|` is not needed.
577
+
578
+ ```
579
+ @<hd>{first section}
580
+ ```
581
+
582
+ If you want to refer another chapter (file), you should add the chapter ID.
583
+
584
+ Usage:
585
+
586
+ ```
587
+ @<hd>{preface|Introduction|first section}
588
+ ```
589
+
590
+ When section has the label, you can use the label.
591
+
592
+ ```
593
+ =={intro} Introduction
594
+ :
595
+ === first section
596
+ :
597
+ @<hd>{intro|first section}
598
+ ```
599
+
600
+
601
+ ### Heading of columns
602
+
603
+ You can refer the heading of a column with `@<column>`.
604
+
605
+ Usage:
606
+
607
+ ```
608
+ @<column>{The usage of Re:VIEW}
609
+ ```
610
+
611
+ You can refer labels.
612
+
613
+ ```
614
+ ==[column]{review-application} The application of Re:VIEW
615
+ :
616
+ @<column>{review-application}
617
+ ```
618
+
619
+ ## Links
620
+
621
+ You can add a hyperlink with `@<href>` and `//label`.
622
+ Notation of the markup is `@<href>{URL, anchor}`. If you can use URL itself
623
+ as anchor, use `@<href>{URL}`.
624
+ If you want to use `,` in URL, use `\,`.
625
+
626
+ Usage:
627
+
628
+ ```
629
+ @<href>{http://github.com/, GitHub}
630
+ @<href>{http://www.google.com/}
631
+ @<href>{#point1, point1 in document}
632
+ @<href>{chap1.html#point1, point1 in document}
633
+ //label[point1]
634
+ ```
635
+
468
636
  ## Comments
469
637
 
470
638
  If you want to write some comments that do not output in the document, you can use comment notation `#@#`.
@@ -491,7 +659,7 @@ Usage:
491
659
  @<comment>{TODO}
492
660
  ```
493
661
 
494
- ## Raw data block
662
+ ## Raw Data Block
495
663
 
496
664
  When you want to write non-Re:VIEW line, use `//raw`.
497
665
 
@@ -520,58 +688,15 @@ this is a special line.
520
688
 
521
689
  Note: `//raw` and `@<raw>` may break structured document easily.
522
690
 
523
- ## Other syntax
524
-
525
- In Re:VIEW, you can add your customized blocks. So you can define
526
- special block for some books.
527
-
528
- * `//prototype` : function prototype. It's used in the book `Futu no Linux programming`.
529
- * `//type` : type definition. It's used in the book `Futu no Haskell programming`.
691
+ ## Inline Commands
530
692
 
531
- You can define customized block in the file `review-ext.rb`.
532
-
533
- Usage:
534
-
535
- ```ruby
536
- # review-ext.rb
537
- ReVIEW::Compiler.defblock :foo, 0..1
538
- class ReVIEW::HTMLBuilder
539
- def foo(lines, caption = nil)
540
- puts lines.join(",")
541
- end
542
- end
543
- ```
544
-
545
- You can add the syntax as below:
693
+ ### Styles
546
694
 
547
695
  ```
548
- //foo{
549
- A
550
- B
551
- C
552
- //}
553
- ```
554
-
555
- ```
556
- # Result
557
- A,B,C
558
- ```
559
-
560
-
561
- ## Syntax in paragraph (Inline Markups)
562
-
563
- ```
564
- @<list>{program}:: `List 1.5`
565
- @<img>{unixhistory}:: `Figure 1.3`
566
- @<table>{ascii}:: `Table 1.2`
567
- @<fn>{site}:: footnote number
568
696
  @<kw>{Credential, credential}:: keyword.
569
- @<chap>{advanced}:: chapter number like `Chapter 17`
570
- @<title>{advanced}:: title of the chapter
571
- @<chapref>{advanced}:: a chapter number and chapter title like `Chapter 17. advanced topic`
572
697
  @<bou>{appropriate}:: bou-ten.
573
- @<ruby>{Matsumoto, Matz}:: ruby
574
698
  @<ami>{point}:: ami-kake (shaded text)
699
+ @<u>{AB}:: underline
575
700
  @<b>{Please}:: bold
576
701
  @<i>{Please}:: italic
577
702
  @<strong>{Please}:: strong(emphasis)
@@ -579,19 +704,39 @@ A,B,C
579
704
  @<tt>{foo($bar)}:: teletype (monospaced font)
580
705
  @<tti>{FooClass}:: teletype (monospaced font) and italic
581
706
  @<ttb>{BarClass}:: teletype (monospaced font) and bold
582
- @<u>{AB}:: underline
707
+ @<code>{a.foo(bar)}:: teletype (monospaced font) for fragments of code
708
+ @<tcy>{}:: short horizontal text in vertical text
709
+ ```
710
+
711
+ ### References
712
+
713
+ ```
714
+ @<chap>{advanced}:: chapter number like `Chapter 17`
715
+ @<title>{advanced}:: title of the chapter
716
+ @<chapref>{advanced}:: a chapter number and chapter title like `Chapter 17. advanced topic`
717
+ @<list>{program}:: `List 1.5`
718
+ @<img>{unixhistory}:: `Figure 1.3`
719
+ @<table>{ascii}:: `Table 1.2`
720
+ @<hd>{advanced|Other Topics}:: `7-3. Other Topics`
721
+ @<column>{another-column}:: reference of column.
722
+ ```
723
+
724
+ ### Other inline commands
725
+
726
+ ```
727
+ @<ruby>{Matsumoto, Matz}:: ruby markups
583
728
  @<br>{}:: linebreak in paragraph
584
- @<m>{a + \alpha}:: TeX inline equation
585
- @<icon>{samplephoto}:: inline image
586
729
  @<uchar>{2460}:: Unicode code point
587
730
  @<href>{http://www.google.com/, google}:: hyper link(URL)
731
+ @<icon>{samplephoto}:: inline image
732
+ @<m>{a + \alpha}:: TeX inline equation
588
733
  @<raw>{|html|<span>ABC</span>}:: inline raw data inline. `\}` is `}` and `\\` is `\`.
589
734
  ```
590
735
 
591
- ## Tags for Authors (pre-processor commands)
736
+ ## Commands for Authors (pre-processor commands)
592
737
 
593
- These tags are used in the output document. In contrast,
594
- tags as below are not used in the output document, used
738
+ These commands are used in the output document. In contrast,
739
+ commands as below are not used in the output document, used
595
740
  by the author.
596
741
 
597
742
  ```
@@ -603,144 +748,106 @@ by the author.
603
748
  #@mapoutput(command) ... #@end:: Execute command and insert their output.
604
749
  ```
605
750
 
606
- ## HTML/LaTeX layout
607
-
608
- `layouts/layout.html.erb` and `layouts/layout.tex.erb` are used as layout file.
609
- You can use ERb tags in the layout files.
610
-
611
-
612
- Sample layout file(layout.html.erb):
613
-
614
- ```html
615
- <html>
616
- <head>
617
- <title><%= title %></title>
618
- </head>
619
- <body>
620
- <%= body %>
621
- <hr/>
622
- </body>
623
- </html>
624
- ```
625
-
626
- ## Part title (in TOC)
751
+ You should use these commands with preprocessor command `review-preproc`.
627
752
 
628
- In version 1.2 or before, you can define the parts in PART file.
629
- PART file correspond with chapters in CHAPS file.
630
-
631
- Usage:
753
+ ## Internationalization (i18n)
632
754
 
633
- ```
634
- CHAPS:
635
- intro.re
755
+ Re:VIEW support I18N of some text like `Chapter`, `Figure`, and `Table`.
756
+ Current default language is Japanese.
636
757
 
637
- start.re
758
+ You add the file locale.yml in the project directory.
638
759
 
639
- end.re
640
- ```
760
+ Sample local.yml file:
641
761
 
642
- ```
643
- PART:
644
- (empty line)
645
- start section
646
- last section
762
+ ```yaml
763
+ locale: en
647
764
  ```
648
765
 
649
- In version 1.3 or after, you can use catalog.yml file.
650
- For more information of catalog.yml, see Re:VIEW catalog file guide(catalog.md).
651
-
652
- ## Referring headings
653
-
654
- `@<hd>` generate referred section title and section number.
655
- You can use deeper section with separator `|`.
766
+ If you want to customize texts, overwrite items.
767
+ Default locale configuration file is in lib/review/i18n.yml.
656
768
 
657
- Usage:
769
+ Sample local.yml file:
658
770
 
659
- ```
660
- @<hd>{intro|first section}
771
+ ```yaml
772
+ locale: en
773
+ image: Fig.
774
+ table: Tbl.
661
775
  ```
662
776
 
663
- If section title is unique, `|` is not needed.
777
+ ### Re:VIEW Custom Format
664
778
 
665
- ```
666
- @<hd>{first section}
667
- ```
779
+ In `locale.yml`, you can use these Re:VIEW custom format.
668
780
 
669
- If you want to refer another chapter (file), you should add the ID of chapter.
781
+ * `%pA` : Alphabet (A, B, C, ...)
782
+ * `%pa` : alphabet (a, b, c, ...)
783
+ * `%pAW` : Alphabet (Large Width) A, B, C, ...
784
+ * `%paW` : alphabet (Large Width) a, b, c, ...
785
+ * `%pR` : Roman Number (I, II, III, ...)
786
+ * `%pr` : roman number (i, ii, iii, ...)
787
+ * `%pRW` : Roman Number (Large Width) Ⅰ, Ⅱ, Ⅲ, ...
788
+ * `%pJ` : Chainese Number 一, 二, 三, ...
789
+ * `%pdW' : Arabic Number (Large Width for 0..9) 1, 2, ...,9, 10, ...
790
+ * `%pDW' : Arabic Number (Large Width) 1, 2, ... 10, ...
670
791
 
671
792
  Usage:
672
793
 
673
794
  ```
674
- @<hd>{preface|Introduction|first section}
675
- ```
676
-
677
- When section has the label, you can use the label.
678
-
679
- ```
680
- =={intro} Introduction
681
- :
682
- === first section
683
- :
684
- @<hd>{intro|first section}
795
+ locale: en
796
+ part: Part. %pRW
797
+ appendix: Appendix. %pA
685
798
  ```
686
799
 
800
+ ## Other Syntax
687
801
 
688
- ### Heading of columns
802
+ In Re:VIEW, you can add your customized blocks and inlines.
689
803
 
690
- You can refer the heading of a column with `@<column>`.
804
+ You can define customized commands in the file `review-ext.rb`.
691
805
 
692
806
  Usage:
693
807
 
694
- ```
695
- @<column>{The usage of Re:VIEW}
808
+ ```ruby
809
+ # review-ext.rb
810
+ ReVIEW::Compiler.defblock :foo, 0..1
811
+ class ReVIEW::HTMLBuilder
812
+ def foo(lines, caption = nil)
813
+ puts lines.join(",")
814
+ end
815
+ end
696
816
  ```
697
817
 
698
- You can refer labels.
818
+ You can add the syntax as below:
699
819
 
700
820
  ```
701
- ==[column]{review-application} The application of Re:VIEW
702
- :
703
- @<column>{review-application}
821
+ //foo{
822
+ A
823
+ B
824
+ C
825
+ //}
704
826
  ```
705
827
 
706
- ## Links
707
-
708
- You can add a hyperlink with `@<href>` and `//label`.
709
- Notation of the markup is `@<href>{URL, anchor}`. If you can use URL itself
710
- as anchor, use `@<href>{URL}`.
711
- If you want to use `,` in URL, use `\,`.
712
-
713
- Usage:
714
-
715
828
  ```
716
- @<href>{http://github.com/, GitHub}
717
- @<href>{http://www.google.com/}
718
- @<href>{#point1, point1 in document}
719
- @<href>{chap1.html#point1, point1 in document}
720
- //label[point1]
829
+ # Result
830
+ A,B,C
721
831
  ```
722
832
 
723
- ## Internationalization (i18n)
724
833
 
725
- Re:VIEW support I18N of some text like `Chapter`, `Figure`, and `Table`.
726
- Current default language is Japanese.
834
+ ## HTML/LaTeX Layout
727
835
 
836
+ `layouts/layout.html.erb` and `layouts/layout.tex.erb` are used as layout file.
837
+ You can use ERb tags in the layout files.
728
838
 
729
- You add the file locale.yml in the project directory.
730
839
 
731
- Sample local.yml file:
840
+ Sample layout file(layout.html.erb):
732
841
 
733
- ```yaml
734
- locale: ja
842
+ ```html
843
+ <html>
844
+ <head>
845
+ <title><%= @config["booktitle"] %></title>
846
+ </head>
847
+ <body>
848
+ <%= @body %>
849
+ <hr/>
850
+ </body>
851
+ </html>
735
852
  ```
736
853
 
737
- If you want to customize texts, overwrite items.
738
- Default locale configuration file is in lib/review/i18n.yml.
739
-
740
- Sample local.yml file:
741
-
742
- ```yaml
743
- locale: en
744
- image: Fig.
745
- table: Tbl.
746
- ```