-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
44 lines (34 loc) · 1.16 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
# Python Bits
VENV?=venv
.PHONY: venv
venv: ${VENV}
${VENV}:
@python3 -mvenv ${@}
@${VENV}/bin/pip install --upgrade pip setuptools wheel
@${VENV}/bin/pip install --upgrade --requirement requirements.txt
.PHONY: notebook
notebook:
@${VENV}/bin/jupyter-notebook
## Make Documentation
# Generate the README from the Jupyter Notebook.
README.md: README.ipynb
jupyter-nbconvert --ExecutePreprocessor.timeout=600 --execute --to markdown --output=${@} ${<}
.PHONY: clean.docs
clean.docs:
rm -rf docs
# All other documents.
IPYNB:=$(wildcard *.ipynb)
MD:=$(patsubst %.ipynb,docs/markdown/%.md,${IPYNB})
PDF:=$(patsubst %.ipynb,docs/pdf/%.pdf,${IPYNB})
HTML:=$(patsubst %.ipynb,docs/html/%.html,${IPYNB})
.PHONY: docs
docs: ${MD} ${PDF} ${HTML}
docs/markdown/%.md: %.ipynb
mkdir -p `dirname ${@}`
jupyter-nbconvert --ExecutePreprocessor.timeout=600 --execute --to markdown --output=${@} ${<}
docs/pdf/%.pdf: %.ipynb
mkdir -p `dirname ${@}`
-jupyter-nbconvert --ExecutePreprocessor.timeout=600 --execute --to pdf --output=${@} ${<}
docs/html/%.html: %.ipynb
mkdir -p `dirname ${@}`
jupyter-nbconvert --ExecutePreprocessor.timeout=600 --execute --to html --output=${@} ${<}