articles and other creations https://zine.tildeverse.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

59 lines
1.4 KiB

DEST_DIR ?= dist
ISSUES != find . -path "./issues/*" -type d
DEST_PDF_FILES := $(ISSUES:./issues/%=$(DEST_DIR)/issue-%.pdf)
DEST_HTML_FILES := $(ISSUES:./issues/%=$(DEST_DIR)/issue-%.html)
DEST_EPUB_FILES := $(ISSUES:./issues/%=$(DEST_DIR)/issue-%.epub)
PANDOC != command -v pandoc 2> /dev/null
all: $(DEST_PDF_FILES) $(DEST_HTML_FILES) $(DEST_EPUB_FILES)
$(DEST_DIR)/issue-%.pdf: issues/%
@echo "building $@"
@$(PANDOC) \
--file-scope \
--from markdown \
--to latex \
--pdf-engine xelatex \
--table-of-contents \
--variable title:"tildeverse zine $@" \
--standalone \
--output $@ \
$</*.md
$(DEST_DIR)/issue-%.html: issues/%
@echo "building $@"
@$(PANDOC) \
--file-scope \
--from markdown \
--to html \
--standalone \
--table-of-contents \
--lua-filter header-permalinks.lua \
--lua-filter increase-header-levels.lua \
--metadata title:"tildeverse zine $@" \
--variable include-before:"<div class=\"container\">" \
--variable include-after:"</div>" \
--css https://tilde.team/css/hacker.css \
--output $@ \
$</*.md
$(DEST_DIR)/issue-%.epub: issues/%
@echo "building $@"
@$(PANDOC) \
--file-scope \
--from markdown \
--to epub \
--standalone \
--table-of-contents \
--lua-filter increase-header-levels.lua \
--metadata title:"tildeverse zine $@" \
--output $@ \
$</*.md
clean:
@echo "removing build artifacts"
@rm $(DEST_PDF_FILES) $(DEST_HTML_FILES) $(DEST_EPUB_FILES)
.PHONY: clean