2022-07-28 18:09:24 +02:00
|
|
|
BUILD = build
|
2022-12-13 17:29:16 +01:00
|
|
|
BOOKNAME = el_programador_mediocre
|
2022-07-28 18:09:24 +02:00
|
|
|
TITLE = title.txt
|
|
|
|
METADATA_XML = metadata.xml
|
|
|
|
METADATA_YAML = metadata.yaml
|
|
|
|
CHAPTERS = intro.md chapter01.md chapter02.md chapter03.md chapter04.md chapter05.md chapter06.md chapter07.md epilogue.md gratitude.md appendixa.md
|
|
|
|
TOC = --toc --toc-depth=2
|
2022-12-13 17:29:16 +01:00
|
|
|
COVER_IMAGE = images/el_programador_mediocre.png
|
2022-07-28 18:09:24 +02:00
|
|
|
LATEX_CLASS = book
|
|
|
|
FONTS = fonts/LinBiolinum_R.ttf fonts/LinBiolinum_RI.ttf fonts/LinBiolinum_RB.ttf
|
|
|
|
|
|
|
|
all: book
|
|
|
|
|
|
|
|
book: epub html pdf
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -r $(BUILD)
|
|
|
|
|
|
|
|
epub: $(BUILD)/epub/$(BOOKNAME).epub
|
|
|
|
|
|
|
|
html: $(BUILD)/html/$(BOOKNAME).html fonts css
|
|
|
|
|
|
|
|
fonts: $(patsubst %,$(BUILD)/html/%,$(FONTS))
|
|
|
|
|
|
|
|
css: $(BUILD)/html/css/$(BOOKNAME).css
|
|
|
|
|
|
|
|
pdf: $(BUILD)/pdf/$(BOOKNAME).pdf
|
|
|
|
|
|
|
|
$(BUILD)/epub/$(BOOKNAME).epub: $(TITLE) $(CHAPTERS) $(METADATA_YAML)
|
|
|
|
mkdir -p $(BUILD)/epub
|
2022-12-13 19:35:48 +01:00
|
|
|
pandoc -s $(TOC) --top-level-division=chapter --number-offset=0 --epub-metadata=$(METADATA_XML) --epub-cover-image=$(COVER_IMAGE) -o $@ $^
|
2022-07-28 18:09:24 +02:00
|
|
|
|
|
|
|
$(BUILD)/html/$(BOOKNAME).html: $(CHAPTERS) $(METADATA_YAML)
|
|
|
|
mkdir -p $(BUILD)/html
|
2022-12-13 19:35:48 +01:00
|
|
|
pandoc -s $(TOC) --top-level-division=chapter --number-offset=0 --standalone --to=html5 --css=css/$(BOOKNAME).css -o $@ $^
|
2022-07-28 18:09:24 +02:00
|
|
|
|
|
|
|
$(BUILD)/html/fonts/%: fonts/%
|
|
|
|
mkdir -p $(BUILD)/html/fonts
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
$(BUILD)/html/css/%: css/%
|
|
|
|
mkdir -p $(BUILD)/html/css
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
$(BUILD)/pdf/$(BOOKNAME).pdf: $(CHAPTERS) $(METADATA_YAML)
|
|
|
|
mkdir -p $(BUILD)/pdf
|
2022-12-13 19:35:48 +01:00
|
|
|
pandoc -s $(TOC) --top-level-division=chapter --number-offset=0 --template=Pandoc/templates/cs-6x9-pdf.latex --pdf-engine=xelatex -o $@ $^
|
2022-07-28 18:09:24 +02:00
|
|
|
|
|
|
|
.PHONY: all book clean epub html fonts css pdf
|