Created
September 13, 2016 13:56
-
-
Save tete2soja/258826aac448a522d1a4e5199b316405 to your computer and use it in GitHub Desktop.
Makefile for 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
# Produce PDFs from all Markdown files in a directory | |
# List files to be made by finding all *.md files and appending .pdf | |
PDFS := $(patsubst %.md,%.pdf,$(wildcard *.md)) | |
# The all rule makes all the PDF files listed | |
all : $(PDFS) | |
# This generic rule accepts PDF targets with corresponding Markdown | |
# source, and makes them using pandoc | |
%.pdf : %.md | |
# Conversion to PDF file | |
pandoc -V geometry:paperwidth=21cm -V geometry:paperheight=29.4cm -V geometry:margin=.5cm --highlight-style tango -f markdown $< -o $@ | |
# Remove all PDF outputs | |
clean : | |
rm $(PDFS) | |
# Remove all PDF outputs then build them again | |
rebuild : clean all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment