all: sync

sync: main.html
	rsync -avzPh \
		.python-version \
		data \
		main.html \
		main.executed.ipynb \
		main.ipynb \
		main.py \
		Makefile \
		pyproject.toml \
		README.md \
		uv.lock \
		pan:public_html/stats_accidents/

main.html: main.executed.ipynb
	jupyter nbconvert --to html --output $@ $< 

main.executed.ipynb: main.ipynb
	jupyter nbconvert --execute --to notebook --output $@ $< 

main.ipynb: main.py
	yes | marimo export ipynb $< -o $@

clean:
	rm -f main.ipynb main.executed.ipynb main.html

.PHONY: all sync clean