Chill-manuals/build-pandoc.sh
Julien Fastré 65040b39dc add drone CI to project
Squashed commit of the following:

commit 314aa4b989
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Mon Jul 26 21:29:34 2021 +0200

    restrict ci on tags

commit c39b0d98d9
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Mon Jul 26 17:59:27 2021 +0200

    add explanation to README about dependencies [ci-skip]

commit b935e1ba68
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Mon Jul 26 17:55:50 2021 +0200

    clone submodules

commit 8dbc9aa196
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Mon Jul 26 17:52:23 2021 +0200

    fix drone ci

commit 61fb8a8f66
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Mon Jul 26 15:34:35 2021 +0200

    first impl for drone
2021-07-26 21:33:39 +02:00

52 lines
939 B
Bash
Executable File

#!/bin/sh
# enter the current directory
cd "$(dirname $0)"
export PANDOC_DIR=pandoc/cl
export files="
src/parcours.md
"
if [ -z $1 ]; then
export target=pdf
else
export target=$1
fi
export ARGS="
--from markdown
--metadata-file ./metadata.yaml
--lua-filter "${PANDOC_DIR}/format-link.lua"
"
export PDF_TEMPLATE="./pandoc/template/eisvogel.tex"
export LATEX_ARGS="
--template "${PDF_TEMPLATE}"
--lua-filter "${PANDOC_DIR}/boxes.lua"
"
if [ $target == "latex" ]; then
pandoc $ARGS $LATEX_ARGS \
--to latex \
$files;
elif [ $target == "pdf" ]; then
pandoc $ARGS $LATEX_ARGS \
--to pdf \
--pdf-engine xelatex \
-o ./user-manual.pdf \
$files
elif [ $target == "html" ]; then
# check target directory exists
if [ ! -d "./build/html" ]; then
echo "create build/html directory"
mkdir -p "./build/html"
fi
pandoc $ARGS \
--to html \
-o ./build/html/index.html \
$files
fi