2021-07-26 21:33:39 +02:00
|
|
|
#!/bin/sh
|
2021-07-26 15:11:23 +02:00
|
|
|
|
2021-08-25 17:46:54 +02:00
|
|
|
set -e
|
|
|
|
|
2021-07-26 15:11:23 +02:00
|
|
|
# enter the current directory
|
|
|
|
cd "$(dirname $0)"
|
2022-05-16 13:12:55 +00:00
|
|
|
export PANDOC_DIR="/pandoc/cl"
|
2021-07-26 15:11:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
if [ -z $1 ]; then
|
|
|
|
export target=pdf
|
|
|
|
else
|
|
|
|
export target=$1
|
|
|
|
fi
|
|
|
|
|
2021-08-25 17:46:54 +02:00
|
|
|
if [ -z $2 ]; then
|
|
|
|
export kind=user
|
|
|
|
else
|
|
|
|
export kind=$2
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $kind = 'user' ]; then
|
|
|
|
export files="
|
2022-05-16 13:12:55 +00:00
|
|
|
intro.md
|
|
|
|
concept.md
|
|
|
|
interface.md
|
|
|
|
search.md
|
|
|
|
person.md
|
|
|
|
person-vendee.md
|
|
|
|
activite.md
|
|
|
|
document.md
|
|
|
|
thirdparty.md
|
|
|
|
menage.md
|
|
|
|
parcours.md
|
|
|
|
social_actions.md
|
|
|
|
notifications.md
|
|
|
|
tasks.md
|
|
|
|
workflows.md
|
2023-04-27 23:00:39 +02:00
|
|
|
adresses.md
|
2023-06-27 13:03:38 +02:00
|
|
|
exports.md
|
2023-10-23 23:05:22 +02:00
|
|
|
exports_person.md
|
|
|
|
exports_activity.md
|
|
|
|
exports_accompanying_period.md
|
2023-04-28 10:13:34 +02:00
|
|
|
nouveautes.md
|
2021-08-25 17:46:54 +02:00
|
|
|
"
|
2023-10-24 13:13:24 +02:00
|
|
|
# missing pages to once completed
|
|
|
|
# exports_accompanying_period_work.md
|
|
|
|
# exports_accompanying_period_work_evaluation.md
|
|
|
|
# exports_aside_activity.md
|
|
|
|
# exports_calendar.md
|
|
|
|
# exports_household.md
|
2021-08-25 17:46:54 +02:00
|
|
|
elif [ $kind = 'admin' ]; then
|
|
|
|
export files="
|
2022-07-12 00:34:52 +02:00
|
|
|
start.md
|
2022-05-16 13:12:55 +00:00
|
|
|
generation-documents.md
|
2021-08-25 17:46:54 +02:00
|
|
|
"
|
2022-03-11 14:44:33 +01:00
|
|
|
else
|
2021-08-25 17:46:54 +02:00
|
|
|
echo "kind '$kind' is not valid";
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
2022-05-16 13:12:55 +00:00
|
|
|
cd $kind
|
|
|
|
|
2021-07-26 15:11:23 +02:00
|
|
|
export ARGS="
|
|
|
|
--from markdown
|
2022-03-25 18:23:46 +01:00
|
|
|
--number-sections
|
2022-05-16 13:12:55 +00:00
|
|
|
--resource-path ./.
|
|
|
|
--metadata-file ./metadata.yaml
|
|
|
|
`#--lua-filter "../${PANDOC_DIR}/format-link.lua`
|
2021-07-26 15:11:23 +02:00
|
|
|
"
|
2022-05-16 13:12:55 +00:00
|
|
|
export PDF_TEMPLATE="./../pandoc/template/eisvogel.tex"
|
2021-07-26 15:11:23 +02:00
|
|
|
export LATEX_ARGS="
|
2022-05-16 12:19:46 +02:00
|
|
|
--metadata=footer-left:$(date +%d-%m-%Y)
|
2021-07-26 15:11:23 +02:00
|
|
|
--template "${PDF_TEMPLATE}"
|
2022-05-16 13:12:55 +00:00
|
|
|
--lua-filter "../${PANDOC_DIR}/boxes.lua"
|
2021-07-26 15:11:23 +02:00
|
|
|
"
|
|
|
|
|
|
|
|
|
2021-08-25 17:46:54 +02:00
|
|
|
if [ $target = "latex" ]; then
|
2021-07-26 15:11:23 +02:00
|
|
|
pandoc $ARGS $LATEX_ARGS \
|
|
|
|
--to latex \
|
|
|
|
$files;
|
2021-08-25 17:46:54 +02:00
|
|
|
elif [ $target = "pdf" ]; then
|
2021-07-26 15:11:23 +02:00
|
|
|
pandoc $ARGS $LATEX_ARGS \
|
|
|
|
--to pdf \
|
|
|
|
--pdf-engine xelatex \
|
2022-05-16 13:12:55 +00:00
|
|
|
-o "./../$kind-manual.pdf" \
|
2021-07-26 15:11:23 +02:00
|
|
|
$files
|
2021-08-25 17:46:54 +02:00
|
|
|
elif [ $target = "html" ]; then
|
2021-07-26 15:11:23 +02:00
|
|
|
# check target directory exists
|
2022-05-16 13:12:55 +00:00
|
|
|
if [ ! -d "./../build/html" ]; then
|
2021-07-26 15:11:23 +02:00
|
|
|
echo "create build/html directory"
|
2022-05-16 13:12:55 +00:00
|
|
|
mkdir -p "./../build/html"
|
2021-07-26 15:11:23 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
pandoc $ARGS \
|
|
|
|
--to html \
|
2022-05-16 13:12:55 +00:00
|
|
|
-o ./../build/html/index.html \
|
2021-07-26 15:11:23 +02:00
|
|
|
$files
|
|
|
|
fi
|
|
|
|
|