Add support for additional args too pandoc
This commit is contained in:
parent
5acd0c9c33
commit
16d466739f
1 changed files with 6 additions and 4 deletions
10
build.sh
10
build.sh
|
@ -3,6 +3,8 @@
|
||||||
SCRIPT=`realpath $0`
|
SCRIPT=`realpath $0`
|
||||||
SCRIPTPATH=`dirname $SCRIPT`
|
SCRIPTPATH=`dirname $SCRIPT`
|
||||||
|
|
||||||
|
ADDITIONAL_ARGS=${@:2}
|
||||||
|
|
||||||
INPUT_FILE=`realpath $1`
|
INPUT_FILE=`realpath $1`
|
||||||
INPUT_DIR=`dirname $INPUT_FILE`
|
INPUT_DIR=`dirname $INPUT_FILE`
|
||||||
METADATA_FILE="$INPUT_DIR/metadata.yaml"
|
METADATA_FILE="$INPUT_DIR/metadata.yaml"
|
||||||
|
@ -15,10 +17,10 @@ then
|
||||||
INPUT_FILES="$INPUT_FILES $METADATA_FILE"
|
INPUT_FILES="$INPUT_FILES $METADATA_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PANDOC_ARGS="$INPUT_FILES --template $SCRIPTPATH/main.tex -o $OUTPUT_FILE"
|
PANDOC_ARGS="$INPUT_FILES --template $SCRIPTPATH/main.tex -o $OUTPUT_FILE $ADDITIONAL_ARGS"
|
||||||
|
|
||||||
echo "Building document..."
|
echo "> Building document..."
|
||||||
pandoc $PANDOC_ARGS
|
pandoc $PANDOC_ARGS
|
||||||
|
|
||||||
echo "Running second pass..."
|
echo "> Running second pass..."
|
||||||
pandoc $PANDOC_ARGS --lua-filter=second-pass.lua
|
pandoc --lua-filter=second-pass.lua $PANDOC_ARGS
|
||||||
|
|
Reference in a new issue