Skip to content

Instantly share code, notes, and snippets.

@mmm
Last active July 19, 2019 20:14
Show Gist options
  • Save mmm/a0eee56156a99aaa941b2f56e8968a21 to your computer and use it in GitHub Desktop.
Save mmm/a0eee56156a99aaa941b2f56e8968a21 to your computer and use it in GitHub Desktop.
slides = $(wildcard *-*.md)
default: $(slides:.md=.docx)
pdfs: $(slides:.md=.pdf)
#run_pandoc := docker run --rm -t \
#-v `pwd`:/source \
#-v `python -c 'import os, sys; print(os.path.realpath("images"))'`:/source/images \
#-v `python -c 'import os, sys; print(os.path.realpath("reveal.js"))'`:/source/reveal.js \
#midsw205/pandoc:2.0.7
#run_decktape := docker run --rm -t \
#-v `pwd`:/slides \
#-v `python -c 'import os, sys; print(os.path.realpath("images"))'`:/slides/images \
#-v `python -c 'import os, sys; print(os.path.realpath("reveal.js"))'`:/slides/reveal.js \
#astefanutti/decktape:2.8.3
run_pandoc := docker run --rm -t \
-v `pwd`:/source \
midsw205/pandoc:2.0.7
run_push := drive push -quiet
%.docx : %.md
@echo "---" $@ "---"
$(run_pandoc) $< -o $@ -s
%.html : %.md
@echo "---" $@ "---"
#$(run_pandoc) $< -o $@ -s -t revealjs --template=/templates/mids-revealjs-template.html --section-divs --mathjax -V theme=mids -V transition=linear
$(run_pandoc) $< -o $@ -s --section-divs --mathjax
%.svg : %.dot
@echo "---" $@ "---"
dot -T svg $< -o $@
%.pdf : %.html
@echo "---" $@ "---"
$(run_decktape) -s '1920x1080' $< $@
publish: instructor-notes.docx
@echo "---" $@ "---"
@cp $< gdrive/
$(run_push) gdrive/$<
clean:
rm -f *.docx
rm -f *.html
rm -f *.pdf
clobber: clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment