summaryrefslogtreecommitdiff
path: root/Makefile
blob: ab720f284071b73d2d9e68f3cb40df6828e0237d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
doc_sources = $(wildcard doc/*/*.md) $(wildcard doc/*.md)
outdoc_files = $(addprefix out/,$(doc_sources:.md=.html))

docassets = $(addprefix out/,$(wildcard doc/_assets/*))

VERSION = $(shell node -e "console.log( require('./src/package.json').version )") 

docs: $(outdoc_files) $(docassets)

out/doc/_assets/%: doc/_assets/%
	mkdir -p $(@D)
	cp $< $@

out/doc/%.html: doc/%.md
	mkdir -p $(@D)
	node tools/doc/generate.js --format=html --template=doc/template.html $< > $@
	cat $@ | sed 's/__VERSION__/${VERSION}/' > $@

clean:
	rm -rf out/