forked from alan-turing-institute/rse-course
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
129 lines (101 loc) · 3.3 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
PANDOC=pandoc
ROOT=""
PANDOCARGS=-t revealjs -s -V theme=night --css=http://lab.hakim.se/reveal-js/css/theme/night.css \
--css=$(ROOT)/css/ucl_reveal.css --css=$(ROOT)/site-styles/reveal.css \
--default-image-extension=png --highlight-style=zenburn --mathjax -V revealjs-url=http://lab.hakim.se/reveal-js
NOTEBOOKS=$(filter-out %.v2.ipynb %.nbconvert.ipynb,$(wildcard ch*/*.ipynb))
HTMLS=$(NOTEBOOKS:.ipynb=.html)
EXECUTED=$(NOTEBOOKS:.ipynb=.nbconvert.ipynb)
NBV2=$(NOTEBOOKS:.ipynb=.v2.ipynb)
default: _site
%/slides.html: %/*.md Makefile
cat $^ | $(PANDOC) $(PANDOCARGS) -o $@
%.png: %.py Makefile
python $< $@
%.png: %.nto Makefile
neato $< -T png -o $@
%.png: %.dot Makefile
dot $< -T png -o $@
%.png: %.uml Makefile
java -Djava.awt.headless=true -jar plantuml.jar -p < $< > $@
%.html: %.nbconvert.ipynb Makefile jekyll.tpl
jupyter nbconvert --to html --template jekyll.tpl --stdout $< > $@
%.v2.ipynb: %.nbconvert.ipynb
jupyter nbconvert --to notebook --nbformat 2 --stdout $< > $@
%.nbconvert.ipynb: %.ipynb
jupyter nbconvert --to notebook --allow-errors --ExecutePreprocessor.timeout=320 --execute --stdout $< > $@
notes.pdf: combined.ipynb Makefile
jupyter nbconvert --to pdf --template latex.tplx $<
mv combined.pdf notes.pdf
combined.ipynb: $(EXECUTED)
python nbmerge.py $^ $@
notes.tex: combined.ipynb Makefile
jupyter nbconvert --to latex --template latex.tplx $<
mv combined.tex notes.tex
notebooks.zip: ${NBV2}
zip -r notebooks $^
master.zip: Makefile
rm -f master.zip
wget https://github.com/Giovanni1085/indigo-jekyll/archive/master.zip
ready: indigo $(HTMLS) notebooks.zip
indigo-jekyll-master: Makefile master.zip
rm -rf indigo-jekyll-master
unzip master.zip
touch indigo-jekyll-master
indigo: indigo-jekyll-master Makefile
cp -r indigo-jekyll-master/indigo/images .
cp -r indigo-jekyll-master/indigo/img .
cp -r indigo-jekyll-master/indigo/js .
cp -r indigo-jekyll-master/indigo/css .
cp -r indigo-jekyll-master/indigo/ati_css .
cp -r indigo-jekyll-master/indigo/fonts .
cp -r indigo-jekyll-master/indigo/_includes .
cp -r indigo-jekyll-master/indigo/_layouts .
cp -r indigo-jekyll-master/indigo/favicon* .
touch indigo
plantuml.jar:
wget http://sourceforge.net/projects/plantuml/files/plantuml.jar/download -O plantuml.jar
.PHONY: ready
_site: ready
jekyll build --verbose
preview: ready
jekyll serve --verbose
clean:
rm -f ch*/generated/*.png
rm -rf ch*/*.html
rm -f ch*/*.pyc
rm -f index.html
rm -rf _site
rm -rf images img js css ati_css fonts _includes _layouts favicon* master.zip indigo-jekyll-master
rm -f indigo
rm -f ch01python/analyzer.py
rm -f ch01python/eight
rm -f ch01python/eight.py
rm -rf ch01python/module1/
rm -f ch01python/pretty.py
rm -f ch*/*.nbconvert.ipynb
rm -rf ch*/*.v2.ipynb
rm -rf combined*
rm -f notes.pdf
rm -f notes.tex
rm -f ch04packaging/greeter.py
rm -f ch04packaging/map.png
rm -f ch05construction/anotherfile.py
rm -f ch05construction/config.yaml
rm -f ch05construction/context.py
rm -f ch06design/fixed.png
rm -f ch07dry/datasource*.yaml
rm -f ch07dry/example.yaml
rm -f notebooks.zip
rm -rf ch09*/*.csv
rm -rf ch09*/*.hdf5
rm -rf ch09*/*.py
rm -rf ch09*/*.db
rm -rf ch09*/*.out
rm -rf ch09*/*.mol
rm -rf ch09*/*.tex
rm -rf ch09*/*.ttl
rm -rf ch09*/*.mko
rm -rf ch09*/*.xml
rm -rf ch09*/*.xsd
rm -rf ch09*/*.xsl