ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
baseName=2024-radio-$(shell basename $(ROOT_DIR))
htmlOut=$(baseName).html
pdfOut=$(baseName).pdf
zipOut=$(baseName).zip
inputFile=in/slides.md

all: $(htmlOut) $(pdfOut)
dist: $(zipOut)

$(htmlOut): $(inputFile)
	# --self-contained deprecated in favor of --embed-resources 
	pandoc --slide-level=2 --self-contained --standalone --ascii -t revealjs $< -o $@
$(pdfOut): $(inputFile)
	# XXX: colora link
	# XXX: schema di colori adatto a proiettore (bianco su nero)
	pandoc --slide-level=2 -t beamer --standalone $< -o $@

dev-html: in/slides.md
	find in | entr make $(htmlOut)

$(zipOut): $(htmlOut)   # $(pdfOut)
	zip -r $(zipOut) in/ $?
	zip -j $(zipOut) ../Makefile

.PHONY: all dist $(zipOut)
