Skip to content

Commit

Permalink
Merge branch 'master' into news410
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuto committed Jan 2, 2020
2 parents c07d6dd + 0d4b6ff commit e7981e8
Show file tree
Hide file tree
Showing 21 changed files with 347 additions and 208 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ruby-win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: TestWin

on: [push]

jobs:
build:

runs-on: windows-latest
strategy:
fail-fast: false
matrix:
ruby: [ '2.6.x', '2.5.x', '2.4.x' ]

steps:
- uses: actions/checkout@v1
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Build and test with Rake
shell: bash
run: |
gem install bundler --no-document
bundle install --retry 3
bundle exec ruby test/run_test.rb --max-diff-target-string-size=10000 --verbose=v
- name: Test with epubcheck-ruby
shell: bash
run: |
gem install -N epubcheck-ruby
ruby bin/review-init hello
cd hello
ruby ../bin/review-epubmaker config.yml
epubcheck book.epub
cd ..
ruby bin/review-init hello2 --epub-version 2
cd hello2
ruby ../bin/review-epubmaker config.yml
epubcheck book.epub
cd ..
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ Re:VIEW uses its original format('Re:VIEW format') as source files. See doc/for

## Commands

There are two commands generate files directly.
There are commands generate files directly.

* review-epubmaker: generate EPUB file.
* review-pdfmaker: generate PDF file using LaTeX (TeXLive).
* review-textmaker: generate text files.
* review-webmaker: generate Web pages.
* review-idgxmlmaker: generate InDesign XML files.

And some useful commands.

* review-init: create a project.
* review-compile: compile Re:VIEW format files.
* review-vol: figure out size of Re:VIEW files.
* review-index: generate index with various format.
Expand Down Expand Up @@ -60,10 +62,11 @@ $ echo "export PATH=PATH_OF_REVIEW/bin:$PATH" >> ~/.profile
$ review-init hello
$ cd hello
$ (... add and edit *.re file, config.yml and catalog.yml ...)
$ rake epub ## generating EPUB
$ rake pdf ## generating PDF (Requirement TeXLive)
$ rake text ## generating texts
$ rake web ## generating Web pages
$ rake epub ## generating EPUB
$ rake pdf ## generating PDF (Requirement TeXLive)
$ rake text ## generating texts
$ rake web ## generating Web pages
$ rake idgxml ## generating InDesign XML files
```

For further information, see [doc/quickstart.md](https://github.com/kmuto/review/blob/master/doc/quickstart.md)
Expand Down Expand Up @@ -112,4 +115,4 @@ Exception:

## Copyright

Copyright (c) 2006-2019 Minero Aoki, Kenshi Muto, Masayoshi Takahashi, Masanori Kado.
Copyright (c) 2006-2020 Minero Aoki, Kenshi Muto, Masayoshi Takahashi, Masanori Kado.
20 changes: 0 additions & 20 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,11 @@ install:
build_script:
- bundle install
- bundle exec rake test --trace --verbose
- bundle exec rubocop

before_test:
- gem install -N epubcheck-ruby

test_script:
- ruby bin/review-init hello
- cd hello
- ruby ../bin/review-epubmaker config.yml
- epubcheck book.epub
- cd ..
- ruby bin/review-init hello2 --epub-version 2
- cd hello2
- ruby ../bin/review-epubmaker config.yml
- epubcheck book.epub

branches:
only:
- master

environment:
matrix:
- ruby_version: "24"
- ruby_version: "24-x64"
- ruby_version: "25"
- ruby_version: "25-x64"
- ruby_version: "26"
- ruby_version: "26-x64"
3 changes: 3 additions & 0 deletions doc/config.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ pdfmaker:
# 画像のscale=X.Xという指定を画像拡大縮小率からページ最大幅の相対倍率に変換する
# image_scale2width: true
#
# 画像のデフォルトのサイズを、版面横幅合わせではなく、原寸をそのまま利用する
# use_original_image_size: null
#
# PDFやIllustratorファイル(.ai)の画像のBoudingBoxの抽出に指定のボックスを採用する
# cropbox(デフォルト), mediabox, artbox, trimbox, bleedboxから選択する。
# Illustrator CC以降のIllustratorファイルに対してはmediaboxを指定する必要がある
Expand Down
13 changes: 7 additions & 6 deletions lib/review/book/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,20 @@ def each_chapter_r(&block)

def chapter_index
return @chapter_index if @chapter_index

contents = chapters
# TODO: contents += parts.find_all { |prt| prt.id.present? }
@chapter_index = ChapterIndex.new
each_chapter do |chap|
@chapter_index.add_item(Index::Item.new(chap.id, chap.number, chap))
end
parts.each do |prt|
if prt.id.present?
contents << prt
@chapter_index.add_item(Index::Item.new(prt.id, prt.number, prt))
end
end
@chapter_index = ChapterIndex.new(contents)
@chapter_index
end

def chapter(id)
chapter_index[id]
chapter_index[id].content
end

def next_chapter(chapter)
Expand Down
Loading

0 comments on commit e7981e8

Please sign in to comment.