mirror of
https://github.com/cssanimation/css-animation-101.git
synced 2025-01-16 14:28:17 +01:00
45 lines
1.2 KiB
Makefile
45 lines
1.2 KiB
Makefile
BUILD = build
|
|
OUTPUT_FILENAME = book
|
|
METADATA = metadata.yml
|
|
CHAPTERS = chapters/*.md
|
|
TOC = --toc --toc-depth=2
|
|
IMAGES_FOLDER = images
|
|
COVER_IMAGE = images/cover.png
|
|
LATEX_CLASS = report
|
|
MATH_FORMULAS = --webtex
|
|
CSS_FILE = style.css
|
|
CSS_ARG = --css=$(CSS_FILE)
|
|
ARGS = $(TOC) $(MATH_FORMULAS) $(CSS_ARG)
|
|
|
|
all: book
|
|
|
|
book: epub html pdf
|
|
|
|
clean:
|
|
rm -r $(BUILD)
|
|
|
|
epub: $(BUILD)/epub/$(OUTPUT_FILENAME).epub
|
|
|
|
html: $(BUILD)/html/$(OUTPUT_FILENAME).html
|
|
|
|
pdf: $(BUILD)/pdf/$(OUTPUT_FILENAME).pdf
|
|
|
|
word: $(BUILD)/word/$(OUTPUT_FILENAME).docx
|
|
|
|
$(BUILD)/epub/$(OUTPUT_FILENAME).epub: $(METADATA) $(CHAPTERS)
|
|
mkdir -p $(BUILD)/epub
|
|
pandoc $(ARGS) --epub-metadata=$(METADATA) --epub-cover-image=$(COVER_IMAGE) -o $@ $^
|
|
|
|
$(BUILD)/html/$(OUTPUT_FILENAME).html: $(CHAPTERS)
|
|
mkdir -p $(BUILD)/html
|
|
pandoc $(ARGS) --standalone --to=html5 -o $@ $^
|
|
cp -R $(IMAGES_FOLDER)/ $(BUILD)/html/$(IMAGES_FOLDER)/
|
|
cp $(CSS_FILE) $(BUILD)/html/$(CSS_FILE)
|
|
|
|
$(BUILD)/pdf/$(OUTPUT_FILENAME).pdf: $(METADATA) $(CHAPTERS)
|
|
mkdir -p $(BUILD)/pdf
|
|
pandoc $(ARGS) -V documentclass=$(LATEX_CLASS) -o $@ $^
|
|
|
|
$(BUILD)/word/$(OUTPUT_FILENAME).docx: $(METADATA) $(CHAPTERS)
|
|
mkdir -p $(BUILD)/word
|
|
pandoc $(ARGS) -V documentclass=$(LATEX_CLASS) -o $@ $^
|