Created
April 12, 2013 04:41
-
-
Save JonathanMH/5369411 to your computer and use it in GitHub Desktop.
Build your pdf report from markdown
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# dependencies: | |
# | |
# http://johnmacfarlane.net/pandoc/installing.html | |
# variables: | |
mainfont="Helvetica" | |
sansfont="Helvetica" | |
monofont="Courier" | |
fontsize="12pt" | |
version=`git rev-parse HEAD` # getting current commit hash as version number :D | |
# build the three reports: | |
cd ../modules/ | |
for input in $(find *.md -type f -maxdepth 1 \( ! -iname ".*" \)) | |
do | |
basename=`basename $input .md` | |
echo 'building:' $basename | |
pandoc -N --template=../tools/mytemplate.tex --variable mainfont=$mainfont --variable sansfont=$sansfont --variable monofont=$monofont --variable fontsize=$fontsize --variable version=$version $input --latex-engine=xelatex --toc -o ../export/$basename.pdf | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is assuming that you have a folder
modules
for your reports andexport
for the pdfs. For more info on this visit the pandoc documentation: http://johnmacfarlane.net/pandoc/installing.html