Created
March 4, 2019 10:09
-
-
Save danspndl/11cf1262d32d3279cb6c103916f505f7 to your computer and use it in GitHub Desktop.
Generate PDF from Markdown files before commit
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/sh | |
if [ ! -d "_exports/" ]; then | |
mkdir "_exports/" | |
echo "Created _exports folder" | |
fi | |
echo "Converting..." | |
FOLDER=./*.md | |
for f in $FOLDER | |
do | |
FILENAME=$(basename "$f" .md) | |
echo "Processing $FILENAME file..." | |
pandoc "$f" -o "./_exports/${FILENAME}.pdf" | |
done | |
git add _exports/ | |
echo "Finished." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment