-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathMakefile
39 lines (31 loc) · 1.28 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
file_path := $(abspath $(lastword $(MAKEFILE_LIST)))
file_dir := $(dir $(file_path))
source_dir := $(file_dir)docs
build_dir := $(file_dir)public
.PHONY : docs clean clean_docs clean_notebooks copy_notebooks generate_docs copy_binary_outputs
# Remove all python generated files
clean:
-find . -name '*.py[co]' -exec rm {} +
-find . -name '__pycache__' -exec rm -rf {} +
# Remove all sphinx generated files
clean_docs:
-rm -rf ./public
-rm -rf ./docs/reference/api
# Remove any notebooks from docs
clean_notebooks:
-rm -rf ./docs/example_notebooks/notebooks
-jupyter nbconvert --clear-output --inplace example-notebooks/binary-classifier/*.ipynb
# Copy notebooks
copy_notebooks:
-mkdir ./docs/example_notebooks/notebooks
-cp -R ./example-notebooks/* ./docs/example_notebooks/notebooks
-rm -rf ./docs/example_notebooks/notebooks/binary-classifier/outputs
# Generate documentation
generate_docs:
cd docs; \
sphinx-build -W -b html $(source_dir) $(build_dir)
copy_binary_outputs:
-mkdir ./public/example_notebooks/notebooks/binary-classifier/outputs
-cp -r ./docs/example_notebooks/notebooks/binary-classifier/outputs/* ./public/example_notebooks/notebooks/binary-classifier/outputs/
# Put it all together
docs: clean clean_docs clean_notebooks copy_notebooks generate_docs copy_binary_outputs