review 2.0.0 → 2.1.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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +43 -1
  3. data/.rubocop_todo.yml +0 -5
  4. data/.travis.yml +2 -1
  5. data/README.md +2 -1
  6. data/appveyor.yml +10 -1
  7. data/bin/review-init +12 -0
  8. data/bin/review-validate +5 -4
  9. data/doc/NEWS.ja.md +82 -0
  10. data/doc/NEWS.md +84 -0
  11. data/doc/config.yml.sample +1 -0
  12. data/doc/config.yml.sample-simple +77 -0
  13. data/doc/customize_epub.md +47 -0
  14. data/doc/preproc.ja.md +153 -0
  15. data/doc/preproc.md +160 -0
  16. data/lib/epubmaker/producer.rb +6 -3
  17. data/lib/lineinput.rb +4 -4
  18. data/lib/review/book/base.rb +4 -0
  19. data/lib/review/book/compilable.rb +3 -3
  20. data/lib/review/book/index.rb +3 -24
  21. data/lib/review/book/part.rb +6 -2
  22. data/lib/review/configure.rb +4 -2
  23. data/lib/review/htmlbuilder.rb +17 -10
  24. data/lib/review/htmlutils.rb +4 -5
  25. data/lib/review/i18n.rb +17 -11
  26. data/lib/review/i18n.yml +6 -0
  27. data/lib/review/idgxmlbuilder.rb +2 -2
  28. data/lib/review/makerhelper.rb +1 -1
  29. data/lib/review/markdownbuilder.rb +12 -1
  30. data/lib/review/md2inaobuilder.rb +66 -0
  31. data/lib/review/pdfmaker.rb +20 -7
  32. data/lib/review/preprocessor.rb +2 -2
  33. data/lib/review/topbuilder.rb +18 -0
  34. data/lib/review/version.rb +1 -1
  35. data/lib/review/webtocprinter.rb +9 -2
  36. data/templates/LICENSE +20 -0
  37. data/templates/README.md +8 -0
  38. data/templates/latex/layout.tex.erb +58 -36
  39. data/templates/web/html/layout-html5.html.erb +1 -1
  40. data/test/assets/test_template.tex +44 -8
  41. data/test/book_test_helper.rb +10 -7
  42. data/test/sample-book/src/Rakefile +7 -0
  43. data/test/test_book.rb +1 -4
  44. data/test/test_epub3maker.rb +1 -3
  45. data/test/test_htmlbuilder.rb +30 -8
  46. data/test/test_i18n.rb +28 -0
  47. data/test/test_idgxmlbuilder.rb +2 -2
  48. data/test/test_index.rb +10 -0
  49. data/test/test_location.rb +30 -0
  50. data/test/test_markdownbuilder.rb +6 -0
  51. data/test/test_md2inaobuilder.rb +75 -0
  52. data/test/test_pdfmaker.rb +1 -0
  53. data/test/test_review_ext.rb +3 -2
  54. data/test/test_topbuilder.rb +11 -0
  55. data/test/test_webtocprinter.rb +164 -0
  56. data/test/test_yamlloader.rb +6 -7
  57. metadata +14 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 898ea979cb6912d1c67e1db172c9450c380d8220
4
- data.tar.gz: ea8a71cea832f5d3f5844bc8a330ac0b6aa3c247
3
+ metadata.gz: 2d31baaa5540925c8262c2233efa6a13b3530a35
4
+ data.tar.gz: 0b5cd864f45ec9c0e4792e46724d12f00a9f4083
5
5
  SHA512:
