-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMakefile
More file actions
114 lines (94 loc) · 3.46 KB
/
Copy pathMakefile
File metadata and controls
114 lines (94 loc) · 3.46 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
include .env.mk
SHELL := /bin/bash
TOPICS := $(shell find $(pwd) -type f -name \*.template.md)
DEMOS := $(shell ls *.demo 2>/dev/null)
BASEDIR ?= "../.."
COMMIT := $(shell git rev-parse HEAD | head -c7)
TOPICS := $(shell find $(pwd) -type f -name \*.template.md)
IMAGES := $(shell find $(pwd) -type f -name \*.svg -or -name \*.jpg -or -name *.png)
SLIDES := $(shell find $(pwd) -type f -name \*.html -or -name \*.css -or -name *.js)
#FONTAWESOME_NPM_TOKEN := $(shell pp fa-npm)
.PHONY:
all:
@for TOPIC in $(TOPICS); do \
make -C $$(dirname $${TOPIC}) -f $$(pwd)/Makefile $$(basename $${TOPIC} .template.md).final.md; \
done
.PHONY:
clean-all:
@for TOPIC in $(TOPICS); do \
make -C $$(dirname $${TOPIC}) -f $$(pwd)/Makefile clean; \
done
%.final.md: %.template.md $(DEMOS)
@source $$(dirname $(MAKEFILE_LIST))/scripts/functions.sh; \
for DEMO in $(DEMOS); do \
echo "Splitting demo $$(basename $${DEMO} .demo)"; \
split $$(basename $${DEMO} .demo); \
done; \
echo "Generating $$(basename $@)"; \
include $*
BIN := $(HOME)/.local/bin
GOMPLATE := $(BIN)/gomplate
SASS := $(BIN)/sass
NPM := $(BIN)/npm
MKDOCS := $(BIN)/mkdocs
$(BIN)/%:
@uniget install $*
$(addsuffix .html,$(shell find . -maxdepth 1 -name \*.yaml -printf '%P\n' | xargs -I{} basename {} .yaml)):%.html: Makefile template.html %.yaml $(GOMPLATE)
@$(GOMPLATE) --file=template.html --datasource=talk=$*.yaml --out=$@; \
sed -i 's/</</g; s/>/>/g' $@
.PHONY:
init:
@env FONTAWESOME_NPM_TOKEN=$(FONTAWESOME_NPM_TOKEN) $(NPM) install
.PHONY:
update:
@env FONTAWESOME_NPM_TOKEN=$(FONTAWESOME_NPM_TOKEN) $(NPM) update
.PHONY:
audit:
@$(NPM) audit
.PHONY:
check-links: init
@\
find . -name \*.md -print0 \
| xargs -0 -n1 \
./node_modules/.bin/markdown-link-check --quiet
.PHONY:
nginx: themes/fontawesome.css
@\
echo "****************************************************"; \
echo "* *"; \
echo "* Please open http://localhost to view the slides. *"; \
echo "* *"; \
echo "****************************************************"; \
docker compose up --abort-on-container-exit web
gulp: init themes/fontawesome.css
@docker compose up --abort-on-container-exit gulp
serve: init themes/fontawesome.css
@./node_modules/.bin/gulp serve
themes/fontawesome.css:%.css: %.scss
@$(SASS) $*.scss $*.css
$(addsuffix .pdf,$(shell find . -maxdepth 1 -name \*.md -printf '%P\n' | xargs -I{} basename {} .md)):%.pdf: %.md
@docker compose run md2pdf $*.md $*.pdf
@docker compose down --remove-orphans
$(addsuffix .pdf,$(shell find . -maxdepth 1 -name \*.html -printf '%P\n' | xargs -I{} basename {} .html)):%.pdf: %.html themes/fontawesome.css
@docker compose run decktape --size=1920x1080 --load-pause=5000 --pause=1000 "http://web/$*.html" $*.pdf
@docker compose down --remove-orphans
# pipx install mkdocs \
# --pip-args "mkdocs-material mkdocs-material-extensions pymdown-extensions mkdocs-minify-plugin mkdocs-macros-plugin mkdocs-redirects regex" \
# --force
mkdocs:
@shiv --output-file ./mkdocs --console-script properdocs \
properdocs \
mkdocs-material \
mkdocs-material-extensions \
pymdown-extensions \
mkdocs-minify-plugin \
mkdocs-macros-plugin \
mkdocs-redirects \
regex
.PHONY:
mkdocs-serve: mkdocs
@./mkdocs serve --config-file=180_observability.yml --open --watch 180_observability
.PHONY:
clean:
@rm -fv *.final.md *.command
@docker compose down --remove-orphans