diff --git a/Makefile b/Makefile index be7d8fd..f0d4022 100644 --- a/Makefile +++ b/Makefile @@ -1,36 +1,16 @@ -CONTENTDIR = content -STATICDIR = static -BUILDDIR = build +build: + # Build Python package + test -d build/ && rm -rf build/ || true + test -d dist/ && rm -rf dist/ || true + test -d *.egg-info/ && rm -rf *.egg-info/ || true +# python setup.py sdist bdist_wheel + python -m build -all: html +install: + # Install package from built tarball + pip install dist/*.tar.gz -help: - @echo 'Build site' - @echo - @echo 'Available targets:' - @echo - @echo ' html render HTML' - @echo ' serve serve site' - @echo ' css generate Pygments stylesheet' - @echo - @echo 'Run without target to build html' - -html: - test -d $(BUILDDIR) && rm -rf $(BUILDDIR) || true - python rstw - -serve: - if hash http-server; \ - then \ - http-server $(BUILDDIR)/; \ - else \ - python3 -m http.server --directory $(BUILDDIR)/; \ - fi - -css: - mkdir -pv $(STATICDIR)/css/pygments - pygmentize -f html -S $(filter-out $@,$(MAKECMDGOALS)) -a .highlight \ - > $(STATICDIR)/css/pygments/$(filter-out $@,$(MAKECMDGOALS)).css - -%: - @: +dist: + # Copy package to site downloads dir + mkdir -p docs/static/downloads + cp dist/*.tar.gz docs/static/downloads/