From 489b0b1a7a89e34e928031640fc7a0782afa3ce2 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Wed, 6 Sep 2017 02:14:05 +0200 Subject: [PATCH] update makefile for epub --- makefile | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/makefile b/makefile index 8e105f7..bdde046 100644 --- a/makefile +++ b/makefile @@ -2,31 +2,18 @@ title = 'category-theory-for-programmers' root = $(shell pwd) src = $(root)/src -init = $(src)/init/cover.html $(src)/init/table.html $(src)/init/preface.html + chapters = $(shell find $(src)/part-* -name '*.html' | sort -V) -all: pdf epub - -pdf: - cd $(src)/init; \ - pandoc \ - $(init) \ - $(chapters) \ - $(root)/opt/metadata.yaml \ - --standalone \ - --smart \ - --number-sections \ - -H $(root)/opt/tex \ - --latex-engine=xelatex \ - -o $(root)/$(title).pdf - -epub: - cd $(src)/init; \ - pandoc \ - $(init) \ - $(chapters) \ - $(root)/opt/metadata.yaml \ - --standalone \ - --smart \ - --number-sections \ +book: + cd $(src)/init; \ + pandoc \ + $(src)/init/preface.html \ + $(chapters) \ + --smart \ + --toc \ + --number-section \ + --epub-stylesheet=$(root)/pandoc/style.css \ + --epub-cover-image=$(root)/pandoc/cover.png \ + --epub-embed-font='$(src)/fonts/*.woff' \ -o $(root)/$(title).epub