Skip to content

Instantly share code, notes, and snippets.

@gaveen
Created February 10, 2013 14:02
Show Gist options
  • Save gaveen/4749668 to your computer and use it in GitHub Desktop.
Save gaveen/4749668 to your computer and use it in GitHub Desktop.
Simple script to work with Pandoc. Uses all files inside the current directory with names ending with the file extension $INEXT (assuming they are of the file format $INFMT) to generate files of format $OUTFMT with respective file names and the extension $OUTEXT, styled with the stylesheet $CSSFILE.
#!/usr/bin/env bash
INFMT="markdown"
INEXT="md"
OUTFMT="html"
OUTEXT="html"
CSSFILE="./pandoc.css"
for INFILE in $(ls *.$INEXT)
do
pandoc ./$INFILE -r $INFMT -w $OUTFMT -c $CSSFILE -o ./${INFILE%.*}.$OUTEXT
echo "Using file: $INFILE to generate file: ${INFILE%.*}.$OUTEXT"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment