-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
32 lines (26 loc) · 984 Bytes
/
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
# Commands:
# make doctoc - generate doctoc markdown files with https://github.com/thlorenz/doctoc
# make pretty - generate pretty markdown files with https://github.com/prettier/prettier
# make remove - remove not used images inside `assets'
# make optimize - optimize assets with https://tinypng.com
#
DOCTOC := $(shell command -v doctoc 2> /dev/null)
PRETTIER := $(shell command -v prettier 2> /dev/null)
.PHONY: all doctoc pretty
all: doctoc pretty
doctoc:
ifndef DOCTOC
$(error "doctoc is not available, ref: https://github.com/thlorenz/doctoc")
endif
find . -name "*.md" | xargs doctoc --notitle
pretty:
ifndef PRETTIER
$(error "prettier is not available, ref: https://github.com/prettier/prettier")
endif
find . -name "*.md" | xargs prettier --write
optimize:
ifndef TINIFY_ACCESS_KEY
$(error "enviroment variable TINIFY_ACCESS_KEY not set, set is via https://tinypng.com/dashboard/api")
endif
@pip install tinify >/dev/null 2>&1
@python optimize-asset.py