Co-authored-by: Julien Fastré <julien.fastre@champs-libres.coop> Reviewed-on: Vendee/manuals#12
This commit is contained in:
@@ -4,7 +4,7 @@ set -e
|
||||
|
||||
# enter the current directory
|
||||
cd "$(dirname $0)"
|
||||
export PANDOC_DIR=pandoc/cl
|
||||
export PANDOC_DIR="/pandoc/cl"
|
||||
|
||||
|
||||
if [ -z $1 ]; then
|
||||
@@ -21,44 +21,46 @@ fi
|
||||
|
||||
if [ $kind = 'user' ]; then
|
||||
export files="
|
||||
$kind/intro.md
|
||||
$kind/concept.md
|
||||
$kind/interface.md
|
||||
$kind/search.md
|
||||
$kind/person.md
|
||||
$kind/person-vendee.md
|
||||
$kind/activite.md
|
||||
$kind/document.md
|
||||
$kind/thirdparty.md
|
||||
$kind/menage.md
|
||||
$kind/parcours.md
|
||||
$kind/social_actions.md
|
||||
$kind/notifications.md
|
||||
$kind/tasks.md
|
||||
$kind/workflows.md
|
||||
$kind/choisir_une_adresse.md
|
||||
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
|
||||
choisir_une_adresse.md
|
||||
"
|
||||
elif [ $kind = 'admin' ]; then
|
||||
export files="
|
||||
$kind/generation-documents.md
|
||||
generation-documents.md
|
||||
"
|
||||
else
|
||||
echo "kind '$kind' is not valid";
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
cd $kind
|
||||
|
||||
export ARGS="
|
||||
--from markdown
|
||||
--number-sections
|
||||
--resource-path ./$kind
|
||||
--metadata-file ./$kind/metadata.yaml
|
||||
`#--lua-filter "${PANDOC_DIR}/format-link.lua`
|
||||
--resource-path ./.
|
||||
--metadata-file ./metadata.yaml
|
||||
`#--lua-filter "../${PANDOC_DIR}/format-link.lua`
|
||||
"
|
||||
export PDF_TEMPLATE="./pandoc/template/eisvogel.tex"
|
||||
export PDF_TEMPLATE="./../pandoc/template/eisvogel.tex"
|
||||
export LATEX_ARGS="
|
||||
--metadata=footer-left:$(date +%d-%m-%Y)
|
||||
--template "${PDF_TEMPLATE}"
|
||||
--lua-filter "${PANDOC_DIR}/boxes.lua"
|
||||
--lua-filter "../${PANDOC_DIR}/boxes.lua"
|
||||
"
|
||||
|
||||
|
||||
@@ -70,18 +72,18 @@ elif [ $target = "pdf" ]; then
|
||||
pandoc $ARGS $LATEX_ARGS \
|
||||
--to pdf \
|
||||
--pdf-engine xelatex \
|
||||
-o "./$kind-manual.pdf" \
|
||||
-o "./../$kind-manual.pdf" \
|
||||
$files
|
||||
elif [ $target = "html" ]; then
|
||||
# check target directory exists
|
||||
if [ ! -d "./build/html" ]; then
|
||||
if [ ! -d "./../build/html" ]; then
|
||||
echo "create build/html directory"
|
||||
mkdir -p "./build/html"
|
||||
mkdir -p "./../build/html"
|
||||
fi
|
||||
|
||||
pandoc $ARGS \
|
||||
--to html \
|
||||
-o ./build/html/index.html \
|
||||
-o ./../build/html/index.html \
|
||||
$files
|
||||
fi
|
||||
|
||||
|
Reference in New Issue
Block a user