Add support for metadata file
This commit is contained in:
parent
c6137f167a
commit
5acd0c9c33
2 changed files with 13 additions and 1 deletions
11
build.sh
11
build.sh
|
@ -4,9 +4,18 @@ SCRIPT=`realpath $0`
|
|||
SCRIPTPATH=`dirname $SCRIPT`
|
||||
|
||||
INPUT_FILE=`realpath $1`
|
||||
INPUT_DIR=`dirname $INPUT_FILE`
|
||||
METADATA_FILE="$INPUT_DIR/metadata.yaml"
|
||||
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..."
|
||||
pandoc $PANDOC_ARGS
|
||||
|
|
3
test/metadata.yaml
Normal file
3
test/metadata.yaml
Normal file
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
foo: bar
|
||||
...
|
Reference in a new issue