@@ -4,9 +4,13 @@ CHAPTERS := 00_intro 01_values 02_program_structure 03_functions 04_data 05_high
4
4
07_elife 08_error 09_regexp 10_modules 11_language 12_browser 13_dom 14_event 15_game 16_canvas \
5
5
17_http 18_forms 19_paint 20_node 21_skillsharing
6
6
7
+ SVGS := $(wildcard img/* .svg)
8
+
7
9
.SECONDARY : $(foreach CHAP,$(CHAPTERS ) ,tex/$(CHAP ) .db)
8
10
9
- html : $(foreach CHAP,$(CHAPTERS ) ,html/$(CHAP ) .html) html/js/chapter_info.js code/skillsharing.zip code/solutions/20_4_a_public_space_on_the_web.zip
11
+ html : $(foreach CHAP,$(CHAPTERS ) ,html/$(CHAP ) .html) html/js/chapter_info.js \
12
+ code/skillsharing.zip code/solutions/20_4_a_public_space_on_the_web.zip \
13
+ $(patsubst img/%.svg,img/generated/%.png,$(SVGS))
10
14
11
15
html/% .html : % .txt asciidoc_html.conf
12
16
PATH=node_modules/codemirror/bin:$(PATH ) asciidoc -f asciidoc_html.conf --backend=html5 -o $@ $<
@@ -15,6 +19,12 @@ html/%.html: %.txt asciidoc_html.conf
15
19
html/js/chapter_info.js : $(foreach CHAP,$(CHAPTERS ) ,$(CHAP ) .txt) code/solutions/* bin/chapter_info.js
16
20
node bin/chapter_info.js > html/js/chapter_info.js
17
21
22
+ img/generated/% .png : img/% .svg
23
+ inkscape --export-png=$@ $<
24
+
25
+ img/generated/% .pdf : img/% .svg
26
+ inkscape --export-pdf=$@ $<
27
+
18
28
code/skillsharing.zip : html/21_skillsharing.html
19
29
rm -f $@
20
30
cd code; zip skillsharing.zip skillsharing/* .js* skillsharing/public/* .*
@@ -38,7 +48,8 @@ test: html
38
48
@node bin/check_links.js
39
49
@echo Done.
40
50
41
- book.pdf : tex/book/book.tex $(foreach CHAP,$(CHAPTERS ) ,tex/$(CHAP ) .tex) tex/solutions.tex
51
+ book.pdf : tex/book/book.tex $(foreach CHAP,$(CHAPTERS ) ,tex/$(CHAP ) .tex) tex/solutions.tex \
52
+ $(patsubst img/%.svg,img/generated/%.pdf,$(SVGS))
42
53
cd tex/book && xelatex book.tex
43
54
cd tex/book && xelatex book.tex
44
55
makeindex -s tex/book/nostarch.ist -o tex/book/book.ind tex/book/book.idx
0 commit comments