-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathMakefile
85 lines (71 loc) · 2.48 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
F=thinkjava
.PHONY: trinket
all:
pdflatex $(F)
makeindex $(F).idx # shouldn't need .idx here, but we do
pdflatex $(F)
pdflatex $(F)
clean:
rm -f $(F).aux $(F).idx $(F).ilg $(F).ind $(F).log $(F).out $(F).toc
plastex:
# Before running plastex, we need the current directory in PYTHONPATH
# export PYTHONPATH=$PYTHONPATH:.
python preprocess.py $(F).tex > $(F).plastex
plastex --renderer=DocBook --theme=book --image-resolution=300 --filename=$(F).xml $(F).plastex
cd $(F); python ../postprocess.py $(F).xml > temp; mv temp $(F).xml
xxe:
xmlcopyeditor ~/ThinkJava/$(F)/$(F).xml &
lint:
xmllint -noout $(F)/$(F).xml
oreilly:
rsync -a thinkjava/thinkjava.xml atlas
rsync -a figs/*.pdf atlas/figs/
rsync -a figs/*.png atlas/figs/
cd atlas; git add thinkjava.xml figs/*
cd atlas; git commit -m "Automated check in."
cd atlas; git push
# a bug (in ocaml?) causes "make hevea" to fail; use "make -i hevea" instead
hevea: thinkjava.tex header.html footer.html
cp $(F).tex $(F)6.tex
rm -rf html
mkdir html
hevea -O -exec xxdate.exe -e latexonly htmlonly $(F)6
hevea -O -exec xxdate.exe -e latexonly htmlonly $(F)6
imagen -png -pdf $(F)6
imagen -png -pdf $(F)6
hacha $(F)6.html
cp up.png next.png back.png html
mv index.html $(F)6.css $(F)6?*.html $(F)6*.png html
rm *motif.gif $(F)6.*
DEST = /home/downey/public_html/greent/thinkjava6
distrib:
rm -rf dist
mkdir dist
rsync -a $(F).pdf html dist
rsync -a dist/* $(DEST)
chmod -R o+r $(DEST)/*
cd $(DEST)/..; sh back
# a bug (in ocaml?) causes "make trinket" to fail; use "make -i trinket" instead
trinket:
cp $(F).tex $(F)6.tex
rm -rf trinkethtml
mkdir trinkethtml
hevea -O -exec xxdate.exe -e latexonly trinket/trinket.tex $(F)6
hevea -O -exec xxdate.exe -e latexonly trinket/trinket.tex $(F)6
imagen -png -pdf $(F)6
imagen -png -pdf $(F)6
hacha $(F)6.html
cp trinket/*.css trinket/*.js trinkethtml
mv index.html $(F)6.css $(F)6?*.html $(F)6*.png trinkethtml
rm *motif.gif $(F)6.*
# perl postprocessing (woot) seems easier than escaping through Latex and Hevea
perl -i -pe 's/100\\%/100%/g' trinkethtml/*.html
perl -i -pe 's/\[\[\[\[\s?(\S*?)\s?\]\]\]\]/----{\1}----/g' trinkethtml/*.html
perl -i -pe 's/\<a .*? ALT\=\"(Previous|Up|Next)\"\>\<\/a\>//g' trinkethtml/*.html
perl -0777 -i -pe 's/\<hr\>//' trinkethtml/*.html
# Produce nunjucks templates for our app
mkdir trinkethtml/nunjucks
python trinket/maketemplates.py
# Gather images for ease of uploading to CDN
mkdir trinkethtml/img
cp trinkethtml/*.png trinkethtml/img