From 45f40d0d8d43cdb7c314a1e881283fb86aa320ea Mon Sep 17 00:00:00 2001 From: Wen Kokke Date: Thu, 2 Jul 2020 21:39:29 +0100 Subject: [PATCH] Fixed Makefile, added epubtest. --- .travis.yml | 5 +---- Makefile | 9 ++++++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 18c41fcc..c091104d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,11 +9,9 @@ cache: timeout: 1500 directories: - out/ - - lua_modules/ - $HOME/.stack - $HOME/.agda - $HOME/.local - - $HOME/.luarocks - $HOME/agda-$AGDA_VERSION - $HOME/agda-stdlib-$AGDA_STDLIB_VERSION - $HOME/acknowledgements-master @@ -45,11 +43,10 @@ script: - agda --version - acknowledgements --version - pandoc --version -- lua -v -- luarocks --version - make build - make test-offline # disable to only build cache - make epub +- make epubcheck before_deploy: - acknowledgements -i _config.yml >> _config.yml diff --git a/Makefile b/Makefile index cd3d2542..1b600216 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ AGDA_FILES := $(shell find . -type f -and \( -path '*/src/*' -or -path '*/course AGDAI_FILES := $(shell find . -type f -and \( -path '*/src/*' -or -path '*/courses/*' \) -and -name '*.agdai') MARKDOWN_FILES := $(subst courses/,out/,$(subst src/,out/,$(subst .lagda.md,.md,$(AGDA_FILES)))) PLFA_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) +PANDOC := pandoc +EPUBCHECK := epubcheck RUBY := ruby GEM := $(RUBY) -S gem BUNDLE := $(RUBY) -S bundle @@ -53,11 +55,14 @@ out/: epub: out/epub/plfa.epub +epubcheck: out/epub/plfa.epub + $(EPUBCHECK) out/epub/plfa.epub + out/epub/: mkdir -p out/epub/ out/epub/plfa.epub: out/epub/ | $(AGDA_FILES) $(LUA_FILES) epub/main.css out/epub/acknowledgements.md - pandoc --strip-comments \ + $(PANDOC) --strip-comments \ --css=epub/main.css \ --epub-embed-font='assets/fonts/mononoki.woff' \ --epub-embed-font='assets/fonts/FreeMono.woff' \ @@ -76,6 +81,8 @@ out/epub/plfa.epub: out/epub/ | $(AGDA_FILES) $(LUA_FILES) epub/main.css out/epu out/epub/acknowledgements.md: src/plfa/acknowledgements.md _config.yml $(RUBY) epub/render-liquid-template.rb _config.yml $< $@ +.phony: epub epubcheck + # Convert literal Agda to Markdown define AGDA_template