-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
78 lines (62 loc) · 2.64 KB
/
makefile
File metadata and controls
78 lines (62 loc) · 2.64 KB
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
77
78
DOCS.md: generate_docs.py README.md $(wildcard matthewplotlib/*.py)
python generate_docs.py \
README.md \
matthewplotlib/__init__.py \
matthewplotlib/plots.py \
matthewplotlib/colormaps.py \
matthewplotlib/core.py \
matthewplotlib/unscii16.py \
> $@
copy:
tail -n +1 pyproject.toml README.md matthewplotlib/*.py examples/*.py | pbcopy
# release:
# @test -n "$(V)" || (echo "Usage: make release V=0.3.7" && exit 1)
# sed -i 's/__version__ = ".*"/__version__ = "$(V)"/' matthewplotlib/__init__.py
# sed -i 's/^version = ".*"/version = "$(V)"/' pyproject.toml
# $(MAKE) DOCS.md
# git add matthewplotlib/__init__.py pyproject.toml DOCS.md CHANGELOG.md
# git commit -m "Version $(V)"
# git tag v$(V)
PDOC_CSS := $(shell python -c "import pdoc; from pathlib import Path; print(Path(pdoc.__file__).parent / 'templates')")
docs: docs/api docs/index.html docs/changelog.html docs/quickstart.html docs/examples.html docs/roadmap.html docs/images docs/pdoc.css
docs/api: templates/custom.css templates/module.html.jinja2 $(wildcard matthewplotlib/*.py)
pdoc matthewplotlib/ \
--no-show-source \
-e matthewplotlib=https://github.com/matomatical/matthewplotlib/blob/main/matthewplotlib/ \
-t templates/ \
-o docs/
@touch $@
docs/pdoc.css: templates/custom.css
cat $(PDOC_CSS)/resources/bootstrap-reboot.min.css \
$(PDOC_CSS)/syntax-highlighting.css \
$(PDOC_CSS)/theme.css \
$(PDOC_CSS)/layout.css \
$(PDOC_CSS)/content.css \
templates/custom.css > $@
GITHUB := https://github.com/matomatical/matthewplotlib/blob/main
docs/index.html: README.md templates/page.html docs/pdoc.css docs/api
pandoc README.md -o $@ --template=templates/page.html --wrap none \
--metadata title="Home" \
-V source="$(GITHUB)/README.md"
docs/changelog.html: CHANGELOG.md templates/page.html docs/pdoc.css
pandoc CHANGELOG.md -o $@ --template=templates/page.html --wrap none \
--metadata title="Changelog" \
-V source="$(GITHUB)/CHANGELOG.md"
docs/quickstart.html: pages/quickstart.md templates/page.html docs/pdoc.css
pandoc $< -o $@ --template=templates/page.html --wrap none \
--metadata title="Quickstart" \
-V source="$(GITHUB)/pages/quickstart.md"
docs/examples.html: pages/examples.md templates/page.html docs/pdoc.css
pandoc $< -o $@ --template=templates/page.html --wrap none \
--metadata title="Examples" \
-V source="$(GITHUB)/pages/examples.md"
docs/roadmap.html: pages/roadmap.md templates/page.html docs/pdoc.css
pandoc $< -o $@ --template=templates/page.html --wrap none \
--metadata title="Roadmap" \
-V source="$(GITHUB)/pages/roadmap.md"
docs/images: images
rm -rf $@
cp -r $< $@
test:
pytest tests/ -v
.PHONY: copy test docs # release