-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (45 loc) · 1.33 KB
/
Makefile
File metadata and controls
56 lines (45 loc) · 1.33 KB
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
sources = \
$(wildcard docs/source/* docs/source/*/*) \
requirements.txt \
Makefile
.PHONY: all
all: .venv
.PHONY: build
build: $(sources) | \
docs/build/html \
.venv/bin/sphinx-build
.venv/bin/sphinx-build docs/source docs/build/html
cp -af \
docs/source/js/override_default_light.js \
docs/build/html/_static/dark_mode_js/default_light.js
cp -af \
docs/source/js/override_theme_switcher.js \
docs/build/html/_static/dark_mode_js/theme_switcher.js
local: build
sed -i \
's|api.vaultvision.com|api.vv.test|g' \
$$(find docs/build/html -type f -name '*.html')
# Note you must escape '&' in the matomo tpl as it has special meaning in sed
release: build
sed -i \
's|<body class="wy-body-for-nav">|<body class="wy-body-for-nav matomo">\n$(shell cat matomo.tpl)|g' \
$$(find docs/build/html -type f -name '*.html')
find . -type f -name *.pickle
rm ./docs/build/html/.doctrees/environment.pickle
docs/build:
mkdir -p $(@)
docs/build/html: docs/build
mkdir -p $(@)
.venv: requirements.txt
python -m venv .venv
.venv/bin/pip install --upgrade pip
.venv/bin/pip install -r requirements.txt && touch $(@)
.venv/bin/sphinx-build: .venv
.PHONY: clean
clean: clean-build clean-venv
.PHONY: clean-build
clean-build:
test ! -d docs/build || rm -rf docs/build
.PHONY: clean-venv
clean-venv:
test ! -d .venv || rm -rf .venv