-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (43 loc) · 1.28 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
DEMO_REPO?=sio/LibPQ
DEMO_STORAGE?=$(WORKDIR)/demo-github-data
export DEMO_REPO
export DEMO_STORAGE
DEMO_INPUT=$(WORKDIR)/demo-input
DEMO_OUTPUT?=$(WORKDIR)/demo-output
CONFIG=pelican_demo.py
PORT=8000
EXTRAS=
DOCS_OUTPUT?=$(WORKDIR)/public
export DOCS_OUTPUT
.PHONY: demo
demo: venv $(DEMO_STORAGE)/.ready
[ -d "$(DEMO_INPUT)" ] || mkdir -p "$(DEMO_INPUT)"
$(VENV)/pip install --upgrade -r requirements.txt # update theme
$(VENV)/pelican $(DEMO_INPUT) -o $(DEMO_OUTPUT) -s $(CONFIG) $(EXTRAS)
$(DEMO_STORAGE)/.ready: $(CONFIG)
$(VENV)/issyours-github $(DEMO_REPO) $(DEMO_STORAGE)
touch $(DEMO_STORAGE)/.ready
.PHONY: serve
serve: venv
cd $(DEMO_OUTPUT) && $(VENV)/python -m http.server $(PORT)
.PHONY: clean-demo
clean-demo:
[ ! -d $(DEMO_OUTPUT) ] || rm -rf $(DEMO_OUTPUT)
[ ! -d $(DEMO_STORAGE) ] || rm -rf $(DEMO_STORAGE)
.PHONY: docs
docs: venv
$(VENV)/pip install mkdocs mkdocs-material pygments
sed -e 's/\bdocs\///g' README.md > docs/index.md
$(VENV)/mkdocs build
.PHONY: serve-docs
serve-docs: venv
cd $(DOCS_OUTPUT) && $(VENV)/python -m http.server $(PORT)
.PHONY: clean-docs
clean-docs:
[ ! -d $(DOCS_OUTPUT) ] || rm -rf $(DOCS_OUTPUT)
.PHONY: test
test: venv
$(VENV)/python -m unittest
.PHONY: clean
clean: clean-demo clean-docs clean-venv
include Makefile.venv