diff --git a/Makefile b/Makefile index 5f5e0fe8..207c94de 100644 --- a/Makefile +++ b/Makefile @@ -18,18 +18,15 @@ PANDOC := stack exec pandoc -- .PHONY: all all: - @echo "Building site..." - make build - @echo "Testing site..." - make test - @echo "Building epub..." - make epub-build - @echo "Testing epub..." - make epub-test - @echo "Building pdf..." - make pdf-build - @echo "Testing pdf..." + @make build + @make epub-build + @make pdf-build +.PHONY: all-clean +all-clean: + @make clean + @make epub-clean + @make pdf-clean ################################################################################# # Setup Git Hooks @@ -37,7 +34,8 @@ all: .PHONY: init init: setup-check-fix-whitespace setup-install-htmlproofer - git config core.hooksPath .githooks + @echo "Setting up Git Hooks" + @git config core.hooksPath .githooks ################################################################################# @@ -45,13 +43,14 @@ init: setup-check-fix-whitespace setup-install-htmlproofer ################################################################################# .PHONY: build -build: \ - standard-library/ChangeLog.md - stack build && stack exec site build +build: standard-library/ChangeLog.md + @echo "Building site" + @stack build && stack exec site build standard-library/ChangeLog.md: - git submodule init - git submodule update --recursive + @echo "Updating Agda standard library" + @git submodule init + @git submodule update --recursive ################################################################################# @@ -60,17 +59,18 @@ standard-library/ChangeLog.md: .PHONY: test test: setup-install-htmlproofer build - cd $(SITE_DIR) && htmlproofer \ - --check-html \ - --disable-external \ - --report-invalid-tags \ - --report-missing-names \ - --report-script-embeds \ - --report-missing-doctype \ - --report-eof-tags \ - --report-mismatched-tags \ - --check-img-http \ - --check-opengraph \ + @echo "Testing generated HTML using HTMLProofer" + @cd $(SITE_DIR) && htmlproofer \ + --check-html \ + --disable-external \ + --report-invalid-tags \ + --report-missing-names \ + --report-script-embeds \ + --report-missing-doctype \ + --report-eof-tags \ + --report-mismatched-tags \ + --check-img-http \ + --check-opengraph \ . @@ -79,9 +79,9 @@ test: setup-install-htmlproofer build ################################################################################# .PHONY: watch -watch: \ - standard-library/ChangeLog.md - stack build && stack exec site watch +watch: standard-library/ChangeLog.md + @echo "Watching for changes and rebuilding" + @stack build && stack exec site watch ################################################################################# @@ -90,7 +90,8 @@ watch: \ .PHONY: update-contributors update-contributors: - stack build && stack exec update-contributors + @echo "Updating contributors from GitHub" + @stack build && stack exec update-contributors ################################################################################# @@ -98,9 +99,9 @@ update-contributors: ################################################################################# .PHONY: clean -clean: \ - standard-library/ChangeLog.md - stack build && stack exec site clean +clean: standard-library/ChangeLog.md + @echo "Cleaning generated files for site" + @stack build && stack exec site clean ################################################################################# @@ -119,9 +120,7 @@ list: .PHONY: publish publish: setup-check-rsync - @echo "Building site..." - make build - @echo "Testing site..." + make all make test @echo "Creating web branch..." git fetch --all @@ -159,13 +158,16 @@ ifeq (,$(wildcard $(PLFA_AFS_DIR))) @exit 1 else ifeq (,$(wildcard $(PLFA_AFS_DIR)/html)) + @echo "Checkout latest version from GitHub" git clone https://github.com/plfa/plfa.github.io.git --branch web --single-branch --depth 1 html endif - cd $(PLFA_AFS_DIR)/html \ + @echo "Checkout latest version from GitHub" + @cd $(PLFA_AFS_DIR)/html \ && git fetch --depth 1 \ && git reset --hard origin/web \ && git clean -dfx - fsr setacl $(PLFA_AFS_DIR)/html system:groupwebserver rl + @echo "Setting permissions to include web server" + @fsr setacl $(PLFA_AFS_DIR)/html system:groupwebserver rl endif diff --git a/book/epub.css b/book/epub.css index b6a50a63..e6b7867b 100644 --- a/book/epub.css +++ b/book/epub.css @@ -4,7 +4,7 @@ font-family: 'DejaVu-mononoki-Symbola-Droid'; font-weight: normal; font-style: normal; - src: url('../public/webfonts/DejaVu-mononoki-Symbola-Droid.woff'); + src: url('../fonts/DejaVu-mononoki-Symbola-Droid.woff'); } body { diff --git a/book/epub.md b/book/epub.md index b130eca7..a973514e 100644 --- a/book/epub.md +++ b/book/epub.md @@ -2,6 +2,6 @@ $for(parts)$ # $title$ $for(sections)$ ## $title$ {#$anchor$} -$body$ +$shifted_raw$ $endfor$ $endfor$ diff --git a/book/epub.mk b/book/epub.mk index bc6e6cc2..57946cc3 100644 --- a/book/epub.mk +++ b/book/epub.mk @@ -15,24 +15,25 @@ FRANKENFONT := public/webfonts/DejaVu-mononoki-Symbola-Droid.woff # Compile PLFA to an EPUB using Pandoc ################################################################################# -.PHONY: epub-build +.PHONY: epub epub-build +epub: epub-build epub-build: $(SITE_DIR)/plfa.epub $(SITE_DIR)/plfa.epub: \ - $(EPUB_DIR)/epub.md $(EPUB_DIR)/epub.css $(RAW_DIR)/epub.xml $(FRANKENFONT) \ + $(RAW_DIR)/epub.md $(EPUB_DIR)/epub.css $(RAW_DIR)/epub.xml $(FRANKENFONT) \ $(MD_FILES) $(EPUB_LUA_SCRIPTS) | setup-install-pandoc - @$(PANDOC) \ + @echo "Building EPUB" + $(PANDOC) \ --strip-comments \ --css=$(EPUB_DIR)/epub.css \ --epub-embed-font=$(FRANKENFONT) \ - --epub-metadata=$(RAW_DIR)/epub.xml + --epub-metadata=$(RAW_DIR)/epub.xml \ --indented-code-class=default \ --lua-filter=$(EPUB_LUA_DIR)/set-default-code-class.lua -M default-code-class=agda \ --lua-filter=$(EPUB_LUA_DIR)/remove-badges.lua -M badge-url=https://img.shields.io/badge/ \ --lua-filter=$(EPUB_LUA_DIR)/epub-clean-html.lua \ --lua-filter=$(EPUB_LUA_DIR)/single-file-links.lua \ --standalone \ - --fail-if-warnings \ --toc --toc-depth=2 \ --epub-chapter-level=2 \ $< -o $@ @@ -44,7 +45,8 @@ $(SITE_DIR)/plfa.epub: \ .PHONY: epub-test epub-test: $(SITE_DIR)/plfa.epub | setup-check-epubcheck - epubcheck $(SITE_DIR)/plfa.epub + @echo "Testing EPUB with EPUBCheck" + @epubcheck $(SITE_DIR)/plfa.epub ################################################################################# @@ -52,7 +54,7 @@ epub-test: $(SITE_DIR)/plfa.epub | setup-check-epubcheck ################################################################################# $(RAW_DIR)/epub.xml: $(EPUB_DIR)/epub.xml - make build + @make build ################################################################################# @@ -61,7 +63,8 @@ $(RAW_DIR)/epub.xml: $(EPUB_DIR)/epub.xml .PHONY: epub-clean epub-clean: - rm -f $(SITE_DIR)/plfa.epub + @echo "Cleaning generated files for EPUB" + @rm -f $(SITE_DIR)/plfa.epub ################################################################################# diff --git a/book/lua/epub-clean-html.lua b/book/lua/epub-clean-html.lua index 5a83375a..0a42bbf7 100644 --- a/book/lua/epub-clean-html.lua +++ b/book/lua/epub-clean-html.lua @@ -1,5 +1,5 @@ --- Transforms '