-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathMakefile
40 lines (27 loc) · 1.08 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
INPUTS = $(wildcard *.py) $(wildcard */*.py)
OUTPUTS = $(patsubst %.py,%.ipynb,$(INPUTS))
TMP = $(patsubst %.py,%.out,$(INPUTS))
CHECKS = $(patsubst %.py,%.check.html,$(INPUTS))
SLIDES_IN = $(wildcard slides/*/*.md)
SLIDES = $(patsubst %.py,%.slides.html,$(SLIDES_IN))
SLIDES_PDF = $(patsubst %.py,%.slides.pdf,$(SLIDES_IN))
MOVIE_IN = $(wildcard slides.video/*/*.py)
MOVIE = $(patsubst %.py,%.slides.html,$(MOVIE_IN))
MOVIE_PDF = $(patsubst %.py,%.slides.pdf,$(MOVIE_IN))
all: $(OUTPUTS)
tmp: $(TMP)
slides: $(SLIDES)
slides_pdf: $(SLIDES_PDF)
movie: $(MOVIE)
movie_pdf: $(MOVIE_PDF)
checks: $(CHECKS)
%.ipynb : %.md
jupytext --execute --set-kernel minitorch --run-path . --from md --to notebook $<
%.slides.html : %.ipynb
jupyter nbconvert $< --to slides --ExecutePreprocessor.kernel_name minitorch --SlidesExporter.reveal_transition="none" --template slides/talk/ --SlidesExporter.reveal_url_prefix="https://unpkg.com/[email protected]"
%.slides.pdf : %.slides.html
decktape generic "http://0.0.0.0:8910/$<" $@
%.html : %.ipynb
jupyter nbconvert $< --to html
%.out : %.py
python $< > $@