review 3.0.0.preview1 → 3.0.0.preview2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.ja.md +61 -1
- data/NEWS.md +61 -1
- data/bin/review-epub2html +19 -0
- data/doc/config.yml.sample +24 -3
- data/doc/quickstart.md +1 -1
- data/lib/epubmaker/producer.rb +6 -1
- data/lib/review/book/base.rb +2 -2
- data/lib/review/book/index.rb +5 -1
- data/lib/review/book/volume.rb +1 -1
- data/lib/review/builder.rb +1 -1
- data/lib/review/compiler.rb +14 -6
- data/lib/review/configure.rb +1 -1
- data/lib/review/epub2html.rb +133 -0
- data/lib/review/epubmaker.rb +11 -4
- data/lib/review/extentions/string.rb +0 -1
- data/lib/review/htmlbuilder.rb +2 -2
- data/lib/review/i18n.rb +6 -0
- data/lib/review/i18n.yml +15 -3
- data/lib/review/idgxmlbuilder.rb +2 -2
- data/lib/review/init.rb +3 -3
- data/lib/review/latexbuilder.rb +13 -5
- data/lib/review/pdfmaker.rb +31 -25
- data/lib/review/plaintextbuilder.rb +2 -2
- data/lib/review/version.rb +1 -1
- data/review.gemspec +1 -1
- data/samples/LICENSE +20 -0
- data/{test → samples}/sample-book/README.md +0 -0
- data/{test → samples}/sample-book/src/Rakefile +0 -0
- data/{test → samples}/sample-book/src/_cover.html +0 -0
- data/{test → samples}/sample-book/src/catalog.yml +0 -0
- data/{test → samples}/sample-book/src/ch01.re +0 -0
- data/{test → samples}/sample-book/src/ch02.re +0 -0
- data/{test → samples}/sample-book/src/config-epub2.yml +0 -0
- data/{test → samples}/sample-book/src/config.yml +1 -1
- data/{test → samples}/sample-book/src/images/ch01-imgsample.jpg +0 -0
- data/{test → samples}/sample-book/src/images/cover.jpg +0 -0
- data/{test → samples}/sample-book/src/preface.re +0 -0
- data/{test → samples}/sample-book/src/sty/jumoline.sty +0 -0
- data/{test → samples}/sample-book/src/sty/reviewmacro.sty +0 -0
- data/{test → samples}/sample-book/src/style-web.css +0 -0
- data/{test/syntax-book → samples/sample-book/src}/style.css +1 -1
- data/{test → samples}/syntax-book/Gemfile +0 -0
- data/{test → samples}/syntax-book/Rakefile +0 -0
- data/{test → samples}/syntax-book/appA.re +0 -0
- data/{test → samples}/syntax-book/bib.re +0 -0
- data/{test → samples}/syntax-book/catalog.yml +0 -0
- data/{test → samples}/syntax-book/ch01.re +0 -0
- data/{test → samples}/syntax-book/ch02.re +0 -0
- data/{test → samples}/syntax-book/ch03.re +0 -0
- data/{test → samples}/syntax-book/config.yml +1 -1
- data/{test → samples}/syntax-book/images/ball.png +0 -0
- data/{test → samples}/syntax-book/images/cover.jpg +0 -0
- data/{test → samples}/syntax-book/images/fractal.png +0 -0
- data/{test → samples}/syntax-book/images/img3-1.png +0 -0
- data/{test → samples}/syntax-book/images/inlineicon.jpg +0 -0
- data/{test → samples}/syntax-book/images/logic.png +0 -0
- data/{test → samples}/syntax-book/images/logic2.png +0 -0
- data/{test → samples}/syntax-book/images/puzzle.jpg +0 -0
- data/{test → samples}/syntax-book/images/table.jpg +0 -0
- data/{test → samples}/syntax-book/part2.re +0 -0
- data/{test → samples}/syntax-book/pre01.re +0 -0
- data/{test → samples}/syntax-book/review-ext.rb +0 -0
- data/{test → samples}/syntax-book/sty/jumoline.sty +0 -0
- data/{test → samples}/syntax-book/sty/reviewmacro.sty +0 -0
- data/{test/sample-book/src → samples/syntax-book}/style.css +1 -1
- data/{test → samples}/syntax-book/syntax.dic +0 -0
- data/templates/latex/review-jlreq/review-style.sty +6 -2
- data/templates/latex/review-jsbook/review-base.sty +2 -7
- data/templates/latex/review-jsbook/review-style.sty +9 -1
- data/test/assets/test_template.tex +1 -1
- data/test/assets/test_template_backmatter.tex +1 -1
- data/test/test_compiler.rb +1 -3
- data/test/test_helper.rb +1 -1
- data/test/test_latexbuilder.rb +4 -2
- data/test/test_plaintextbuilder.rb +1 -1
- data/test/test_rstbuilder.rb +1 -1
- data/test/test_topbuilder.rb +6 -1
- metadata +46 -82
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e6427ee4da1631d65d87c3dbed0f7baa22c0b5fe87567db48dcc7f8634d8dba
|
4
|
+
data.tar.gz: f841605f6d137462bc72a8693c28bd29dbb466b3e17209384d2316f337ab8391
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dce795a98d0049b5453ca396428012366d72b69e8a3eb81f0cd71607d0fce535a118b613bdf27060049c3b5a2e9005f6d31bed634c5a0a0a662a45d018045cb
|
7
|
+
data.tar.gz: 4f3afb3e2acf13cd6549044a01aabda05271b35ad8c704333942dfc97661ec03b8e6109e6cd18854b61ffd30c8ec9ce01c56ee827cfb0bb012d79552c4691f79
|
data/NEWS.ja.md
CHANGED
@@ -1,3 +1,56 @@
|
|
1
|
+
# Version 3.0.0 preview 2
|
2
|
+
|
3
|
+
## 新機能
|
4
|
+
* CSS 組版向けに EPUB ファイルを単一 HTML ファイルに変換する `review-epub2html` コマンドを追加しました ([#1098])
|
5
|
+
|
6
|
+
## 非互換の変更
|
7
|
+
* PDFMaker: `texcommand`、`dvicommmand`、`makeindex_command` に空白文字入りのパスを指定できるようにしました。これに伴い、これらのパラメータはコマンドオプションを取ることはできなくなりました。コマンドオプションは本来の `texoptions`、`dvioptions`、`makeindex_options` のパラメータに指定してください ([#1091])
|
8
|
+
* PDFMaker: book.re というファイルで生じるビルドの失敗を修正しました。これまではベースファイルとして `book.tex` という名前のファイルを内部で作成していましたが、`__REVIEW_BOOK__.tex` という名前に変更しました ([#1081])
|
9
|
+
* PDFMaker: jsbook ベーススタイルにおいて、geometry を読み込まないようにしました ([#912])
|
10
|
+
* PDFMaker: jsbook ベーススタイルにおいて、ページ番号を見開きの左右に振るようにしました ([#1032])
|
11
|
+
* `@<chapref>`、`@<hd>`、`@<column>` 命令の展開文字列をビルダ間で統一するとともに、`locale.yml` ファイルで変更できるようにしました。`@<chapref>` はデフォルトでは `第1章「FOO」` のようになります(`chapter_quote`、`chapter_quote_without_number` で変更可)。`chapter_quote` メッセージは2つの `%s` を取るようになりました。`@<hd>` は `「2.1 BAR」` のようになります(`hd_quote`、`hd_quote_without_number` で変更可)。`@<column>` は `コラム「BAZ」` のようになります(`column` で変更可) ([#886])
|
12
|
+
|
13
|
+
## バグ修正
|
14
|
+
* EPUBMaker: OPF ファイルの modified の時刻の表記を正しい UTC 値にしました ([#1094])
|
15
|
+
* `contentdir` パラメータでサブフォルダを使用しているときに、参考文献ファイルがそのフォルダから読まれない問題を修正しました ([#1103])
|
16
|
+
* PDFMaker: 索引辞書の読み込みなど、パラメータで指定したファイルのパスが解決されない問題を修正しました ([#1086])
|
17
|
+
* preview 1 でのフェンス記法内のエスケープの不具合を修正しました ([#1083])
|
18
|
+
* サンプル CSS 内の不要なタブ文字を除去しました ([#1084])
|
19
|
+
|
20
|
+
## 機能強化
|
21
|
+
* PDFMaker: tableとfigureでのフロート設定をマクロ `\floatplacement` で定義できるようにしました ([#1095])
|
22
|
+
* EPUBMaker: エラーと警告の出力に logger 機能を利用するようにしました ([#1077])
|
23
|
+
* PDFMaker: `dvicommand` パラメータが null の場合は、dvipdfmx などの変換コマンドを呼び出さないようにしました ([#1065])
|
24
|
+
|
25
|
+
## ドキュメント
|
26
|
+
* サンプルドキュメントを samples フォルダに移動しました ([#1073])
|
27
|
+
* `config.yml.sample` に索引関連のフックおよびパラメータのコメントを追加しました ([#1097])
|
28
|
+
* quickstart.md のタイプミスを修正しました ([#1079])
|
29
|
+
|
30
|
+
## コントリビューターのみなさん
|
31
|
+
* [@aiya000](https://github.com/aiya000)
|
32
|
+
* [@sho-h](https://github.com/sho-h)
|
33
|
+
* [@kateinoigakukun](https://github.com/kateinoigakukun)
|
34
|
+
|
35
|
+
[#886]: https://github.com/kmuto/review/issues/886
|
36
|
+
[#912]: https://github.com/kmuto/review/issues/912
|
37
|
+
[#1032]: https://github.com/kmuto/review/issues/1032
|
38
|
+
[#1065]: https://github.com/kmuto/review/pull/1065
|
39
|
+
[#1073]: https://github.com/kmuto/review/issues/1073
|
40
|
+
[#1077]: https://github.com/kmuto/review/pull/1077
|
41
|
+
[#1079]: https://github.com/kmuto/review/pull/1079
|
42
|
+
[#1080]: https://github.com/kmuto/review/issues/1080
|
43
|
+
[#1081]: https://github.com/kmuto/review/pull/1081
|
44
|
+
[#1083]: https://github.com/kmuto/review/issues/1083
|
45
|
+
[#1084]: https://github.com/kmuto/review/pull/1084
|
46
|
+
[#1086]: https://github.com/kmuto/review/issues/1086
|
47
|
+
[#1091]: https://github.com/kmuto/review/pull/1091
|
48
|
+
[#1094]: https://github.com/kmuto/review/pull/1094
|
49
|
+
[#1095]: https://github.com/kmuto/review/pull/1095
|
50
|
+
[#1097]: https://github.com/kmuto/review/pull/1097
|
51
|
+
[#1098]: https://github.com/kmuto/review/pull/1098
|
52
|
+
[#1103]: https://github.com/kmuto/review/pull/1103
|
53
|
+
|
1
54
|
# Version 3.0.0 preview 1
|
2
55
|
|
3
56
|
## 新機能
|
@@ -79,6 +132,7 @@
|
|
79
132
|
[#1006]: https://github.com/kmuto/review/issues/1006
|
80
133
|
[#1007]: https://github.com/kmuto/review/issues/1007
|
81
134
|
[#1008]: https://github.com/kmuto/review/pull/1008
|
135
|
+
[#1010]: https://github.com/kmuto/review/pull/1010
|
82
136
|
[#1016]: https://github.com/kmuto/review/issues/1016
|
83
137
|
[#1022]: https://github.com/kmuto/review/issues/1022
|
84
138
|
[#1027]: https://github.com/kmuto/review/issues/1027
|
@@ -302,6 +356,7 @@
|
|
302
356
|
[#785]: https://github.com/kmuto/review/issues/785
|
303
357
|
[#787]: https://github.com/kmuto/review/issues/787
|
304
358
|
[#788]: https://github.com/kmuto/review/issues/788
|
359
|
+
[#794]: https://github.com/kmuto/review/issues/794
|
305
360
|
[#795]: https://github.com/kmuto/review/issues/795
|
306
361
|
|
307
362
|
|
@@ -535,7 +590,7 @@
|
|
535
590
|
* locale.yaml -> locale.yml
|
536
591
|
* PageMetric.a5 -> PageMetric::A5
|
537
592
|
* locale.yaml や layout.erb を使っているとエラーになります
|
538
|
-
* `prt` は `発行所` ではなく `印刷所` になります. `発行所` は `pbl` です.([#562, #593])
|
593
|
+
* `prt` は `発行所` ではなく `印刷所` になります. `発行所` は `pbl` です.([#562], [#593])
|
539
594
|
* `appendix_format` を廃止しました ([#609])
|
540
595
|
* inaobuilder を廃止しました (アップストリームで修正Markdownを使用することになったため) ([#573])
|
541
596
|
* 古い epubmaker を削除しました
|
@@ -678,12 +733,17 @@
|
|
678
733
|
* latexbuilderで`//list`がhighlitingなしのときにキャプションが表示されなくなっていたのを修正しました ([#465])
|
679
734
|
* markdownbuilderでdefinition listを使うとエラーになるのを修正しました ([#473])
|
680
735
|
|
736
|
+
[#465]: https://github.com/kmuto/review/issues/465
|
737
|
+
[#473]: https://github.com/kmuto/review/issues/473
|
738
|
+
|
681
739
|
# Version 1.7.1の主な変更点
|
682
740
|
|
683
741
|
## バグ修正
|
684
742
|
* latexbuilderで`//listnum`のキャプションが2重に出力されるバグを修正しました ([#465])
|
685
743
|
* review-initで生成される雛形を元にEPUB3のファイルを作成するとepubcheck 4.0.1でエラーになるバグを修正しました ([#456])
|
686
744
|
|
745
|
+
[#456]: https://github.com/kmuto/review/issues/473
|
746
|
+
|
687
747
|
# Version 1.7.0の主な変更点
|
688
748
|
|
689
749
|
## 全般
|
data/NEWS.md
CHANGED
@@ -1,3 +1,56 @@
|
|
1
|
+
# Version 3.0.0 preview 2
|
2
|
+
|
3
|
+
## New Features
|
4
|
+
* add `review-epub2html` to produce single HTML file from EPUB file for CSS typesetting ([#1098])
|
5
|
+
|
6
|
+
## Breaking Changes
|
7
|
+
* PDFMaker: allow a path with space character on `texcommand`, `dvicommmand`, and `makeindex_command`. Due to this change, these parameters no longer take command options. use `texoptions`, `dvioptions`, and `makeindex_options` to specify options ([#1091])
|
8
|
+
* PDFMaker: the file used internally has been changed from `book.tex` to `__REVIEW_BOOK__.tex` ([#1081])
|
9
|
+
* PDFMaker: dropped geometry.sty from jsbook style ([#912])
|
10
|
+
* PDFMaker: use twocolumn option for jsbook style ([#1032])
|
11
|
+
* unified strings expanded by `@<chapref>`, `@<hd>`, and `@<column>` op between builders. you can customize it with `locale.yml`. `@<chapref>` will be expanded like `Chapter 1 "FOO"` (locale msgid: `chapter_quote` and `chapter_quote_without_number`). `chapter_quote` now takes two `%s`. `@<hd>` will be expanded like `"2.1 BAR"` (locale msgid: `hd_quote` and `hd_quote_without_number`). `@<column>` will be extended like `Column BAZ` (locale msgid: `column`) ([#886])
|
12
|
+
|
13
|
+
## Bug Fixes
|
14
|
+
* EPUBMaker: `modified` value of OPF file is now correct UTC time ([#1094])
|
15
|
+
* fix an issue where bibliography file in `contentdir` could not be read ([#1103])
|
16
|
+
* PDFMaker: fix an issue where the file specified by the parameter could not be found ([#1086])
|
17
|
+
* fix a bug in the fence escaping that occurred in preview1 ([#1083])
|
18
|
+
* remove unwanted tab character from sample CSS ([#1084])
|
19
|
+
|
20
|
+
## Enhancements
|
21
|
+
* PDFMaker: use `\floatplacement` to configure float settings of table and figure ([#1095])
|
22
|
+
* EPUBMaker: use logger function to export error/warning ([#1077])
|
23
|
+
* PDFMaker: do not use dvipdfmx when `dvicommand` parameter is null ([#1065])
|
24
|
+
|
25
|
+
## Docs
|
26
|
+
* Move sample documents to /samples folder ([#1073])
|
27
|
+
* Add descriptions abount hooks and parameters of indexing into `config.yml.sample` ([#1097])
|
28
|
+
* Fix typo in quickstart.md ([#1079])
|
29
|
+
|
30
|
+
## Contributors
|
31
|
+
* [@aiya000](https://github.com/aiya000)
|
32
|
+
* [@sho-h](https://github.com/sho-h)
|
33
|
+
* [@kateinoigakukun](https://github.com/kateinoigakukun)
|
34
|
+
|
35
|
+
[#886]: https://github.com/kmuto/review/issues/886
|
36
|
+
[#912]: https://github.com/kmuto/review/issues/912
|
37
|
+
[#1032]: https://github.com/kmuto/review/issues/1032
|
38
|
+
[#1065]: https://github.com/kmuto/review/pull/1065
|
39
|
+
[#1073]: https://github.com/kmuto/review/issues/1073
|
40
|
+
[#1077]: https://github.com/kmuto/review/pull/1077
|
41
|
+
[#1079]: https://github.com/kmuto/review/pull/1079
|
42
|
+
[#1081]: https://github.com/kmuto/review/pull/1081
|
43
|
+
[#1080]: https://github.com/kmuto/review/issues/1080
|
44
|
+
[#1083]: https://github.com/kmuto/review/issues/1083
|
45
|
+
[#1084]: https://github.com/kmuto/review/pull/1084
|
46
|
+
[#1086]: https://github.com/kmuto/review/issues/1086
|
47
|
+
[#1091]: https://github.com/kmuto/review/pull/1091
|
48
|
+
[#1094]: https://github.com/kmuto/review/pull/1094
|
49
|
+
[#1095]: https://github.com/kmuto/review/pull/1095
|
50
|
+
[#1097]: https://github.com/kmuto/review/pull/1097
|
51
|
+
[#1098]: https://github.com/kmuto/review/pull/1098
|
52
|
+
[#1103]: https://github.com/kmuto/review/pull/1103
|
53
|
+
|
1
54
|
# Version 3.0.0 preview 1
|
2
55
|
|
3
56
|
## New Features
|
@@ -78,6 +131,7 @@
|
|
78
131
|
[#1006]: https://github.com/kmuto/review/issues/1006
|
79
132
|
[#1007]: https://github.com/kmuto/review/issues/1007
|
80
133
|
[#1008]: https://github.com/kmuto/review/pull/1008
|
134
|
+
[#1010]: https://github.com/kmuto/review/pull/1010
|
81
135
|
[#1016]: https://github.com/kmuto/review/issues/1016
|
82
136
|
[#1022]: https://github.com/kmuto/review/issues/1022
|
83
137
|
[#1027]: https://github.com/kmuto/review/issues/1027
|
@@ -87,6 +141,7 @@
|
|
87
141
|
[#1045]: https://github.com/kmuto/review/issues/1045
|
88
142
|
[#1046]: https://github.com/kmuto/review/issues/1046
|
89
143
|
[#1059]: https://github.com/kmuto/review/issues/1059
|
144
|
+
[#1060]: https://github.com/kmuto/review/issues/1060
|
90
145
|
[#1063]: https://github.com/kmuto/review/issues/1063
|
91
146
|
|
92
147
|
# Version 2.5.0
|
@@ -307,6 +362,7 @@
|
|
307
362
|
[#785]: https://github.com/kmuto/review/issues/785
|
308
363
|
[#787]: https://github.com/kmuto/review/issues/787
|
309
364
|
[#788]: https://github.com/kmuto/review/issues/788
|
365
|
+
[#794]: https://github.com/kmuto/review/issues/794
|
310
366
|
[#795]: https://github.com/kmuto/review/issues/795
|
311
367
|
|
312
368
|
|
@@ -541,7 +597,7 @@
|
|
541
597
|
* locale.yaml -> locale.yml
|
542
598
|
* PageMetric.a5 -> PageMetric::A5
|
543
599
|
* raise error when using locale.yaml and layout.erb
|
544
|
-
* `prt` is printer(`印刷所`), not publisher(`発行所`). `発行所` is `pbl`. ([#562, #593])
|
600
|
+
* `prt` is printer(`印刷所`), not publisher(`発行所`). `発行所` is `pbl`. ([#562], [#593])
|
545
601
|
* Obsolete `appendix_format` ([#609])
|
546
602
|
* Remove obsolete inaobuilder. (upstream changed their mind to use modified Markdown) ([#573])
|
547
603
|
* Remove obsolete legacy epubmaker
|
@@ -684,11 +740,15 @@
|
|
684
740
|
* Fix latexbuilder to show caption in `//list` without highliting ([#465])
|
685
741
|
* Fix markdownbuilder to use definition list ([#473])
|
686
742
|
|
743
|
+
[#465]: https://github.com/kmuto/review/issues/465
|
744
|
+
[#473]: https://github.com/kmuto/review/issues/473
|
745
|
+
|
687
746
|
# Version 1.7.1
|
688
747
|
|
689
748
|
## Bug Fix
|
690
749
|
* Fix latexbuilder to display caption twice in `//listnum` ([#465])
|
691
750
|
* Fix review-init to generate non-valid EPUB3 file with epubcheck 4.0.1 ([#456])
|
751
|
+
[#456]: https://github.com/kmuto/review/issues/473
|
692
752
|
|
693
753
|
# Version 1.7.0
|
694
754
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018 Kenshi Muto
|
4
|
+
#
|
5
|
+
# This program is free software.
|
6
|
+
# You can distribute or modify this program under the terms of
|
7
|
+
# the GNU LGPL, Lesser General Public License version 2.1.
|
8
|
+
# For details of the GNU LGPL, see the file "COPYING".
|
9
|
+
|
10
|
+
require 'pathname'
|
11
|
+
|
12
|
+
bindir = Pathname.new(__FILE__).realpath.dirname
|
13
|
+
$LOAD_PATH.unshift((bindir + '../lib').realpath)
|
14
|
+
|
15
|
+
require 'review/epub2html'
|
16
|
+
|
17
|
+
if File.basename($PROGRAM_NAME) == File.basename(__FILE__)
|
18
|
+
ReVIEW::Epub2Html.execute(*ARGV)
|
19
|
+
end
|
data/doc/config.yml.sample
CHANGED
@@ -311,11 +311,19 @@ pdfmaker:
|
|
311
311
|
# 渡される引数1=作業用展開ディレクトリ、引数2=呼び出しを実行したディレクトリ
|
312
312
|
# hook_beforetexcompile: null
|
313
313
|
#
|
314
|
-
#
|
314
|
+
# 索引処理前に実行するプログラム。idxファイルを加工したいときなどに使用する。
|
315
|
+
# 渡される引数1=作業用展開ディレクトリ、引数2=呼び出しを実行したディレクトリ
|
316
|
+
# hook_beforemakeindex: null
|
317
|
+
#
|
318
|
+
# 索引処理後に実行するプログラム。indファイルを加工したいときなどに使用する。
|
319
|
+
# 渡される引数1=作業用展開ディレクトリ、引数2=呼び出しを実行したディレクトリ
|
320
|
+
# hook_aftermakeindex: null
|
321
|
+
#
|
322
|
+
# ひととおりのコンパイル後に実行するプログラム。目次を加工して再度コンパイルしたいときなどに使用する。
|
315
323
|
# 渡される引数1=作業用展開ディレクトリ、引数2=呼び出しを実行したディレクトリ
|
316
324
|
# hook_aftertexcompile: null
|
317
325
|
#
|
318
|
-
# PDF(
|
326
|
+
# PDF(__REVIEW_BOOK__.pdf)作成後に実行するプログラム。PDFに加工を施したいときに使用する。
|
319
327
|
# 渡される引数1=作業用展開ディレクトリ、引数2=呼び出しを実行したディレクトリ
|
320
328
|
# hook_afterdvipdf: null
|
321
329
|
#
|
@@ -327,7 +335,20 @@ pdfmaker:
|
|
327
335
|
# Illustrator CC以降のIllustratorファイルに対してはmediaboxを指定する必要がある
|
328
336
|
# bbox: mediabox
|
329
337
|
#
|
338
|
+
# 索引を作成するか。trueにすると索引作成が有効になる
|
339
|
+
# makeindex: null
|
340
|
+
# 索引作成コマンド
|
341
|
+
# makeindex_command: mendex
|
342
|
+
# 索引作成コマンドのオプション
|
343
|
+
# makeindex_options: "-f -r -I utf8"
|
344
|
+
# 索引作成コマンドのスタイルファイル
|
345
|
+
# makeindex_sty: null
|
346
|
+
# 索引作成コマンドの辞書ファイル
|
347
|
+
# makeindex_dic: null
|
348
|
+
# MeCabによる索引読み探索を使うか
|
349
|
+
# makeindex_mecab: true
|
350
|
+
# MeCabの読みの取得オプション
|
351
|
+
# makeindex_mecab_opts: "-Oyomi"
|
330
352
|
# 奥付を作成するか。trueを指定するとデフォルトの奥付、ファイル名を指定するとそれがcolophon.htmlとしてコピーされる
|
331
353
|
colophon: true
|
332
354
|
# pdfmaker:階層を使うものはここまで
|
333
|
-
|
data/doc/quickstart.md
CHANGED
@@ -17,7 +17,7 @@ Re:VIEW is a software in Ruby and worked in Linux/Unix, Mac OS X, and Windows. Y
|
|
17
17
|
|
18
18
|
Note that Re:VIEW format is plain texts with simple markups in UTF-8, so you can write it on any editors and OSes.
|
19
19
|
|
20
|
-
### using
|
20
|
+
### using RubyGems
|
21
21
|
|
22
22
|
Re:VIEW is released as RubyGems.
|
23
23
|
|
data/lib/epubmaker/producer.rb
CHANGED
@@ -45,6 +45,10 @@ module EPUBMaker
|
|
45
45
|
merge_config(@config.deep_merge(loader.load_file(file)))
|
46
46
|
end
|
47
47
|
|
48
|
+
def warn(msg)
|
49
|
+
@logger.warn(msg)
|
50
|
+
end
|
51
|
+
|
48
52
|
# Construct producer object.
|
49
53
|
# +config+ takes initial parameter hash. This parameters can be overriden by EPUBMaker#load or EPUBMaker#merge_config.
|
50
54
|
# +version+ takes EPUB version (default is 2).
|
@@ -54,6 +58,7 @@ module EPUBMaker
|
|
54
58
|
@epub = nil
|
55
59
|
@config['epubversion'] = version unless version.nil?
|
56
60
|
@res = ReVIEW::I18n
|
61
|
+
@logger = ReVIEW.logger
|
57
62
|
|
58
63
|
merge_config(config) if config
|
59
64
|
end
|
@@ -231,7 +236,7 @@ module EPUBMaker
|
|
231
236
|
defaults = ReVIEW::Configure.new.merge(
|
232
237
|
'language' => 'ja',
|
233
238
|
'date' => Time.now.strftime('%Y-%m-%d'),
|
234
|
-
'modified' => Time.now.strftime('%Y-%02m-%02dT%02H:%02M:%02SZ'),
|
239
|
+
'modified' => Time.now.utc.strftime('%Y-%02m-%02dT%02H:%02M:%02SZ'),
|
235
240
|
'isbn' => nil,
|
236
241
|
'toclevel' => 2,
|
237
242
|
'stylesheet' => [],
|
data/lib/review/book/base.rb
CHANGED
@@ -249,11 +249,11 @@ module ReVIEW
|
|
249
249
|
end
|
250
250
|
|
251
251
|
def read_bib
|
252
|
-
File.read(File.join(
|
252
|
+
File.read(File.join(contentdir, bib_file))
|
253
253
|
end
|
254
254
|
|
255
255
|
def bib_exist?
|
256
|
-
File.exist?(File.join(
|
256
|
+
File.exist?(File.join(contentdir, bib_file))
|
257
257
|
end
|
258
258
|
|
259
259
|
def prefaces
|
data/lib/review/book/index.rb
CHANGED
@@ -108,7 +108,11 @@ module ReVIEW
|
|
108
108
|
end
|
109
109
|
|
110
110
|
def display_string(id)
|
111
|
-
|
111
|
+
if number(id)
|
112
|
+
I18n.t('chapter_quote', [number(id), title(id)])
|
113
|
+
else
|
114
|
+
I18n.t('chapter_quote_without_number', title(id))
|
115
|
+
end
|
112
116
|
end
|
113
117
|
end
|
114
118
|
|
data/lib/review/book/volume.rb
CHANGED
data/lib/review/builder.rb
CHANGED
data/lib/review/compiler.rb
CHANGED
@@ -536,11 +536,19 @@ module ReVIEW
|
|
536
536
|
def replace_fence(str)
|
537
537
|
str.gsub(/@<(\w+)>([$|])(.+?)(\2)/) do
|
538
538
|
op = $1
|
539
|
-
arg = $3
|
540
|
-
|
539
|
+
arg = $3
|
540
|
+
if arg =~ /[\x01\x02\x03\x04]/
|
541
|
+
error "invalid character in '#{str}'"
|
542
|
+
end
|
543
|
+
replaced = arg.gsub('@', "\x01").gsub('\\', "\x02").gsub('{', "\x03").gsub('}', "\x04")
|
544
|
+
"@<#{op}>{#{replaced}}"
|
541
545
|
end
|
542
546
|
end
|
543
547
|
|
548
|
+
def revert_replace_fence(str)
|
549
|
+
str.gsub("\x01", '@').gsub("\x02", '\\').gsub("\x03", '{').gsub("\x04", '}')
|
550
|
+
end
|
551
|
+
|
544
552
|
def text(str)
|
545
553
|
return '' if str.empty?
|
546
554
|
words = replace_fence(str).split(/(@<\w+>\{(?:[^\}\\]|\\.)*?\})/, -1)
|
@@ -549,12 +557,12 @@ module ReVIEW
|
|
549
557
|
error "`@<xxx>' seen but is not valid inline op: #{w}"
|
550
558
|
end
|
551
559
|
end
|
552
|
-
result = @strategy.nofunc_text(words.shift)
|
560
|
+
result = @strategy.nofunc_text(revert_replace_fence(words.shift))
|
553
561
|
until words.empty?
|
554
|
-
result << compile_inline(words.shift.gsub(/\\\}/, '}').gsub(/\\\\/, '\\'))
|
555
|
-
result << @strategy.nofunc_text(words.shift)
|
562
|
+
result << compile_inline(revert_replace_fence(words.shift.gsub(/\\\}/, '}').gsub(/\\\\/, '\\')))
|
563
|
+
result << @strategy.nofunc_text(revert_replace_fence(words.shift))
|
556
564
|
end
|
557
|
-
result
|
565
|
+
result
|
558
566
|
rescue => err
|
559
567
|
error err.message
|
560
568
|
end
|
data/lib/review/configure.rb
CHANGED
@@ -77,7 +77,7 @@ module ReVIEW
|
|
77
77
|
'footnotetext' => nil,
|
78
78
|
'texcommand' => 'uplatex',
|
79
79
|
'texoptions' => '-interaction=nonstopmode -file-line-error',
|
80
|
-
'texdocumentclass' => ['jsbook', 'uplatex,
|
80
|
+
'texdocumentclass' => ['jsbook', 'uplatex,twoside'],
|
81
81
|
'dvicommand' => 'dvipdfmx',
|
82
82
|
'dvioptions' => '-d 5 -z 9',
|
83
83
|
# for PDFMaker
|
@@ -0,0 +1,133 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2018 Kenshi Muto
|
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 the GNU LGPL, see the file "COPYING".
|
8
|
+
|
9
|
+
require 'zip'
|
10
|
+
require 'rexml/document'
|
11
|
+
require 'cgi'
|
12
|
+
|
13
|
+
module ReVIEW
|
14
|
+
class Epub2Html
|
15
|
+
def self.execute(*args)
|
16
|
+
new.execute(*args)
|
17
|
+
end
|
18
|
+
|
19
|
+
def execute(*args)
|
20
|
+
if args[0].nil? || !File.exist?(args[0])
|
21
|
+
STDERR.puts <<EOT
|
22
|
+
Usage: #{File.basename($PROGRAM_NAME)} EPUBfile [file_for_head_and_foot] > HTMLfile
|
23
|
+
file_for_head_and_foot: HTML file to extract header and footer area.
|
24
|
+
This file must be contained in the EPUB.
|
25
|
+
If omitted, the first found file is used.
|
26
|
+
EOT
|
27
|
+
exit 1
|
28
|
+
end
|
29
|
+
|
30
|
+
parse_epub(args[0])
|
31
|
+
puts join_html(args[1])
|
32
|
+
end
|
33
|
+
|
34
|
+
def initialize
|
35
|
+
@opfxml = nil
|
36
|
+
@htmls = {}
|
37
|
+
@head = nil
|
38
|
+
@tail = nil
|
39
|
+
end
|
40
|
+
|
41
|
+
def parse_epub(epubname)
|
42
|
+
Zip::File.open(epubname) do |zio|
|
43
|
+
zio.each do |entry|
|
44
|
+
if entry.name =~ /.+\.opf\Z/
|
45
|
+
opf = entry.get_input_stream.read
|
46
|
+
@opfxml = REXML::Document.new(opf)
|
47
|
+
elsif entry.name =~ /.+\.x?html\Z/
|
48
|
+
@htmls[entry.name.sub('OEBPS/', '')] = entry.get_input_stream.read.force_encoding('utf-8')
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
nil
|
53
|
+
end
|
54
|
+
|
55
|
+
def take_headtail(html)
|
56
|
+
@head = html.sub(/(<body.*?>).*/m, '\1')
|
57
|
+
@tail = html.sub(%r{.*(</body>)}m, '\1')
|
58
|
+
end
|
59
|
+
|
60
|
+
def sanitize(s)
|
61
|
+
s = s.sub(/\.x?html\Z/, '').
|
62
|
+
sub(%r{\A\./}, '')
|
63
|
+
's_' + CGI.escape(s).
|
64
|
+
gsub(/[.,+%]/, '_')
|
65
|
+
end
|
66
|
+
|
67
|
+
def modify_html(fname, html)
|
68
|
+
doc = REXML::Document.new(html)
|
69
|
+
doc.context[:attribute_quote] = :quote
|
70
|
+
|
71
|
+
ids = {}
|
72
|
+
|
73
|
+
doc.each_element('//*[@id]') do |e|
|
74
|
+
sid = "#{sanitize(fname)}_#{sanitize(e.attributes['id'])}"
|
75
|
+
while ids[sid]
|
76
|
+
sid += 'E'
|
77
|
+
end
|
78
|
+
ids[sid] = true
|
79
|
+
e.attributes['id'] = sid
|
80
|
+
end
|
81
|
+
|
82
|
+
doc.each_element('//a[@href]') do |e|
|
83
|
+
href = e.attributes['href']
|
84
|
+
if href.start_with?('http:', 'https:', 'ftp:', 'ftps:', 'mailto:')
|
85
|
+
next
|
86
|
+
end
|
87
|
+
|
88
|
+
file, anc = href.split('#', 2)
|
89
|
+
if anc
|
90
|
+
if file.empty?
|
91
|
+
anc = "#{sanitize(fname)}_#{sanitize(anc)}"
|
92
|
+
else
|
93
|
+
anc = "#{sanitize(file)}_#{sanitize(anc)}"
|
94
|
+
end
|
95
|
+
else
|
96
|
+
anc = sanitize(file)
|
97
|
+
end
|
98
|
+
|
99
|
+
e.attributes['href'] = "##{anc}"
|
100
|
+
end
|
101
|
+
|
102
|
+
doc.to_s.
|
103
|
+
sub(/.*(<body.*?>)/m, %Q(<section id="#{sanitize(fname)}">)).
|
104
|
+
sub(%r{(</body>).*}m, '</section>')
|
105
|
+
end
|
106
|
+
|
107
|
+
def join_html(reffile)
|
108
|
+
body = []
|
109
|
+
make_list.each do |fname|
|
110
|
+
if @head.nil? && (reffile.nil? || reffile == fname)
|
111
|
+
take_headtail(@htmls[fname])
|
112
|
+
end
|
113
|
+
|
114
|
+
body << modify_html(fname, @htmls[fname])
|
115
|
+
end
|
116
|
+
"#{@head}\n#{body.join("\n")}\n#{@tail}"
|
117
|
+
end
|
118
|
+
|
119
|
+
def make_list
|
120
|
+
items = {}
|
121
|
+
@opfxml.each_element("/package/manifest/item[@media-type='application/xhtml+xml']") do |e|
|
122
|
+
items[e.attributes['id']] = e.attributes['href']
|
123
|
+
end
|
124
|
+
|
125
|
+
files = []
|
126
|
+
@opfxml.each_element('/package/spine/itemref') do |e|
|
127
|
+
files.push(items[e.attributes['idref']])
|
128
|
+
end
|
129
|
+
|
130
|
+
files
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|