zine/Makefile

55 lines
1.2 KiB
Makefile
Raw Normal View History

2019-09-23 14:21:43 +00:00
ISSUES != find issues -type d
DEST_PDF_FILES := $(ISSUES:issues/%=dist/issue-%.pdf)
DEST_HTML_FILES := $(ISSUES:issues/%=dist/issue-%.html)
2019-09-23 16:25:21 +00:00
DEST_EPUB_FILES := $(ISSUES:issues/%=dist/issue-%.epub)
2019-09-23 14:21:43 +00:00
PANDOC != command -v pandoc 2> /dev/null
2019-09-23 16:25:21 +00:00
all: $(DEST_PDF_FILES) $(DEST_HTML_FILES) $(DEST_EPUB_FILES)
2019-09-23 14:21:43 +00:00
dist/issue-%.pdf: issues/%
2019-09-23 14:21:43 +00:00
$(PANDOC) \
--file-scope \
--from markdown \
--to latex \
--pdf-engine xelatex \
--table-of-contents \
--variable title:"tildeverse zine $@" \
--standalone \
--output $@ \
$</*.md
dist/issue-%.html: issues/%
2019-09-23 14:44:02 +00:00
$(PANDOC) \
--file-scope \
--from markdown \
--to html \
--standalone \
--table-of-contents \
--lua-filter header-permalinks.lua \
--lua-filter increase-header-levels.lua \
2019-09-23 14:44:02 +00:00
--metadata title:"tildeverse zine $@" \
--variable include-before:"<div class=\"container\">" \
--variable include-after:"</div>" \
2019-09-23 14:44:02 +00:00
--css https://tilde.team/css/hacker.css \
--output $@ \
$</*.md
2019-09-23 16:25:21 +00:00
dist/issue-%.epub: issues/%
$(PANDOC) \
--file-scope \
--from markdown \
--to epub \
--standalone \
--table-of-contents \
--lua-filter increase-header-levels.lua \
--metadata title:"tildeverse zine $@" \
--output $@ \
$</*.md
2019-09-23 14:44:02 +00:00
clean:
2019-09-23 16:25:21 +00:00
@rm dist/*.html dist/*.pdf dist/*.epub
2019-09-23 14:44:02 +00:00
.PHONY: clean