-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (61 loc) · 2.37 KB
/
Makefile
File metadata and controls
73 lines (61 loc) · 2.37 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
# Documentation Makefile for MkDocs
DOCS_DIR = .
SITE_DIR = site
.PHONY: sync serve serve-dev build clean update-deps config get-deps validate new-page help
# Sync and install Python dependencies
sync:
@echo "Syncing documentation dependencies..."
@cd $(DOCS_DIR) && uv sync
# Update Python dependencies to their latest versions
update-deps:
@echo "Updating documentation dependencies..."
@cd $(DOCS_DIR) && uv sync --upgrade
# Serve documentation locally
serve: sync
@echo "Starting documentation server..."
@cd $(DOCS_DIR) && uv run mkdocs serve
# Serve documentation on all interfaces (useful for Docker/VMs)
serve-dev: sync
@echo "Starting documentation server on 0.0.0.0:8000..."
@cd $(DOCS_DIR) && uv run mkdocs serve --dev-addr=0.0.0.0:8000
# Build static documentation
build: sync
@echo "Building documentation..."
@cd $(DOCS_DIR) && uv run mkdocs build
# Clean generated files
clean:
@echo "Cleaning documentation build..."
@cd $(DOCS_DIR) && rm -rf $(SITE_DIR)
# Show configuration
config: sync
@cd $(DOCS_DIR) && uv run mkdocs config --quiet
# Show required dependencies from plugins
get-deps: sync
@cd $(DOCS_DIR) && uv run mkdocs get-deps
# Validate documentation (strict mode)
validate: sync
@echo "Validating documentation with strict mode..."
@cd $(DOCS_DIR) && uv run mkdocs build --strict --quiet
# Create new page (usage: make new-page PAGE=path/to/page.md)
new-page:
@if [ -z "$(PAGE)" ]; then \
echo "Usage: make new-page PAGE=path/to/page.md"; \
exit 1; \
fi
@mkdir -p $(DOCS_DIR)/content/$$(dirname $(PAGE))
@touch $(DOCS_DIR)/content/$(PAGE)
@echo "# $$(basename $$(basename $(PAGE)))" > $(DOCS_DIR)/content/$(PAGE)
@echo "Created new page: $(DOCS_DIR)/content/$(PAGE)"
help:
@echo "Documentation targets:"
@echo " sync - Sync and install Python dependencies"
@echo " update-deps - Update Python dependencies (--upgrade)"
@echo " serve - Serve docs locally (auto-syncs first)"
@echo " serve-dev - Serve docs on 0.0.0.0:8000 (auto-syncs first)"
@echo " build - Build static docs (auto-syncs first)"
@echo " clean - Clean build files"
@echo " config - Show MkDocs config"
@echo " get-deps - Show required PyPI packages from plugins"
@echo " validate - Validate docs with strict mode"
@echo " new-page - Create new page (PAGE=path/to/page.md)"
@echo " help - Show this help"