-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
50 lines (42 loc) · 1.93 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
SHELL := /bin/bash
.PHONY: help check autoformat notebook html clean
.DEFAULT: help
# Generates a useful overview/help message for various make features
help:
@echo "make check"
@echo " Run code style and linting (black, flake, isort) *without* changing files!"
@echo "make autoformat"
@echo " Run code styling (black, isort) and update in place - committing with pre-commit also does this."
@echo "make notebook"
@echo " Use jupytext-light to build a notebook (.ipynb) from the s4/s4.py script."
@echo "make html"
@echo " Use jupyter & jupytext to do the two-step conversion from the python script, to the HTML blog post."
@echo "make clean"
@echo " Delete the generated, top-level s4.ipynb notebook."
check:
isort --check s4/s4.py s4/data.py s4/train.py s4/sample.py
black --check s4/s4.py s4/data.py s4/train.py s4/sample.py
flake8 --show-source s4/s4.py s4/data.py s4/train.py s4/sample.py
autoformat:
isort --atomic s4/s4.py s4/data.py s4/train.py s4/sample.py
black s4/s4.py s4/data.py s4/train.py s4/sample.py
flake8 --show-source s4/s4.py s4/data.py s4/train.py s4/sample.py
notebook: s4/s4.py s4/dss.py s4/s4d.py
jupytext --to notebook s4/s4.py -o s4.ipynb
jupytext --to notebook s4/dss.py -o dss.ipynb
jupytext --to notebook s4/s4d.py -o s4d.ipynb
html: mamba.py
jupytext --to notebook s4/s4.py -o s4.ipynb
jupyter nbconvert --to html s4.ipynb
jupytext --to notebook s4/dss.py -o dss.ipynb
jupyter nbconvert --to html dss.ipynb
jupytext --to notebook s4/s4d.py -o s4d.ipynb
jupyter nbconvert --to html s4d.ipynb
md: Scan.ipynb
jupytext --to markdown Scan.ipynb
blog: Scan.md
pandoc docs/header-includes.yaml Scan.md --katex=/usr/share/javascript/katex/ --output=docs/index.html --to=html5 --css=docs/github.min.css --css=docs/tufte.css --css=docs/extra.css --no-highlight --self-contained --metadata pagetitle="Mamba: The Hard Way"
clean: s4.ipynb dss.ipynb s4d.ipynb
rm -f s4.ipynb
rm -f dss.ipynb
rm -f s4d.ipynb