2023-05-27 07:27:16 +00:00
|
|
|
export PATH := $(PATH):bin
|
2022-09-23 14:12:30 +00:00
|
|
|
SRCS := $(sort $(wildcard *.md))
|
2023-06-15 12:42:33 +00:00
|
|
|
SRCS := $(filter-out README.md, $(SRCS))
|
2022-09-23 14:12:30 +00:00
|
|
|
DEST := $(notdir $(PWD))
|
|
|
|
|
|
|
|
.PHONY: static
|
|
|
|
static: output/index.html
|
2023-05-27 07:27:16 +00:00
|
|
|
@if [ -d static ]; then cp -rpL static/ output/; fi
|
2022-09-23 14:12:30 +00:00
|
|
|
|
|
|
|
%.html: %.md
|
2022-09-29 13:01:38 +00:00
|
|
|
sed 's/#!//e;' $< | mdtoreveal /dev/stdin --output $@
|
2022-09-23 14:12:30 +00:00
|
|
|
|
|
|
|
output/index.md: $(SRCS)
|
|
|
|
mkdir -p output
|
|
|
|
cat $(SRCS) > output/index.md
|
|
|
|
|
|
|
|
.PHONY: rsync
|
|
|
|
rsync: static
|
2023-05-27 07:27:16 +00:00
|
|
|
rsync -ah --delete output/ mdk_fr@mdk.fr:/var/www/mdk.fr/$(DEST)/
|
2022-09-23 14:12:30 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -fr output
|
|
|
|
|
|
|
|
.PHONY: entr
|
|
|
|
entr:
|
|
|
|
ls -1 *.md | entr $(MAKE) static
|
|
|
|
|
|
|
|
.PHONY: serve
|
|
|
|
serve: static
|
|
|
|
python3 -m http.server -d output/
|
|
|
|
|
|
|
|
.PHONY: test
|
|
|
|
test:
|
2023-05-27 07:27:16 +00:00
|
|
|
@if [ -f test.py ]; then \
|
2022-09-23 14:12:30 +00:00
|
|
|
python test.py *.md; \
|
|
|
|
fi
|