Skip to content

Instantly share code, notes, and snippets.

@chrishwiggins
Created January 18, 2017 14:21
Show Gist options
  • Save chrishwiggins/fcea966ba3b56ea4fdfbbc19033f15db to your computer and use it in GitHub Desktop.
Save chrishwiggins/fcea966ba3b56ea4fdfbbc19033f15db to your computer and use it in GitHub Desktop.
# TTD: bdraft different from draft
# TTD: open should kill preview
# high level
#
# CONFIG/
project = writeup
# /CONFIG
# DERIVED PARAMETERS/
ifile = ${project}-raw.md
pdf = ${project}.pdf
all:
make ${project}.pdf
${ifile}:
make edit
${project}.pdf: ${project}-out.md makefile
# time pandoc --slide-level 2 -i -t beamer ${ifile} -o ${project}.pdf
# time pandoc --slide-level 2 -i -t beamer ${project}-out.md -o ${project}.pdf
# time pandoc --number-sections ${project}-out.md -o ${project}.pdf
# time pandoc --number-sections ${project}-out.md -o ${project}.pdf
time pandoc --table-of-contents --number-sections ${project}-out.md -o ${project}.pdf
draft: ${project}-out.md
time pandoc ${project}-out.md -o ${project}.pdf
${project}-out.md: ${ifile} ${project}.sed
rm -f ${project}-out.md
touch ${project}-out.md
chmod 777 ${project}-out.md
grep -v '%%%' ${ifile} | sed -f ${project}.sed > ${project}-out.md
# prevent editing
chmod a-w ${project}-out.md
edit:
vi ${ifile}
cp ${ifile} backups/${project}-new-`date +%Y-%m-%dT%H:%M:%S`.md
open: ${project}.pdf
# killall Preview
open ${project}.pdf
spell:
aspell -c ${ifile}
${project}.sed:
touch ${project}.sed
sed:
vi ${project}.sed
# /DERIVED PARAMETERS
clean:
rm *.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment