Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,31 +100,31 @@ OSS Gateワークショップ参加者の方からよく寄せられる疑問へ

### 電子書籍用データ・印刷用データのビルド手順

Ubuntu 18.04LTS on WSL on Windows 10で動作を確認した
Ubuntu 20.04LTS on WSL on Windows 11で動作を確認した
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

20.04は今月でEOLなので22.04か24.04の方がいいかも?


必要なパッケージをインストールする。
必要なパッケージをインストールする。PDFtk、npmも必要。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この追加は必要ないかも?

コマンドラインを示しているので個別に必要なプロダクトのことをここで説明しなくてもいい気がします。(そうしないと、依存関係が増えるたびにコマンドラインだけじゃなくてここも更新しないといけなくなる。)


```bash
$ sudo apt install texlive-binaries texlive-lang-japanese \
texlive-latex-recommended texlive-latex-extra \
imagemagick \
ruby-dev build-essential
$ sudo apt -y install texlive-binaries texlive-lang-japanese \
texlive-latex-recommended texlive-latex-extra \
imagemagick \
ruby-dev build-essential pdftk-java nodejs npm
$ sudo gem install bundler -v 2.3.26
$ sudo gem install unicode-display_width
$ sudo npm install n -g
$ sudo n stable
$ sudo apt purge -y nodejs npm
$ sudo apt -y autoremove
$ exec $SHELL -l
```

npmのインストールも必要。
aptで入るバージョンは古いので、[Ubuntuに最新のNode.jsを難なくインストールする - Qiita](https://qiita.com/seibe/items/36cef7df85fe2cefa3ea)などで紹介されているように、`n`を使って最新安定版のnpmを使える状態にする。

PDFtkをインストールする。
ソースをクローンする。この後の手順で必要になるパッチが含まれている。

```bash
$ sudo add-apt-repository ppa:malteworld/ppa
$ sudo apt update
$ sudo apt install pdftk
$ git clone https://github.com/oss-gate/first-feedback-guidebooks.git
```

Re:VIEWをインストールする。リリース版(4.0.0)ではビルドに失敗したため、masterを使う
Re:VIEWをインストールする。v4.0.0にパッチを当て使う
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

その後新しいバージョンがリリースされているので最新バージョンを使うだけでいいかも?


<!--
```bash
Expand All @@ -135,13 +135,15 @@ $ sudo gem install review
```bash
$ git clone https://github.com/kmuto/review.git
$ cd review
$ git checkout v4.0.0 -b v4.0.0
$ cat ../first-feedback-guidebook/patches/review.patch | patch -p1
$ bundle install --path vendor/bundle
$ rake build
$ sudo gem install pkg/review-*.gem
$ cd ..
```

easybooksをインストールする。リリース版ではビルドに失敗し、且つ、要件を満たさないため、改造版を使う
easybooksをインストールする。リリース版ではビルドに失敗し、且つ、要件を満たさないため、改造版にパッチを当て使う
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これも最新のeasybooksでは直っているかも?


<!--
```bash
Expand All @@ -153,6 +155,7 @@ $ sudo npm install -g easybooks
$ git clone https://github.com/piroor/easybooks.git
$ cd easybooks
$ git checkout enhanced
$ cat ../first-feedback-guidebook/patches/easybooks.patch | patch -p1
$ npm install
$ npm run build
$ sudo npm install -g .
Expand All @@ -162,7 +165,6 @@ $ cd ..
以上で準備完了。makeするとPDFとEPUBの両方が作られ、distディレクトリ配下に出力される。

```bash
$ git clone https://github.com/oss-gate/first-feedback-guidebook.git
$ cd first-feedback-guidebook
$ make
```
Expand Down
2 changes: 1 addition & 1 deletion build-book.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ texdocumentclass_ebook=media=ebook,paperwidth=152mm,paperheight=227mm,head_space
texdocumentclass_print=media=print,paper=b5,head_space=30mm

cover_pdf='"titlepage": true,'
cover_epub='"coverimage":"images/tobira-ebook-01.png", "titlepage": false,'
cover_epub='"coverimage":"tobira-ebook-01.png", "titlepage": false,'

printing='"prt": "日光企画",'

Expand Down
3 changes: 3 additions & 0 deletions first-feedback-guidebook.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"toclevel": 2,
"secnolevel": 2,
"review_version": 4.0,
"epubmaker": {
"image_maxpixels": 30000000
},
"texstyle": [
"reviewmacro",
"em-bold"
Expand Down
12 changes: 12 additions & 0 deletions patches/easybooks.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/package.json b/package.json
index 0854214..317560d 100644
--- a/package.json
+++ b/package.json
@@ -41,6 +41,7 @@
"@babel/core": "^7.7.7",
"@babel/preset-env": "^7.7.7",
"@babel/preset-typescript": "^7.7.7",
+ "@types/babel__traverse": "7.14.2",
"@types/jest": "^24.0.25",
"@types/js-yaml": "3.12.1",
"@types/jszip": "^3.1.6",
12 changes: 12 additions & 0 deletions patches/review.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/lib/review/epubmaker.rb b/lib/review/epubmaker.rb
index e6b55149..0f08ee70 100644
--- a/lib/review/epubmaker.rb
+++ b/lib/review/epubmaker.rb
@@ -429,6 +429,7 @@ module ReVIEW
def detect_properties(path)
properties = []
File.open(path) do |f|
+ REXML::Document.entity_expansion_text_limit=3276800
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これ、必要でした?

最新のREXMLならなくても大丈夫な気がするんですけど。。。

doc = REXML::Document.new(f)
if REXML::XPath.first(doc, '//m:math', 'm' => 'http://www.w3.org/1998/Math/MathML')
properties << 'mathml'