-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmakefile
79 lines (57 loc) · 2.72 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
export PLOTLY_RENDERER=notebook_connected
MD_DIR_FSharp ?= fsharp
UNCONV_DIR_FSharp ?= unconverted/fsharp
IPYNB_DIR_FSharp ?= build/fsharp/ipynb
HTML_DIR_FSharp ?= build/fsharp
FAIL_DIR_FSharp ?= build/fsharp/failures
MD_FILES_FSharp := $(shell ls $(MD_DIR_FSharp)/*.md)
UNCONV_FILES_FSharp := $(shell ls $(UNCONV_DIR_FSharp)/*.md)
IPYNB_FILES_FSharp := $(patsubst $(MD_DIR_FSharp)/%.md,$(IPYNB_DIR_FSharp)/%.ipynb,$(MD_FILES_FSharp))
HTML_FILES_FSharp := $(patsubst $(MD_DIR_FSharp)/%.md,$(HTML_DIR_FSharp)/2019-07-03-%.html,$(MD_FILES_FSharp))
all: $(HTML_FILES_FSharp)
.PRECIOUS: $(IPYNB_FILES_FSharp)
$(IPYNB_DIR_FSharp)/.mapbox_token: $(MD_DIR_FSharp)/.mapbox_token
@mkdir -p $(IPYNB_DIR_FSharp)
@echo "[symlink] .mapbox_token"
@cd $(IPYNB_DIR_FSharp) && ln -s ../../$<
$(IPYNB_FILES_FSharp): $(IPYNB_DIR_FSharp)/.mapbox_token
$(IPYNB_DIR_FSharp)/%.ipynb: $(MD_DIR_FSharp)/%.md
@mkdir -p $(IPYNB_DIR_FSharp)
@echo "[jupytext] $<"
@cat $< what_about_dash.md | jupytext --to notebook --quiet --output $@
$(HTML_DIR_FSharp)/2019-07-03-%.html: $(IPYNB_DIR_FSharp)/%.ipynb
@mkdir -p $(HTML_DIR_FSharp)
@mkdir -p $(FAIL_DIR_FSharp)
@echo "[nbconvert] $<"
@jupyter nbconvert $< --to html --template nb.tpl \
--ExecutePreprocessor.timeout=600\
--output-dir $(HTML_DIR_FSharp) --output 2019-07-03-$*.html \
--execute > $(FAIL_DIR_FSharp)/$* 2>&1 && rm -f $(FAIL_DIR_FSharp)/$*
MD_DIR_CSharp ?= csharp
UNCONV_DIR_CSharp ?= unconverted/csharp
IPYNB_DIR_CSharp ?= build/csharp/ipynb
HTML_DIR_CSharp ?= build/csharp
FAIL_DIR_CSharp ?= build/csharp/failures
MD_FILES_CSharp := $(shell ls $(MD_DIR_CSharp)/*.md)
UNCONV_FILES_CSharp := $(shell ls $(UNCONV_DIR_CSharp)/*.md)
IPYNB_FILES_CSharp := $(patsubst $(MD_DIR_CSharp)/%.md,$(IPYNB_DIR_CSharp)/%.ipynb,$(MD_FILES_CSharp))
HTML_FILES_CSharp := $(patsubst $(MD_DIR_CSharp)/%.md,$(HTML_DIR_CSharp)/2019-08-03-%.html,$(MD_FILES_CSharp))
all: $(HTML_FILES_CSharp)
.PRECIOUS: $(IPYNB_FILES_CSharp)
$(IPYNB_DIR_CSharp)/.mapbox_token: $(MD_DIR_CSharp)/.mapbox_token
@mkdir -p $(IPYNB_DIR_CSharp)
@echo "[symlink] .mapbox_token"
@cd $(IPYNB_DIR_CSharp) && ln -s ../../$<
$(IPYNB_FILES_CSharp): $(IPYNB_DIR_CSharp)/.mapbox_token
$(IPYNB_DIR_CSharp)/%.ipynb: $(MD_DIR_CSharp)/%.md
@mkdir -p $(IPYNB_DIR_CSharp)
@echo "[jupytext] $<"
@cat $< what_about_dash.md | jupytext --to notebook --quiet --output $@
$(HTML_DIR_CSharp)/2019-08-03-%.html: $(IPYNB_DIR_CSharp)/%.ipynb
@mkdir -p $(HTML_DIR_CSharp)
@mkdir -p $(FAIL_DIR_CSharp)
@echo "[nbconvert] $<"
@jupyter nbconvert $< --to html --template nb.tpl \
--ExecutePreprocessor.timeout=600\
--output-dir $(HTML_DIR_CSharp) --output 2019-08-03-$*.html \
--execute > $(FAIL_DIR_CSharp)/$* 2>&1 && rm -f $(FAIL_DIR_CSharp)/$*