Skip to content

Commit

Permalink
Merge pull request #30 from entorb/ebook
Browse files Browse the repository at this point in the history
ebook converter scripts
  • Loading branch information
rrthomas authored Dec 14, 2021
2 parents 4471fe3 + 2a74f79 commit e056868
Show file tree
Hide file tree
Showing 4 changed files with 787 additions and 6 deletions.
20 changes: 14 additions & 6 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,27 @@ PROJECT=hpmor

TAG := $(shell git describe --tags)
VERSION := $(shell echo $(TAG) | sed -e 's/^v//')
EBOOKS = ebook/output/$(PROJECT).epub ebook/output/$(PROJECT).mobi
ZIPFILE = $(PROJECT)-$(VERSION).zip

all:
all: ebooks pdf

pdf:
latexmk

zip:
latexmk -g && \
ebooks: pdf
cd ebook && ./1_latex2html.py && ./2_html2epub.sh

zip: pdf ebooks
rm -f $(ZIPFILE) && \
zip $(ZIPFILE) *.pdf
zip $(ZIPFILE) *.pdf $(EBOOKS)

# To make a release: git tag vx.y && git push --tags && make release
# Needs woger from https://github.com/rrthomas/woger/
release: zip
git diff --exit-code && \
woger github package=$(PROJECT) version=$(VERSION) dist_type=zip
hub release edit $(TAG) --attach $(PROJECT).pdf#$(PROJECT)-$(VERSION).pdf
woger github package=$(PROJECT) version=$(VERSION) dist_type=zip && \
for file in $(PROJECT).pdf $(EBOOKS); do \
suffix=$${file##*.}; \
hub release edit $(TAG) --attach $$file#$(PROJECT)-$(VERSION).$$suffix; \
done
2 changes: 2 additions & 0 deletions ebook/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tmp/
output/
Loading

0 comments on commit e056868

Please sign in to comment.