svgs = $(shell grep "image::" *.adoc | sed 's/.*image::\(.*\.svg\).*/\1/')
adocs = $(shell ls -1 *.adoc)
htmls = $(adocs:%.adoc=%.html)

default: $(htmls) $(svgs)

%.svg: %.digraph
	dot -O -Tsvg $<
	mv $<.svg $@

%.html: %.adoc Makefile $(svgs)
	asciidoc --backend slidy -v $<

.PHONY: poll clean publish
poll:
	while true; do  make; sleep 1; done

clean:
	-rm -f $(svgs) *.html

publish: default
	cd ..; rsync -avLP --inplace --exclude .git --del 2018 po:public_html/
