@@ -12,7 +12,7 @@ html/%.html: %.md
12
12
node src/render_html.js $< > $@
13
13
node src/build_code.js $<
14
14
15
- html/js/chapter_info.js : $(foreach CHAP,$(CHAPTERS ) ,$(CHAP ) .txt) code/solutions/* bin /chapter_info.js
15
+ html/js/chapter_info.js : $(foreach CHAP,$(CHAPTERS ) ,$(CHAP ) .txt) code/solutions/* src /chapter_info.js
16
16
node src/chapter_info.js > html/js/chapter_info.js
17
17
18
18
html/js/acorn_codemirror.js : node_modules/codemirror/lib/codemirror.js \
@@ -43,81 +43,5 @@ test: html
43
43
@for F in $(CHAPTERS ) ; do echo Testing $$ F:; node bin/run_tests.js $$ F.txt; done
44
44
@! grep ' [a-zA-Z0-9]_[—“”‘’]\|[—“”‘’]_[a-zA-Z0-9]\|[a-zA-Z0-9]`—\|[a-zA-Z0-9]`[a-zA-Z0-9]' * .txt
45
45
@! grep ' (!book\|(!html|(!interactive|(!tex' html/* .html nostarch/* .tex
46
- @node bin /check_links.js
46
+ @node src /check_links.js
47
47
@echo Done.
48
-
49
- nostarch : $(foreach CHAP,$(CHAPTERS ) ,nostarch/$(CHAP ) .tex) nostarch/hints.tex
50
-
51
- nostarch/hints.tex : $(foreach CHAP,$(CHAPTERS ) ,$(CHAP ) .txt) bin/extract_hints.js
52
- node bin/extract_hints.js | node bin/pre_latex.js --nostarch - | asciidoc -f asciidoc_nostarch.conf --backend=latex -o - - | node bin/clean_latex.js > $@
53
-
54
- nostarch/% .tex : % .txt asciidoc_nostarch.conf bin/pre_latex.js bin/clean_latex.js
55
- node bin/pre_latex.js --nostarch $< | asciidoc -f asciidoc_nostarch.conf --backend=latex -o - - | node bin/clean_latex.js > $@
56
-
57
- nostarch.pdf : nostarch/book.tex $(foreach CHAP,$(CHAPTERS ) ,nostarch/$(CHAP ) .tex) nostarch/hints.tex \
58
- $(patsubst img/%.svg,img/generated/%.pdf,$(SVGS))
59
- cd nostarch && sh build.sh
60
- mv nostarch/book.pdf nostarch.pdf
61
-
62
- pdf : $(foreach CHAP,$(CHAPTERS ) ,pdf/$(CHAP ) .tex) pdf/hints.tex
63
-
64
- pdf/hints.tex : $(foreach CHAP,$(CHAPTERS ) ,$(CHAP ) .txt) bin/extract_hints.js asciidoc_pdf.conf bin/pre_latex.js bin/clean_latex.js
65
- node bin/extract_hints.js | node bin/pre_latex.js - | asciidoc -f asciidoc_pdf.conf --backend=latex -o - - | node bin/clean_latex.js > $@
66
-
67
- pdf/% .tex : % .txt asciidoc_pdf.conf bin/pre_latex.js bin/clean_latex.js
68
- node bin/pre_latex.js $< | asciidoc -f asciidoc_pdf.conf --backend=latex -o - - | node bin/clean_latex.js > $@
69
-
70
- book.pdf : pdf/book.tex $(foreach CHAP,$(CHAPTERS ) ,pdf/$(CHAP ) .tex) pdf/hints.tex \
71
- $(patsubst img/%.svg,img/generated/%.pdf,$(SVGS))
72
- cd pdf && sh build.sh book > /dev/null
73
- mv pdf/book.pdf .
74
-
75
- pdf/book_mobile.tex : pdf/book.tex
76
- cat pdf/book.tex | sed -e ' s/makeidx}/makeidx}\n\\usepackage[a5paper, left=5mm, right=5mm]{geometry}/' | sed -e ' s/setmonofont.Scale=0.8./setmonofont[Scale=0.75]/' > pdf/book_mobile.tex
77
-
78
- book_mobile.pdf : pdf/book_mobile.tex $(foreach CHAP,$(CHAPTERS ) ,pdf/$(CHAP ) .tex) pdf/hints.tex \
79
- $(patsubst img/%.svg,img/generated/%.pdf,$(SVGS))
80
- cd pdf && sh build.sh book_mobile > /dev/null
81
- mv pdf/book_mobile.pdf .
82
-
83
- pdfonce :
84
- cd pdf && xelatex book.tex
85
- mv pdf/book.pdf book.pdf
86
-
87
- texclean :
88
- rm -f nostarch/book.aux nostarch/book.idx nostarch/book.log nostarch/book.out nostarch/book.tbc nostarch/book.toc
89
- rm -f pdf/book.aux pdf/book.idx pdf/book.log pdf/book.out pdf/book.tbc pdf/book.toc
90
-
91
- TMPDIR =/tmp/ejs_tex
92
-
93
- ejs_tex.zip : nostarch/book.tex $(foreach CHAP,$(CHAPTERS ) ,nostarch/$(CHAP ) .tex) nostarch/hints.tex \
94
- $(patsubst img/%.svg,img/generated/%.pdf,$(SVGS))
95
- rm -rf $@ $(TMPDIR)
96
- mkdir -p $(TMPDIR)
97
- cp nostarch/*.tex $(TMPDIR)
98
- cp nostarch/book.tex $(TMPDIR)
99
- cp nostarch/build.sh nostarch/nostarch.cls nostarch/nshyper.sty nostarch/nostarch.ins $(TMPDIR)
100
- grep includegraphics nostarch/*.tex | sed -e 's/.*{\(.*\)}/\1/' | xargs -I{} cp --parents "{}" $(TMPDIR)
101
- cd /tmp; zip -r ejs_tex.zip ejs_tex
102
- mv /tmp/ejs_tex.zip $@
103
- rm -rf $(TMPDIR)
104
-
105
- book.epub : epub/titlepage.xhtml epub/toc.xhtml epub/hints.xhtml $(foreach CHAP,$(CHAPTERS ) ,epub/$(CHAP ) .xhtml) \
106
- epub/content.opf.src epub/style.css bin/add_images_to_epub.js
107
- rm -f $@
108
- grep ' <img' epub/* .xhtml | sed -e ' s/.*src="\([^"]*\)".*/\1/' | xargs -I{} cp --parents " {}" epub
109
- node bin/add_images_to_epub.js
110
- cd epub; zip -X ../$@ mimetype
111
- cd epub; zip -X ../$@ -r * -x mimetype -x content.opf.src
112
-
113
- epub/% .xhtml : % .txt asciidoc_epub.conf bin/pre_epub.js
114
- node bin/pre_epub.js $< | asciidoc -f asciidoc_epub.conf --backend=xhtml11 -o $@ -
115
-
116
- epub/hints.xhtml : $(foreach CHAP,$(CHAPTERS ) ,$(CHAP ) .txt) bin/extract_hints.js
117
- node bin/extract_hints.js | node bin/pre_epub.js - | asciidoc -f asciidoc_epub.conf --backend=xhtml11 -o $@ -
118
-
119
- epubcheck : book.epub
120
- epubcheck book.epub 2>&1 | grep -v ' img/.*\.svg'
121
-
122
- book.mobi : book.epub img/cover.png
123
- ebook-convert book.epub book.mobi --output-profile=kindle --cover=img/cover.png --remove-first-image
0 commit comments