Skip to content

Commit

Permalink
doc: Add Makefile fragments to generate print-ready book files
Browse files Browse the repository at this point in the history
These fragments combine the pages from snek-book.pdf in a way that
when printed double-sided (flip long edge), they can be folded into
a book with the pages in the correct order. A cover is generated that
fits on a regular 8.5 x 11 sheet so that it can also be printed.

Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
keith-packard committed Apr 23, 2019
1 parent 2bde4cb commit cb96100
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions doc/Makefile
Expand Up @@ -14,7 +14,9 @@ IMAGE_FILES=../snek.svg

all: $(HTML_FILES) $(PDF_FILES)

book: snek-book.pdf snek-cover.pdf
BOOK_FILES=snek-book.pdf snek-cover.pdf snek-book-book.pdf snek-cover-book.pdf

book: $(BOOK_FILES)

LETTER_ATTRIBUTES=--attribute='pdf-style=snek'
BOOK_ATTRIBUTES=--attribute='pdf-style=snek-book'
Expand All @@ -37,11 +39,17 @@ install: $(DOCFILES)
snek-book.pdf: snek.adoc snek-book-theme.yml
asciidoctor-pdf -o `pwd`/$@ -B$(SNEK_ROOT) $(ATTRIBUTES) $(BOOK_ATTRIBUTES) snek.adoc

snek-book-book.pdf: snek-book.pdf
pdfbook2 -n --paper=letter snek-book.pdf

snek-cover.pdf: snek-cover.svg
rsvg-convert -d 72 -p 72 -f pdf -o $@ $^

snek-cover-book.pdf: snek-cover.svg
rsvg-convert -d 69.05 -p 69.94 -f pdf -o $@ $^

upload: $(DOCFILES)
rsync -avz $(DOCFILES) fonts $(SNEKDOC)

clean::
rm -f $(PDF_FILES) $(HTML_FILES)
rm -f $(PDF_FILES) $(HTML_FILES) $(BOOK_FILES)

0 comments on commit cb96100

Please sign in to comment.