site/wiki/Makefile

31 lines
628 B
Makefile
Raw Normal View History

SRC_MD_FILES != find source -name '*.md'
DST_HTML_FILES := $(SRC_MD_FILES:source/%.md=%.html)
PANDOC != command -v pandoc 2> /dev/null
2019-10-01 16:59:22 +00:00
all: dep-pandoc $(DST_HTML_FILES)
%.html: source/%.md
2019-10-01 16:59:22 +00:00
$(info building $@)
2019-09-24 15:07:46 +00:00
@$(PANDOC) \
--template wiki.tmpl \
--lua-filter header-permalinks.lua \
--title-prefix "tilde.club wiki" \
2019-09-23 03:46:32 +00:00
--variable toc-title:"table of contents" \
--standalone \
--table-of-contents \
--output $@ \
$<
clean:
2019-10-01 16:59:22 +00:00
$(info removing generated files)
2019-09-24 15:07:46 +00:00
@rm $(DST_HTML_FILES)
2019-10-01 16:59:22 +00:00
dep-pandoc:
ifndef PANDOC
$(error missing dependency 'pandoc'. please install and try again)
endif
.PHONY: clean dep-pandoc