###  INPUT & OUTPUT  ##########################################################

MD       := $(wildcard *.md)
HTML     := $(patsubst %.md, %.html, $(MD))

###  TEMPLATE CONFIG  #########################################################

TDIR     := ./template
TEMPLATE := $(TDIR)/template.html


###  EXPLICIT RULES  ##########################################################

.PHONY: html

html: $(HTML)

htmlold: $(HTMOLD)

$(HTML): $(SRC) $(TEMPLATE)

clean:
	rm -f $(HTML)

###  IMPLICIT RULES  ##########################################################

# new syntax with filters
%.html: %.md
	cat $< | \
	pandoc \
	--from markdown+link_attributes+smart+line_blocks+emoji \
	--to revealjs \
	--section-divs \
	--no-highlight \
	--mathjax \
	--template $(TEMPLATE) \
	--variable template=$(TDIR) \
	--variable chalkboard=${<:.md=.json} \
	--filter styling \
	--filter cols \
	--filter media \
	--filter clean \
	-o $@