add admin manual in same repo

This commit is contained in:
2021-08-25 17:46:54 +02:00
parent 36d9aef3a5
commit e389c8736b
7 changed files with 45 additions and 11 deletions

View File

@@ -1,12 +1,11 @@
#!/bin/sh
set -e
# enter the current directory
cd "$(dirname $0)"
export PANDOC_DIR=pandoc/cl
export files="
src/parcours.md
"
if [ -z $1 ]; then
export target=pdf
@@ -14,9 +13,28 @@ else
export target=$1
fi
if [ -z $2 ]; then
export kind=user
else
export kind=$2
fi
if [ $kind = 'user' ]; then
export files="
$kind/parcours.md
"
elif [ $kind = 'admin' ]; then
export files="
$kind/generation-documents.md
"
else
echo "kind '$kind' is not valid";
exit 1;
fi
export ARGS="
--from markdown
--metadata-file ./metadata.yaml
--metadata-file ./$kind/metadata.yaml
--lua-filter "${PANDOC_DIR}/format-link.lua"
"
export PDF_TEMPLATE="./pandoc/template/eisvogel.tex"
@@ -26,17 +44,17 @@ export LATEX_ARGS="
"
if [ $target == "latex" ]; then
if [ $target = "latex" ]; then
pandoc $ARGS $LATEX_ARGS \
--to latex \
$files;
elif [ $target == "pdf" ]; then
elif [ $target = "pdf" ]; then
pandoc $ARGS $LATEX_ARGS \
--to pdf \
--pdf-engine xelatex \
-o ./user-manual.pdf \
-o "./$kind-manual.pdf" \
$files
elif [ $target == "html" ]; then
elif [ $target = "html" ]; then
# check target directory exists
if [ ! -d "./build/html" ]; then
echo "create build/html directory"