Makefile for management
This commit is contained in:
parent
c623de03d2
commit
e73b957161
48
Makefile
48
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 <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
|
||||
|
||||
%:
|
||||
@:
|
||||
dist:
|
||||
# Copy package to site downloads dir
|
||||
mkdir -p docs/static/downloads
|
||||
cp dist/*.tar.gz docs/static/downloads/
|
||||
|
Loading…
Reference in New Issue
Block a user