-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
49 lines (41 loc) · 1.91 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
.PHONY: conda format style types black test link check docs
.DEFAULT_GOAL = help
PYTHON = python
VERSION = 3.8
NAME = py_name
ROOT = ./
PIP = pip
CONDA = conda
SHELL = bash
ENV = src
HOST = 127.0.0.1
PORT = 3002
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_-] :.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
# JUPYTER NOTEBOOKS
notebooks_to_docs: ## Move notebooks to docs notebooks directory
@printf "\033[1;34mCreating notebook directory...\033[0m\n"
mkdir -p docs/notebooks
@printf "\033[1;34mRemoving old notebooks...\033[0m\n"
rm -rf docs/notebooks/*
@printf "\033[1;34mCopying Notebooks to directory...\033[0m\n"
rsync -zarv notebooks/ docs/notebooks/ --include="*.ipynb" --exclude="*.csv" --exclude=".ipynb_checkpoints/"
@printf "\033[1;34mDone!\033[0m\n"
jlab_html:
mkdir -p docs/notebooks
jupyter nbconvert notebooks/*.ipynb --to markdown --output-dir docs/notebooks/ --TagRemovePreprocessor.remove_cell_tags='{"remove_cell"}' --TagRemovePreprocessor.remove_input_tags='{"remove_input"}'
# DOCS
docs-build: ## Build site documentation with mkdocs
@printf "\033[1;34mCreating full documentation with mkdocs...\033[0m\n"
mkdocs build --config-file mkdocs.yml --clean --theme material --site-dir site/
@printf "\033[1;34mmkdocs completed!\033[0m\n\n"
docs-live: ## Build mkdocs documentation live
@printf "\033[1;34mStarting live docs with mkdocs...\033[0m\n"
mkdocs serve --dev-addr $(HOST):$(PORT) --theme material
docs-live-d: ## Build mkdocs documentation live (quicker reload)
@printf "\033[1;34mStarting live docs with mkdocs...\033[0m\n"
mkdocs serve --dev-addr $(HOST):$(PORT) --dirtyreload --theme material
docs-deploy: ## Deploy docs
@printf "\033[1;34mDeploying docs...\033[0m\n"
mkdocs gh-deploy
@printf "\033[1;34mSuccess...\033[0m\n"