Skip to content

Instantly share code, notes, and snippets.

@kastaneda
Last active December 15, 2015 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kastaneda/5247836 to your computer and use it in GitHub Desktop.
Save kastaneda/5247836 to your computer and use it in GitHub Desktop.
Holy Grail
# sudo apt-get install pandoc
MARKDOWN = pandoc --from markdown --to html5 --css style.css --standalone
# sudo apt-get install node-less
LESS = lessc --compress
SOURCE_PAGES = $(shell find . -type f -name '*.md')
TARGET_PAGES = $(patsubst %.md,%.html,$(SOURCE_PAGES))
all: $(TARGET_PAGES) style.css
%.html: %.md Makefile
$(MARKDOWN) $< --output $@
style.css: style.less Makefile
$(LESS) $< > $@
clean:
rm -f $(TARGET_PAGES) style.css
.PHONY: all clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment