Skip to content

Commit

Permalink
feat(rules): Add target for static html index page for books
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Mar 30, 2022
1 parent 15a1b2c commit 9e43fc1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion rules/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ MOCKUPFACTOR ?= 1
FIGURES ?=

# Default output formats and parameters (often overridden)
FORMATS ?= pdfs epub mobi odt docx mdbook web $(and $(ISBNS),play) app
FORMATS ?= pdfs epub mobi odt docx mdbook web static $(and $(ISBNS),play) app
BLEED ?= 3
TRIM ?= 10
NOBLEED ?= 0
Expand Down Expand Up @@ -1199,6 +1199,17 @@ $(BUILDDIR)/%.mdbook/book.toml: %-manifest.yml
"language": .lang
}}' $< > $@

DISTDIRS += *.static

%.static: %.static/index.html %.epub %.mdbook
mkdir -p $(@D)
cp $^ $(@D)

%.static/index.html: %-manifest.yml
set -x
mkdir -p $(@D)
echo "<!DOCTYPE html><html><body><a href=../$*.epub>epub</a> <a href=../$*.mdbook/>oku</a></body></html>" > $@

DISTFILES += *.epub

%.odt: $(BUILDDIR)/%-$(_processed).md %-manifest.yml
Expand Down

0 comments on commit 9e43fc1

Please sign in to comment.