6
- metadata.gz: 51f9364880ed42c7c8af3c15917daa45b0535eedade50b7fbb98221fcab074803be8129a2ac830aa893c38dfc7714807d4eae4fbcd2456a2edbdb22ecc5322e0
7
- data.tar.gz: 97d01113fe323626412017dde0faedca800fe75484c3a5972c0c2abd9e28054fe1366b17fc835434e1aa06fecdae33ccda85119a436cd44db0d5c16464a9a2e1
6
+ metadata.gz: ee9360a4f1d4dec0dce44340cabfcc6fbeafd4fd7cce882cd6ed5978d48c58433ec9f58706d9070d68476a66a2266916a1d383f6b951b8665747a10ec58fa6ec
7
+ data.tar.gz: fb0a29394a15f3b0e31d1fc067cd52081d873129ee5acc011407172b8ff16b8a3f02bf8e37a25890f3656a0bed4e464e17ff6d0d5e03ab9c7106099fd4d7d37c
@@ -2,6 +2,7 @@ AllCops:
2
2
  Exclude:
3
3
  - lib/lineinput.rb
4
4
  - lib/uuid.rb
5
+ DisplayCopNames: true
5
6
 
6
7
  inherit_from: .rubocop_todo.yml
7
8
 
@@ -60,7 +61,48 @@ Performance/RedundantMerge:
60
61
  Style/ZeroLengthPredicate:
61
62
  Enabled: false
62
63
 
64
+ Style/NumericPredicate:
65
+ Enabled: false
66
+
67
+ Style/TernaryParentheses:
68
+ Enabled: false
69
+
70
+ Style/VariableNumber:
71
+ Enabled: false
72
+
63
73
  ##################### Metrics ##################################
64
74
 
65
75
  Metrics/ClassLength:
66
- Max: 1500
76
+ Max: 1500
77
+
78
+ Metrics/LineLength:
79
+ Max: 256
80
+ Exclude:
81
+ - "test/**/*"
82
+
83
+ ### should be < 50
84
+ Metrics/MethodLength:
85
+ Max: 100
86
+ Exclude:
87
+ - "bin/review-*"
88
+ - "test/**/*"
89
+
90
+ ### should be < 20
91
+ Metrics/CyclomaticComplexity:
92
+ Max: 32
93
+
94
+ ### should be < 60
95
+ Metrics/AbcSize:
96
+ Max: 120
97
+ Exclude:
98
+ - "bin/review-*"
99
+ - "test/**/*"
100
+
101
+ ### shoud be < 25
102
+ Metrics/BlockLength:
103
+ CountComments: false # count full line comments?
104
+ Max: 50
105
+ Exclude:
106
+ - 'Rakefile'
107
+ - '**/*.rake'
108
+ - 'test/**/*.rb'
@@ -198,11 +198,6 @@ Style/CommentIndentation:
198
198
  Style/ConstantName:
199
199
  Enabled: false
200
200
 
201
- # Offense count: 4
202
- # Cop supports --auto-correct.
203
- Style/DeprecatedHashMethods:
204
- Enabled: false
205
-
206
201
  # Offense count: 105
207
202
  Style/Documentation:
208
203
  Enabled: false
@@ -8,7 +8,8 @@ rvm:
8
8
  - 2.0.0
9
9
  - 2.1.*
10
10
  - 2.2.*
11
- - 2.3.0
11
+ - 2.3.1
12
+ ## - ruby-head
12
13
 
13
14
  addons:
14
15
  apt_packages:
data/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # Re:VIEW
2
2
 
