blob: f84ef0e42c69129bb0508be58f34ae7d585589eb (
plain)
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
|
SHA1=$(shell openssl sha1 -r pandoc.wasm | sed 's/ .*$$//')
EXAMPLES=$(patsubst %,%.tar,$(shell find examples -mindepth 1 -type d))
site/examples:
mkdir -p $@
site: site/examples $(patsubst %,site/%,$(EXAMPLES))
examples: $(EXAMPLES)
echo $(EXAMPLES)
.PHONY: examples
site/pandoc.js: pandoc.js
perl -p -e "s/pandoc.wasm\?sha1=XX/pandoc.wasm?sha1=$(SHA1)/" $< > $@
site/%.html: %.html
perl -p -e "s/pandoc.js\?sha1=XX/pandoc.js?sha1=$(SHA1)/" $< > $@
site/examples/%.tar: examples/%.tar
cp $< $@
site/%: %
cp $< $@
upload: site site/pandoc.js site/index.html site/pandoc.wasm
rsync -av site/ website:pandoc.org/wasm-demo
.PHONY: upload
examples/%.tar: examples/%
tar -cf "$@" -C "$<" .
serve:
python3 -m http.server
.PHONY: serve
|