Fixed Makefile, added epubtest.

This commit is contained in:
Wen Kokke 2020-07-02 21:39:29 +01:00
parent 3c0394b8a0
commit 45f40d0d8d
2 changed files with 9 additions and 5 deletions

View file

@ -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

View file

@ -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