-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathMakefile
43 lines (30 loc) · 1.34 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
#!/usr/bin/make -f
.PHONY: build
MAKE_DOCS = mkdocs
deploy: setup build
serve:
$(MAKE_DOCS) serve -a 0.0.0.0:8000 --livereload
build: build-gallery
mkdir -p docs/fonts
# note: we use "$$" below in "$$item" to escape automatic interpolation
curl -s https://image-charts.com/swagger.json | jq -r '.paths[].get.parameters[] | select(.name == "icff").enum | reduce .[] as $$item ([]; . + ["`" + $$item + "`"]) | join(", ")' > docs/GENERATED-google-fonts.md
curl -s https://image-charts.com/errors.json | jq -r 'reduce .[] as $$item ([]; . + ["- `" + $$item.code + "`: " + $$item.description]) | join("\n")' > docs/GENERATED-error-codes.md
mkdir -p site
$(MAKE_DOCS) build
# don't forget to copy the robots.txt file to the publish "site/" folder
cp -v robots.txt site/
build-gallery:
npm install
curl -s https://image-charts.com/gallery.json > ./scripts/gallery.json
node scripts/generate-gallery.js > ./docs/GENERATED-gallery.md
update: update-logo
test: test-python
test-python:
docker run -v $(shell pwd)/docs:/docs python:2.7-slim python /docs/reference/Data_format/encoding.py -v
# test-node:
# docker run -v $(shell pwd)/docs:/docs node:10-slim node /docs/reference/Data_format/encoding.js
update-logo:
rm -rf /tmp/website
git clone git@github.com:image-charts/website.git /tmp/website
cp -R -v /tmp/website/app/logo docs/
rm -v docs/logo/*.md