3
- [![Build Status](https://secure.travis-ci.org/kmuto/review.png)](http://travis-ci.org/kmuto/review)
4
3
  [![Gem Version](https://badge.fury.io/rb/review.png)](http://badge.fury.io/rb/review)
4
+ [![Build Status](https://secure.travis-ci.org/kmuto/review.png)](http://travis-ci.org/kmuto/review)
5
+ [![Build status](https://ci.appveyor.com/api/projects/status/github/kmuto/review?svg=true)](https://ci.appveyor.com/project/kmuto/review)
5
6
 
6
7
  Re:VIEW is an easy-to-use digital publishing system for paper books and ebooks.
7
8
 
@@ -1,9 +1,18 @@
1
1
  ---
2
2
  install:
3
- - SET PATH=C:\Ruby22-x64\bin;%PATH%
3
+ - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
4
4
  - ruby --version
5
5
  - gem --version
6
6
  build_script:
7
7
  - bundle install
8
8
  - bundle exec rake test --trace --verbose
9
9
  - bundle exec rubocop
10
+
11
+ branches:
12
+ only:
13
+ - master
14
+
15
+ environment:
16
+ matrix:
17
+ - ruby_version: "23"
18
+ - ruby_version: "23-x64"
@@ -61,6 +61,7 @@ def main
61
61
  generate_config(dir)
62
62
  generate_locale(dir) if @locale
63
63
  generate_rakefile(dir)
64
+ generate_gemfile(dir)
64
65
  end
65
66
  end
66
67
 
@@ -142,6 +143,17 @@ def generate_locale(dir)
142
143
  FileUtils.cp @review_dir + '/lib/review/i18n.yml', dir + '/locale.yml'
143
144
  end
144
145
 
146
+ def generate_gemfile(dir)
147
+ File.open(dir + "/Gemfile", "w") do |file|
148
+ file.write <<-EOS
149
+ source 'https://rubygems.org'
150
+
151
+ gem 'rake'
152
+ gem 'review', '#{ReVIEW::VERSION}'
153
+ EOS
154
+ end
155
+ end
156
+
145
157
  if File.basename($0) == File.basename(__FILE__)
146
158
  main()
147
159
  end
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # Copyright (c) 2010-2014 Kenshi Muto
2
+ # Copyright (c) 2010-2016 Kenshi Muto
3
3
  #
4
4
  # This program is free software
5
5
  # You can distribute or modify this program under the terms of
@@ -16,20 +16,20 @@ ln = 0
16
16
 
17
17
  ARGF.each {|line|
18
18
  ln += 1
19
- if line =~ /\A\/\/([a-z]+).+\{/
19
+ if line =~ /\A\/\/([a-z]+)\{\s*\Z/ || line =~ /\A\/\/([a-z]+)\[.+?\{\s*\Z/
20
20
  # block
21
21
  _block = $1
22
22
  puts "#{ln}: block #{_block} started, but previous block #{block} didn't close yet." unless block.nil?
23
23
  block = _block
24
24
  elsif line =~ /\A\/\/\}/
25
- puts "#{ln}: block seen ended, but not opened." if block.nil?
25
+ puts "#{ln}: block ended, but not opened." if block.nil?
26
26
  block = nil
27
27
  maxcolcount = 0
28
28
  colcount = 0
29
29
  elsif line =~ /\A(\d+\.)\s+/
30
30
  # number
31
31
  unless ["list", "emlist", "listnum", "emlistnum", "cmd", "image", "table"].include?(block)
32
- puts "#{ln}: found $1 without the head space. Is it correct?"
32
+ puts "#{ln}: found '#{$1}' without the head space. Is it correct?"
33
33
  end
34
34
  elsif line =~ /\A\*\s+/
35
35
  # itemize
@@ -41,6 +41,7 @@ ARGF.each {|line|
41
41
  puts "#{ln}: found itemized list or numbered list in #{block}. Is it correct?"
42
42
  end
43
43
  elsif block == "table"
44
+ next if line.start_with?('#@')
44
45
  if line !~ /\A\-\-\-\-\-/
45
46
  # table
46
47
  colcount = line.split("\t").size
@@ -1,3 +1,85 @@
1
+ # Version 2.1.0 の主な変更点
2
+
3
+ ## 新機能
4
+
5
+ * review-init: Gemfileを生成するようにしました([#650])
6
+ * HTMLBuilder: リスト内で言語別のclassを生成するようにしました([#666])
7
+ * HTMLBuilder: image同様indepimageでも<div>要素にid属性を追加しました
8
+ * MD2INAOBuilder: 新builderとしてMD2INAOBuilderを追加しました ([#671])
9
+ * MARKDOWNBuilder, MD2INAOBuilder: ルビに対応しました ([#671])
10
+ * TEXTBuilder: `@<hd>`に対応しました([#648])
11
+ * TOPBuilder: `@<comment>{}`に対応しました ([#625], [#627])
12
+
13
+ ## 非互換の変更
14
+
15
+ ## バグ修正
16
+
17
+ * review-validate: ブロックや表内でのコメントの挙動と、メッセージを修正しました
18
+ * LATEXBuilder: config.ymlで`rights`が空の場合に対応しました ([#653])
19
+ * LATEXBuilder: config.ymlとlocale.ymlの値のエスケープを修正しました ([#642])
20
+ * PDFMaker: AI, EPS, TIFFの画像に対応しました ([#675])
21
+ * PDFMaker: フックからフルパスを取得できるよう @basehookdir を追加しました ([#662])
22
+ * EPUBMaker: dc:identifierが空になってしまうバグを修正しました ([#636])
23
+ * EPUBMaker: coverファイルの拡張子がxhtmlになってしまうバグを修正しました ([#618])
24
+ * WEBMaker: リンクを修正しました ([#645])
25
+ * WEBMaker: 部がファイルでない場合のリンクを修正しました ([#639], [#641])
26
+ * I18n: format_number_headerので`%pJ`の扱いを修正しました ([#628])
27
+
28
+ ## 機能強化
29
+
30
+ * LATEXBuilder: pLaTeXでもpxjahyper packageを使うようにしました([#640])
31
+ * LATEXBuilder: `layout.tex.erb`を改良しました([#617])
32
+ * LATEXBuilder: locale.ymlで指定されたキーワードを使うようにしました ([#629])
33
+ * IDGXMLBuilder: コラムの埋め込み目次情報のXMLインストラクションを修正しました ([#634])
34
+ * IDGXMLBuilder: //emlistで空のcaptionができるバグを修正しました ([#633])
35
+ * Rakefile: `preproc`タスクを追加しました ([#630])
36
+
37
+ ## ドキュメント
38
+
39
+ * 「EPUBローカルルールへの対応方法」のドキュメントを英訳しました
40
+ * 「review-preprocユーザガイド(preproc(.ja).md)」を追加しました ([#632])
41
+ * config.yml: `csl`の例を追加しました
42
+ * config.yml: シンプルなサンプルファイル(config.yml.sample-simple)を追加しました ([#626])
43
+
44
+ ## その他
45
+
46
+ * templates/以下のテンプレートファイルのライセンスを他の文書内に取り込みやすくするため、MIT licenseにしました([#663])
47
+ * rubocopの新しい警告を抑制しました
48
+
49
+ ## コントリビューターのみなさん
50
+
51
+ * [@kazken3](https://github.com/kazken3)
52
+ * [@vvakame](https://github.com/vvakame)
53
+ * [@masarakki](https://github.com/masarakki)
54
+ * [@munepi](https://github.com/munepi)
55
+ * [@znz](https://github.com/znz)
56
+
57
+ [#675]: https://github.com/kmuto/review/issues/
58
+ [#671]: https://github.com/kmuto/review/issues/
59
+ [#666]: https://github.com/kmuto/review/issues/
60
+ [#663]: https://github.com/kmuto/review/issues/
61
+ [#662]: https://github.com/kmuto/review/issues/
62
+ [#653]: https://github.com/kmuto/review/issues/
63
+ [#650]: https://github.com/kmuto/review/issues/
64
+ [#648]: https://github.com/kmuto/review/issues/
65
+ [#645]: https://github.com/kmuto/review/issues/
66
+ [#642]: https://github.com/kmuto/review/issues/
67
+ [#641]: https://github.com/kmuto/review/issues/
68
+ [#640]: https://github.com/kmuto/review/issues/
69
+ [#638]: https://github.com/kmuto/review/issues/
70
+ [#636]: https://github.com/kmuto/review/issues/
71
+ [#634]: https://github.com/kmuto/review/issues/
72
+ [#633]: https://github.com/kmuto/review/issues/
73
+ [#632]: https://github.com/kmuto/review/issues/
74
+ [#630]: https://github.com/kmuto/review/issues/
75
+ [#629]: https://github.com/kmuto/review/issues/
76
+ [#628]: https://github.com/kmuto/review/issues/
77
+ [#627]: https://github.com/kmuto/review/issues/
78
+ [#626]: https://github.com/kmuto/review/issues/
79
+ [#625]: https://github.com/kmuto/review/issues/
80
+ [#618]: https://github.com/kmuto/review/issues/
81
+ [#617]: https://github.com/kmuto/review/issues/
82
+
1
83
  # Version 2.0.0の主な変更点
2
84
 
3
85
  ## 新機能
@@ -1,3 +1,87 @@
1
+ # Version 2.1.0
2
+
3
+ ## New Features
4
+
5
+ * review-init: generate Gemfile ([#650])
6
+ * HTMLBuilder: add language specified class in list ([#666])
7
+ * HTMLBuilder: set id to <div> of indepimage as same as image
8
+ * MD2INAOBuilder: support new builder MD2INAOBuilder ([#671])
9
+ * MARKDOWNBuilder, MD2INAOBuilder: support ruby ([#671])
10
+ * TEXTBuilder: support `@<hd>` ([#648])
11
+ * TOPBuilder: support `@<comment>{}` ([#625], [#627])
12
+
13
+ ## Breaking Changes
14
+
15
+ ## Bug Fixes
16
+
17
+ * review-validate: fix parsing blocks and comments in tables, and messages
18
+ * LATEXBuilder: fix when rights is null in config.yml ([#653])
19
+ * LATEXBuilder: escaping values from config.yml and locale.yml([#642])
20
+ * PDFMaker: support AI, EPS, and TIFF on pdfmaker correctly ([#675])
21
+ * PDFMaker: fix hooks; add @basehookdir and use it to get fullpath ([#662])
22
+ * EPUBMaker: fix missing default dc:identifier value ([#636])
23
+ * EPUBMaker: ext. of cover file should be "xhtml" in EPUB ([#618])
24
+ * WEBMaker: fix broken link ([#645])
25
+ * WEBMaker: fix when Part has no "*.re" file ([#641])
26
+ * I18n: fix `%pJ` in format_number_header ([#628])
27
+
28
+ ## Enhancements
29
+
30
+ * LATEXBuilder: use pxjahyper package in pLaTeX ([#640])
31
+ * LATEXBuilder: Enhanced implementation of `layout.tex.erb` ([#617])
32
+ * LATEXBuilder: fix to use keywords in locale.yml ([#629])
33
+ * IDGXMLBuilder: add instruction to column headline for toc ([#634])
34
+ * IDGXMLBuilder: fix to avoid empty caption in //emlist ([#633])
35
+ * Rakefile: add task `preproc` ([#630])
36
+ * ReVIEW::Location: add test ([#638])
37
+
38
+ ## Docs
39
+
40
+ * add customize_epub.md
41
+ * add preproc(.ja).md ([#632])
42
+ * config.yml: add `csl` in sample
43
+ * config.yml: add simplified sample ([#626])
44
+
45
+ ## Others
46
+
47
+ * license of template fils are MIT license([#663])
48
+ * rubocop: suppress warnings of rubocop
49
+
50
+ ## Contributors
51
+
52
+ * [@kazken3](https://github.com/kazken3)
53
+ * [@vvakame](https://github.com/vvakame)
54
+ * [@masarakki](https://github.com/masarakki)
55
+ * [@munepi](https://github.com/munepi)
56
+ * [@znz](https://github.com/znz)
57
+
58
+ [#675]: https://github.com/kmuto/review/issues/
59
+ [#671]: https://github.com/kmuto/review/issues/
60
+ [#666]: https://github.com/kmuto/review/issues/
61
+ [#663]: https://github.com/kmuto/review/issues/
62
+ [#662]: https://github.com/kmuto/review/issues/
63
+ [#653]: https://github.com/kmuto/review/issues/
64
+ [#650]: https://github.com/kmuto/review/issues/
65
+ [#648]: https://github.com/kmuto/review/issues/
66
+ [#645]: https://github.com/kmuto/review/issues/
67
+ [#642]: https://github.com/kmuto/review/issues/
68
+ [#641]: https://github.com/kmuto/review/issues/
69
+ [#640]: https://github.com/kmuto/review/issues/
70
+ [#638]: https://github.com/kmuto/review/issues/
71
+ [#636]: https://github.com/kmuto/review/issues/
72
+ [#634]: https://github.com/kmuto/review/issues/
73
+ [#633]: https://github.com/kmuto/review/issues/
74
+ [#632]: https://github.com/kmuto/review/issues/
75
+ [#630]: https://github.com/kmuto/review/issues/
76
+ [#629]: https://github.com/kmuto/review/issues/
77
+ [#628]: https://github.com/kmuto/review/issues/
78
+ [#627]: https://github.com/kmuto/review/issues/
79
+ [#626]: https://github.com/kmuto/review/issues/
80
+ [#625]: https://github.com/kmuto/review/issues/
81
+ [#618]: https://github.com/kmuto/review/issues/
82
+ [#617]: https://github.com/kmuto/review/issues/
83
+
84
+
1
85
  # Version 2.0.0
2
86
 
3
87
  ## New Features
@@ -46,6 +46,7 @@ aut: ["青木峰郎", "武藤健志", "高橋征義", "角征典"]
46
46
  # a-bkp, bkp: メディア制作責任者
47
47
  # a-clb, clb: 限定参加または補足者
48
48
  # a-cmm, cmm: 解釈・分析・考察者
49
+ # a-csl, csl: 監修者
49
50
  # a-dsr, dsr: デザイナ
50
51
  # a-edt, edt: 編集者
51
52
  # a-ill, ill: イラストレータ
@@ -0,0 +1,77 @@
1
+ # simple sample of config.yml
2
+ review_version: 2.0
3
+
4
+ debug: true
5
+
6
+ ## inherited configuratons
7
+
8
+ # inherit: ["config-default.yml"]
9
+
10
+
11
+ ## Book Metadata
12
+
13
+ bookname: book
14
+ language: ja
15
+ booktitle: The Re:VIEW Sample Book
16
+ aut: ["Masayoshi Takahashi"]
17
+ # cov: ["Masayoshi Takahashi"]
18
+ # ill: ["Masayoshi Takahashi"]
19
+ # trl: null
20
+ # edt: null
21
+ pbl: "Re:VIEW Publishing inc."
22
+ prt: "Re:VIEW Printing inc."
23
+ date: 2016-05-03
24
+ history: [["2012-01-30"],["2016-04-20","2016-05-03"]]
25
+ rights: (C) 2016 Re:VIEW Commiters, some rights reserved.
26
+ description: sample config.yml file for Re:VIEW book
27
+ urnid: urn:uid:http://reviewml.org/review-sample-book
28
+ # isbn: null
29
+
30
+ ## Book Structure
31
+
32
+ toclevel: 3
33
+ secnolevel: 2
34
+ toc: true
35
+ direction: "ltr"
36
+
37
+ ## Extra Pages
38
+
39
+ cover: null
40
+ coverimage: sample.jpg
41
+ # titlepage: null
42
+ # titlefile: null
43
+ # originaltitlefile: null
44
+ # creditfile: null
45
+ colophon: true
46
+ # backcover: null
47
+ # profile: null
48
+ # profiletitle: "About Authors"
49
+ # advfile: null
50
+
51
+ ## Syntax Highlighting
52
+
53
+ highlight:
54
+ html: "pygments"
55
+ latex: "listings"
56
+
57
+ ## for HTML
58
+
59
+ htmlext: html
60
+ stylesheet: ["style.css"]
61
+
62
+ ## for EPUB
63
+
64
+ epubmaker:
65
+ htmlext: xhtml
66
+ cover_linear: true
67
+ externallink: true
68
+
69
+ ## for LaTeX
70
+
71
+ texstyle: reviewmacro
72
+ texdocumentclass: ["jsbook", "uplatex,oneside"]
73
+
74
+ ## for PDFMaker
75
+
76
+ pdfmaker:
77
+ colophon: true