Skip to content

Commit

Permalink
Conditionally build PDF manual (#435)
Browse files Browse the repository at this point in the history
  • Loading branch information
nichtich committed Nov 11, 2019
1 parent 4a35bee commit e6fd146
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
19 changes: 12 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ cache:
- "$HOME/.npm"
- "$HOME/.local"

before_install: >- # install Pandoc into ~/.local for document generation
mkdir -p "$HOME/.local/bin";
if [[ ! -f "$HOME/.local/bin/pandoc" ]]; then
curl -L https://github.com/jgm/pandoc/releases/download/2.7.3/pandoc-2.7.3-1-amd64.deb > pandoc.deb &&
dpkg -x pandoc.deb pandoc && cp pandoc/usr/bin/* $HOME/.local/bin
fi;
export PATH="$HOME/.local/bin:$PATH"
before_install:
- >- # install Pandoc into ~/.local for document generation
mkdir -p "$HOME/.local/bin";
if [[ ! -f "$HOME/.local/bin/pandoc" ]]; then
curl -L https://github.com/jgm/pandoc/releases/download/2.7.3/pandoc-2.7.3-1-amd64.deb > pandoc.deb &&
dpkg -x pandoc.deb pandoc && cp pandoc/usr/bin/* $HOME/.local/bin
fi;
export PATH="$HOME/.local/bin:$PATH"
- >- # install LaTeX only if last commit modified something in docs/
if [[ $(git show --pretty="" --name-only HEAD docs/) ]]; then
sudo apt-get install texlive-xetex texlive-fonts-recommended texlive-fonts-extra lmodern librsvg2-bin
fi
install:
- npm i -g npm@5.10.0
Expand Down
10 changes: 7 additions & 3 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,14 @@ else
fi
# create and move user manual
echo "Creating user manual..."
npm run user-manual
cp docs/*/user-manual-*.html dist/
echo "Creating user manual (HTML)..."
npm run manual
echo
if [ $(git show --pretty="" --name-only HEAD docs/) ]; then
echo "Creating user manual (PDF)..."
npm run manual-pdf
fi
cp docs/*/user-manual-*.{html,pdf} dist/
# # delete config file if it was generated during this script
[ ! $USERCONFIG ] && echo "Removing config generated during build..." && rm ./config/cocoda.json
Expand Down
4 changes: 4 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ all: $(BUILD_INFO)
make -C en
make -C de

pdfs: $(BUILD_INFO)
make -C en pdf
make -C de pdf

$(BUILD_INFO):
npm run build-info

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"styleguide": "vue-styleguidist server",
"styleguide:build": "vue-styleguidist build",
"build-info": "./build/build-info.sh > ./build/build-info.json",
"user-manual": "make -BC docs",
"manual": "make -BC docs",
"manual-pdf": "make -BC docs pdfs",
"release": "./bin/release.sh",
"kos-types": "wget http://api.dante.gbv.de/voc/top?uri=http://w3id.org/nkos/nkostype -O config/kos-types.json"
},
Expand Down

0 comments on commit e6fd146

Please sign in to comment.