add admin manual in same repo

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

View File

@ -16,8 +16,8 @@ steps:
- name: pandoc - name: pandoc
image: pandoc/alpine:2.14 image: pandoc/alpine:2.14
commands: commands:
- ls - sh build-pandoc.sh latex user > user-manual.tex
- sh build-pandoc.sh latex > user-manual.tex - sh build-pandoc.sh latex admin > user-manual.tex
when: when:
event: tag event: tag
@ -25,6 +25,7 @@ steps:
image: ghcr.io/xu-cheng/texlive-full:latest image: ghcr.io/xu-cheng/texlive-full:latest
commands: commands:
- latexmk -pdf -file-line-error -halt-on-error -interaction=nonstopmode -xelatex user-manual.tex - latexmk -pdf -file-line-error -halt-on-error -interaction=nonstopmode -xelatex user-manual.tex
- latexmk -pdf -file-line-error -halt-on-error -interaction=nonstopmode -xelatex latex-manual.tex
when: when:
event: tag event: tag
@ -36,6 +37,7 @@ steps:
base_url: https://gitea.champs-libres.be base_url: https://gitea.champs-libres.be
files: files:
- user-manual.pdf - user-manual.pdf
- admin-manual.pdf
checksum: checksum:
- sha512 - sha512
title: ${DRONE_COMMIT_REF} title: ${DRONE_COMMIT_REF}

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
build/* build/*
user-manual.* *-manual.pdf

View File

@ -0,0 +1,4 @@
# test
oui

10
admin/metadata.yaml Normal file
View File

@ -0,0 +1,10 @@
---
title: Manuel administrateur de Chill
subtitle: Chill en Vendée
lang: fr-BE
toc: true
header-includes: |
\usepackage{awesomebox}
...

View File

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