Skip to content

Instantly share code, notes, and snippets.

@mnme
Forked from lmullen/gist:3767386
Last active August 29, 2015 14:01
Show Gist options
  • Save mnme/492f749bcb0d10570824 to your computer and use it in GitHub Desktop.
Save mnme/492f749bcb0d10570824 to your computer and use it in GitHub Desktop.
# Produce DOCXs from all Markdown files in a directory
# Lincoln Mullen | http://lincolnmullen.com | lincoln@lincolnmullen.com
# Nicolas Jeker
# List files to be made by finding all *.md files and appending .docx
DOCS := $(patsubst %.md,%.docx,$(wildcard *.md))
# The all rule makes all the DOCX files listed
all: $(DOCS)
# This generic rule accepts DOCX targets with corresponding Markdown
# source, and makes them using pandoc
%.docx: %.md
pandoc $< -o $@
# Remove all DOCX outputs
clean:
rm -f $(DOCS)
# 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