Last active
July 11, 2017 10:16
-
-
Save angrykoala/86c8c1dd06db5cacc34c to your computer and use it in GitHub Desktop.
small flavored markdown converter to pdf using pandoc
This file contains 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 | |
#md2pdf: small flavored markdown converter to pdf using pandoc | |
#by @angrykoala | |
if [ $# -eq 0 ] | |
then echo "Need at least one argument md2pdf [files]"; | |
else | |
for var in "$@" | |
do | |
filename=$(basename "$var") | |
extension="${filename##*.}" | |
filename="${filename%.*}" | |
#add --toc to create a table of contents | |
pandoc $var -f markdown_github -o $filename.pdf -V geometry:margin=1in -V fontsize=12pt | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment