This repository has been archived by the owner on Oct 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
66 lines (51 loc) · 1.47 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
NOTEBOOKS=$(filter-out %.v2.ipynb %.nbconvert.ipynb,$(wildcard 0?-*/*.ipynb))
HTMLS=$(NOTEBOOKS:.ipynb=.html)
EXECUTED=$(NOTEBOOKS:.ipynb=.nbconvert.ipynb)
NBV2=$(NOTEBOOKS:.ipynb=.v2.ipynb)
default: _site
%.html: %.nbconvert.ipynb Makefile jekyll.tpl
jupyter nbconvert --to html --template jekyll.tpl --stdout $< > $@
combined.ipynb: $(EXECUTED)
python nbmerge.py $^ $@
%.nbconvert.ipynb: %.ipynb
jupyter nbconvert --to notebook --allow-errors --ExecutePreprocessor.timeout=120 --execute --stdout $< > $@
%.v2.ipynb: %.nbconvert.ipynb
jupyter nbconvert --to notebook --nbformat 2 --stdout $< > $@
notes.pdf: combined.ipynb Makefile
jupyter nbconvert --to pdf --template latex.tplx $<
mv combined.pdf notes.pdf
notebooks.zip: ${NBV2}
zip -r notebooks $^ 01-beginner/data/*
.PHONY: ready
ready: $(HTMLS) notebooks.zip
_site: ready
jekyll build
preview: ready
jekyll serve
clean:
rm -rf *?-*/*.html
rm -f index.html
rm -rf _site
rm -rf 0?-*/*.nbconvert.ipynb
rm -rf 0?-*/*.v2.ipynb
rm -f notes.pdf
rm -rf combined*
rm -rf images js css _includes _layouts favicon*
rm -f 0?-*/boids_1.mp4
rm -f 0?-*/draw_eight.py
rm -f 0?-*/eight
rm -f 0?-*/eight.py
rm -rf 0?-*/greengraph/
rm -f 0?-*/maze.json
rm -f 0?-*/maze.yaml
rm -rf 0?-*/mazetool/
rm -f 0?-*/polynomials.svg
rm -f 0?-*/mydata.txt
rm -f 0?-*/my_file.json
rm -f 0?-*/my_file.yaml
rm -f 0?-*/mywrittenfile
rm -f 0?-*.zip
rm -f 0?-*/*.pyc
rm -rf 0?-*/maze
rm -rf 0?-*/data
rm -f 0?-*/sunspot_data.csv