Skip to content

Commit 129c0be

Browse files
committed
Fix docker re:view version
1 parent 5da2b86 commit 129c0be

8 files changed

Lines changed: 49 additions & 9 deletions

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!Dockerfile

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM ruby:3.3-bookworm
2+
3+
# TeX Live + Japanese support for Re:VIEW PDF builds
4+
RUN apt-get update && apt-get install -y --no-install-recommends \
5+
texlive-luatex \
6+
texlive-lang-japanese \
7+
texlive-lang-cjk \
8+
texlive-fonts-recommended \
9+
texlive-fonts-extra \
10+
texlive-latex-recommended \
11+
texlive-latex-extra \
12+
texlive-plain-generic \
13+
texlive-extra-utils \
14+
lmodern \
15+
pandoc \
16+
nodejs \
17+
npm \
18+
ghostscript \
19+
&& rm -rf /var/lib/apt/lists/*
20+
21+
RUN gem install bundler:4.0.3
22+
23+
WORKDIR /book

articles/sty/review-base.sty

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
\ProvidesClass{review-base}[2020/12/31]
22
\RequirePackage{ifthen}
33
\@ifundefined{Hy@Info}{% for jsbook.cls
4+
\PassOptionsToPackage{dvipdfmx}{pxjahyper}
45
\RequirePackage[dvipdfmx,bookmarks=true,bookmarksnumbered=true]{hyperref}
5-
\RequirePackage[dvipdfmx]{pxjahyper}
6+
\RequirePackage{pxjahyper}
67
\newif\if@reclscover \@reclscovertrue
78
\newcommand{\includefullpagegraphics}[2][]{%
89
\thispagestyle{empty}%

articles/sty/review-jsbook.cls

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,13 +384,14 @@
384384

385385
%% load hyperref package
386386
\PassOptionsToPackage{hyphens}{url} % URLにハイフンが含まれる場合でも改行されるようにする
387+
\PassOptionsToPackage{dvipdfmx}{pxjahyper}
387388
\RequirePackage[dvipdfmx, \if@pdfhyperlink\else draft,\fi
388389
bookmarks=true,
389390
bookmarksnumbered=true,
390391
hidelinks,
391392
setpagesize=false,
392393
]{hyperref}
393-
\RequirePackage[dvipdfmx]{pxjahyper}
394+
\RequirePackage{pxjahyper}
394395

395396
%% more useful macros
396397
%% ----------

articles/sty/techbooster-doujin-base.sty

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
\renewcommand{\captionsize}{\fontsize{9}{9}\selectfont}
6161
\newlength{\captionnumwidth}
6262
\setlength{\captionnumwidth}{6zw}
63-
%\newlength{\captionwidth}
63+
\@ifundefined{captionwidth}{\newlength{\captionwidth}}{}
6464
\setlength{\captionwidth}{\textwidth}
6565
\addtolength{\captionwidth}{-\captionnumwidth}
6666
\def\captionhead{\sffamily{\color{black!30!white}{▲}}}

build-in-docker-epub.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
[ ! -z $REVIEW_CONFIG_FILE ] || REVIEW_CONFIG_FILE="config-epub-$REVIEW_LANG.yml"
44

55
# コマンド手打ちで作業したい時は以下の通り /book に pwd がマウントされます
6-
# docker run -i -t -v $(pwd):/book vvakame/review:5.1 /bin/bash
6+
# docker run -i -t -v $(pwd):/book review-custom:5.11 /bin/bash
7+
8+
DOCKER_IMAGE="review-custom:5.11"
9+
10+
# イメージが存在しない場合はビルドする
11+
if ! docker image inspect "$DOCKER_IMAGE" > /dev/null 2>&1; then
12+
docker build -t "$DOCKER_IMAGE" .
13+
fi
714

815
# reduce size of images
916
REVIEW_IMAGE_DIR="articles/images_$REVIEW_LANG"
@@ -12,7 +19,7 @@ IMAGEMAGICK_COMMAND='mogrify -format jpg -quality 75 -background white -alpha re
1219
docker run -v $(pwd)/articles:/articles --entrypoint=sh dpokidov/imagemagick:7.1.0-47-buster -c "${FIND_COMMAND} | xargs ${IMAGEMAGICK_COMMAND}"
1320
eval "${FIND_COMMAND}" | xargs rm -fr # PNGファイルを一時的に削除
1421

15-
docker run -t --rm -v $(pwd):/book -v $(pwd)/articles/fonts/bizud:/usr/share/fonts/truetype/bizud vvakame/review:5.1 /bin/bash -ci "cd /book && ./setup.sh && REVIEW_CONFIG_FILE=$REVIEW_CONFIG_FILE npm run pdf"
22+
docker run -t --rm -v $(pwd):/book -v $(pwd)/articles/fonts/bizud:/usr/share/fonts/truetype/bizud "$DOCKER_IMAGE" /bin/bash -ci "cd /book && npm install --ignore-scripts && bundle install && gem pristine --all && REVIEW_CONFIG_FILE=$REVIEW_CONFIG_FILE npm run pdf"
1623

1724
# restore images
1825
git restore "$REVIEW_IMAGE_DIR"

build-in-docker.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
[ ! -z $REVIEW_CONFIG_FILE ] || REVIEW_CONFIG_FILE="config-$REVIEW_LANG.yml"
44

55
# コマンド手打ちで作業したい時は以下の通り /book に pwd がマウントされます
6-
# docker run -i -t -v $(pwd):/book vvakame/review:5.1 /bin/bash
6+
# docker run -i -t -v $(pwd):/book review-custom:5.11 /bin/bash
77

8-
docker run -t --rm -v $(pwd):/book -v $(pwd)/articles/fonts/bizud:/usr/share/fonts/truetype/bizud vvakame/review:5.1 /bin/bash -ci "cd /book && ./setup.sh && REVIEW_CONFIG_FILE=$REVIEW_CONFIG_FILE npm run pdf"
8+
DOCKER_IMAGE="review-custom:5.11"
9+
10+
# イメージが存在しない場合はビルドする
11+
if ! docker image inspect "$DOCKER_IMAGE" > /dev/null 2>&1; then
12+
docker build -t "$DOCKER_IMAGE" .
13+
fi
14+
15+
docker run -t --rm -v $(pwd):/book -v $(pwd)/articles/fonts/bizud:/usr/share/fonts/truetype/bizud "$DOCKER_IMAGE" /bin/bash -ci "cd /book && npm install --ignore-scripts && bundle install && gem pristine --all && REVIEW_CONFIG_FILE=$REVIEW_CONFIG_FILE npm run pdf"

package-lock.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)