1
Fork 0

Add support for metadata file

This commit is contained in:
Jake Howard 2018-04-02 22:44:53 +01:00
parent c6137f167a
commit 5acd0c9c33
2 changed files with 13 additions and 1 deletions

View file

@ -4,9 +4,18 @@ SCRIPT=`realpath $0`
SCRIPTPATH=`dirname $SCRIPT` SCRIPTPATH=`dirname $SCRIPT`
INPUT_FILE=`realpath $1` INPUT_FILE=`realpath $1`
INPUT_DIR=`dirname $INPUT_FILE`
METADATA_FILE="$INPUT_DIR/metadata.yaml"
OUTPUT_FILE=output.pdf OUTPUT_FILE=output.pdf
PANDOC_ARGS="$INPUT_FILE --template $SCRIPTPATH/main.tex -o $OUTPUT_FILE" INPUT_FILES="$INPUT_FILE"
if [ -f "$METADATA_FILE" ]
then
INPUT_FILES="$INPUT_FILES $METADATA_FILE"
fi
PANDOC_ARGS="$INPUT_FILES --template $SCRIPTPATH/main.tex -o $OUTPUT_FILE"
echo "Building document..." echo "Building document..."
pandoc $PANDOC_ARGS pandoc $PANDOC_ARGS

3
test/metadata.yaml Normal file
View file

@ -0,0 +1,3 @@
---
foo: bar
...