-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (46 loc) · 1.84 KB
/
Copy pathMakefile
File metadata and controls
55 lines (46 loc) · 1.84 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
PHONY: github pudding docs docs-eval docs-data docs-clone docs-clean
github:
rm -rf docs
cp -r build docs
touch docs/.nojekyll
git add -A
git commit -m "update github pages"
git push
# ── Vendored docs (formulacode.org/docs/{eval,data}) ─────────────────────────
# Cloned repos live in _repos/ (gitignored) and the built site is mirrored
# into static/docs/{eval,data} (committed) so SvelteKit's static adapter
# publishes them under formulacode.org. Run `make docs` after pulling in
# upstream changes from the vendored repos.
REPOS_DIR := _repos
VENV_DOCS := .venv-docs
MKDOCS := $(VENV_DOCS)/bin/mkdocs
$(VENV_DOCS):
uv venv $(VENV_DOCS) --python 3.12
uv pip install --python $(VENV_DOCS)/bin/python \
mkdocs mkdocs-material 'mkdocstrings[python]' pymdown-extensions
docs-clone:
@mkdir -p $(REPOS_DIR)
@if [ ! -d $(REPOS_DIR)/fc-eval ]; then \
git clone --depth=1 https://github.com/formula-code/fc-eval.git $(REPOS_DIR)/fc-eval ; \
else \
git -C $(REPOS_DIR)/fc-eval pull --ff-only ; \
fi
@if [ ! -d $(REPOS_DIR)/datasmith ]; then \
git clone --depth=1 https://github.com/formula-code/datasmith.git $(REPOS_DIR)/datasmith ; \
else \
git -C $(REPOS_DIR)/datasmith pull --ff-only ; \
fi
docs-eval: $(VENV_DOCS) docs-clone
cd $(REPOS_DIR)/fc-eval && $(CURDIR)/$(MKDOCS) build --site-dir _site
rm -rf static/docs/eval
mkdir -p static/docs/eval
cp -R $(REPOS_DIR)/fc-eval/_site/. static/docs/eval/
docs-data: $(VENV_DOCS) docs-clone
cd $(REPOS_DIR)/datasmith && $(CURDIR)/$(MKDOCS) build --site-dir _site
rm -rf static/docs/data
mkdir -p static/docs/data
cp -R $(REPOS_DIR)/datasmith/_site/. static/docs/data/
docs: docs-eval docs-data
@echo "Built static/docs/{eval,data}. npm run build will pick them up."
docs-clean:
rm -rf $(REPOS_DIR) $(VENV_DOCS) static/docs