update makefile

urosm 2024-01-15 07:07:32 +01:00
parent 494cd609dd
commit 7d8bb7eff9
1 changed files with 15 additions and 28 deletions

View File

@ -1,40 +1,27 @@
SHELL = /bin/sh
PANDOC = pandoc
PANDOCFLAGS = \
--data-dir=.pandoc\
--id-prefix=$*\
--resource-path=.:$(dir $<)
IKIWIKIFLAGS = \
$(PANDOCFLAGS)\
--defaults=ikiwiki
MOODLEFLAGS = \
$(PANDOCFLAGS)\
--defaults=moodle
FLAGS = \
--data-dir=pandoc\
--resource-path=.:pandoc
all: wiki/*.mdwn refresh
.PHONY: wiki
wiki: wiki/*
wiki/%.mdwn: %/index.md
$(PANDOC) $(IKIWIKIFLAGS) -o $@ $<
# wiki
wiki/%.mdwn: notes/%.md notes/default.mdwn.yaml | refresh
pandoc $(FLAGS) --id-prefix=$* -d notes/default.mdwn.yaml -o $@ $<
wiki/%.mdwn: notes/%.md
$(PANDOC) $(IKIWIKIFLAGS) -o $@ $<
dest/%.html: moodle/%.md
$(PANDOC) $(MOODLEFLAGS) -o $@ $<
dest/%.docx: %/index.md
$(PANDOC) $(PANDOCFLAGS) -d $(dir $<)docx.yaml -o $@ $<
dest/%.html: %/index.md
$(PANDOC) $(PANDOCFLAGS) -d $(dir $<)html.yaml -o $@ $<
dest/%.pdf: %/index.md
$(PANDOC) $(PANDOCFLAGS) -d $(dir $<)pdf.yaml -o $@ $<
# dest
dest/%.docx: notes/%.md notes/default.docx.yaml
pandoc $(FLAGS) -d notes/default.docx.yaml -o $@ $<
.PHONY: refresh
refresh:
ikiwiki --setup laptop.setup --refresh
.PHONY: rebuild
rebuild:
ikiwiki --setup laptop.setup --rebuild
.PHONY: clean
clean:
ikiwiki --setup laptop.setup --clean