Makefile 1017 Bytes
Newer Older
Lianmin Zheng's avatar
Lianmin Zheng committed
1
2
3
# Minimal makefile for Sphinx documentation
#

Chayenne's avatar
Chayenne committed
4
# You can set these variables from the terminal, and also
Lianmin Zheng's avatar
Lianmin Zheng committed
5
6
7
8
9
10
11
12
13
14
# from the environment for the first two.
SPHINXOPTS    ?=
SPHINXBUILD   ?= sphinx-build
SOURCEDIR     = .
BUILDDIR      = _build

# Put it first so that "make" without argument is like "make help".
help:
	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

Chayenne's avatar
Chayenne committed
15
16
17
18
19
20
21
22
23
24
25
26
# New target to compile Markdown and Jupyter Notebook files
compile:
	find $(SOURCEDIR) -name '*.ipynb' | while read nb; do \
		if [ -f "$$nb" ]; then \
			echo "Executing $$nb"; \
			jupyter nbconvert --to notebook --execute --inplace "$$nb" \
				--ExecutePreprocessor.timeout=600 \
				--ExecutePreprocessor.kernel_name=python3; \
		fi; \
	done

.PHONY: help Makefile compile
Lianmin Zheng's avatar
Lianmin Zheng committed
27
28
29
30
31
32
33
34

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

clean:
	rm -rf $(BUILDDIR)/*