forked from QuantEcon/lecture-source-jl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (61 loc) · 3.62 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
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS = -c "./"
SPHINXBUILD = python -msphinx
SPHINXPROJ = lecture-source-jl
SOURCEDIR = source/rst
BUILDDIR = _build
BUILDWEBSITE = _build/website
BUILDCOVERAGE = _build/coverage
BUILDPDF = _build/pdf
FILES =
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(FILES) $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Install requiremenets for building lectures.
setup:
pip install -r requirements.txt
preview:
ifneq (,$(filter $(target),website Website))
cd $(BUILDWEBSITE)/jupyter_html/ && python -m http.server
else
ifdef lecture
cd $(BUILDDIR)/jupyter/ && jupyter notebook $(basename $(lecture)).ipynb
else
cd $(BUILDDIR)/jupyter/ && jupyter notebook
endif
endif
clean-coverage:
rm -rf $(BUILDCOVERAGE)
clean-website:
rm -rf $(BUILDWEBSITE)
clean-pdf:
rm -rf $(BUILDDIR)/jupyterpdf
clean-constructor-pdf:
rm -rf $(BUILDPDF)
coverage:
ifneq ($(strip $(parallel)),)
@$(SPHINXBUILD) -M jupyter "$(SOURCEDIR)" "$(BUILDCOVERAGE)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_make_coverage=1 -D jupyter_execute_notebooks=1 -D jupyter_drop_tests=0 -D jupyter_ignore_skip_test=0 -D jupyter_template_coverage_file_path="error_report_template.html" -D jupyter_number_workers=$(parallel)
else
@$(SPHINXBUILD) -M jupyter "$(SOURCEDIR)" "$(BUILDCOVERAGE)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_make_coverage=1 -D jupyter_execute_notebooks=1 -D jupyter_drop_tests=0 -D jupyter_ignore_skip_test=0 -D jupyter_template_coverage_file_path="error_report_template.html"
endif
website:
ifneq ($(strip $(parallel)),)
@$(SPHINXBUILD) -M jupyter "$(SOURCEDIR)" "$(BUILDWEBSITE)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_make_site=1 -D jupyter_generate_html=1 -D jupyter_download_nb=1 -D jupyter_execute_notebooks=1 -D jupyter_target_html=1 -D jupyter_download_nb_image_urlpath="https://s3-ap-southeast-2.amazonaws.com/julia.quantecon.org/_static/" -D jupyter_images_markdown=0 -D jupyter_html_template="julia-html.tpl" -D jupyter_download_nb_urlpath="https://julia.quantecon.org/" -D jupyter_coverage_dir=$(BUILDCOVERAGE) -D jupyter_number_workers=$(parallel)
else
@$(SPHINXBUILD) -M jupyter "$(SOURCEDIR)" "$(BUILDWEBSITE)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_make_site=1 -D jupyter_generate_html=1 -D jupyter_download_nb=1 -D jupyter_execute_notebooks=1 -D jupyter_target_html=1 -D jupyter_download_nb_image_urlpath="https://s3-ap-southeast-2.amazonaws.com/julia.quantecon.org/_static/" -D jupyter_images_markdown=0 -D jupyter_html_template="julia-html.tpl" -D jupyter_download_nb_urlpath="https://julia.quantecon.org/" -D jupyter_coverage_dir=$(BUILDCOVERAGE)
endif
pdf:
ifneq ($(strip $(parallel)),)
@$(SPHINXBUILD) -M jupyterpdf "$(SOURCEDIR)" "$(BUILDDIR)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_latex_template="latex.tpl" -D jupyter_latex_template_book="latex_book.tpl" -D jupyter_images_markdown=1 -D jupyter_execute_notebooks=1 -D jupyter_pdf_book=1 -D jupyter_target_pdf=1 -D jupyter_number_workers=$(parallel)
else
@$(SPHINXBUILD) -M jupyterpdf "$(SOURCEDIR)" "$(BUILDDIR)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_latex_template="latex.tpl" -D jupyter_latex_template_book="latex_book.tpl" -D jupyter_images_markdown=1 -D jupyter_execute_notebooks=1 -D jupyter_pdf_book=1 -D jupyter_target_pdf=1
endif
notebooks:
make jupyter
# 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)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_allow_html_only=1