Makefile for management
This commit is contained in:
parent
c623de03d2
commit
e73b957161
48
Makefile
48
Makefile
@ -1,36 +1,16 @@
|
|||||||
CONTENTDIR = content
|
build:
|
||||||
STATICDIR = static
|
# Build Python package
|
||||||
BUILDDIR = build
|
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:
|
dist:
|
||||||
@echo 'Build site'
|
# Copy package to site downloads dir
|
||||||
@echo
|
mkdir -p docs/static/downloads
|
||||||
@echo 'Available targets:'
|
cp dist/*.tar.gz docs/static/downloads/
|
||||||
@echo
|
|
||||||
@echo ' html render HTML'
|
|
||||||
@echo ' serve serve site'
|
|
||||||
@echo ' css <theme> 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
|
|
||||||
|
|
||||||
%:
|
|
||||||
@:
|
|
||||||
|
Loading…
Reference in New Issue
Block a user