Skip to content

Commit 19539a1

Browse files
author
henry
committed
Retrieve gitbook rendered pdf automatically
1 parent 4452683 commit 19539a1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ _book
77
node_modules
88
svg/*.pdf
99
book.pdf
10+
rendered.pdf
1011
print_version.pdf

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ IMGDIR = generated/images
33
# svgs to be converted to png
44
SVGS := $(patsubst %.svg,$(IMGDIR)/%.png,$(wildcard svg/*.svg))
55

6+
hash := $(shell git rev-parse HEAD)
67

78
# one rule to make them all
89
all : main
@@ -30,7 +31,8 @@ back :
3031
convert back.png -background white -flatten back.jpg
3132

3233
publish :
33-
pdftk A=book.pdf B=inner.pdf C=blank.pdf cat A1 B1 C1 A2-end output print_version.pdf
34+
curl https://www.gitbook.com/download/pdf/book/ncrcoe/java-for-small-teams/v/${hash} > rendered.pdf
35+
pdftk A=rendered.pdf B=inner.pdf C=blank.pdf cat A1 B1 C1 A2-end output print_version.pdf
3436

3537
clean :
3638
rm $(SVGS)

0 commit comments

Comments
 (0)