-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.doc
More file actions
107 lines (94 loc) · 3.92 KB
/
Makefile.doc
File metadata and controls
107 lines (94 loc) · 3.92 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
.PHONY: doc doc-open doc-serve help install-deps clean-doc test-doc
# Default target
help:
@echo "FloatWM Documentation Build System"
@echo ""
@echo "Available targets:"
@echo " make doc - Build rustdoc documentation"
@echo " make doc-open - Build and open documentation in browser"
@echo " make doc-serve - Serve documentation via HTTP (localhost:8000)"
@echo " make clean-doc - Remove generated documentation"
@echo " make test-doc - Run documentation tests"
@echo " make install-deps - Install documentation dependencies"
@echo ""
@echo "Examples:"
@echo " make doc"
@echo " make doc-open"
@echo " cargo doc --no-deps --open"
# Build documentation
doc:
@echo "Building FloatWM documentation..."
cargo doc --no-deps --all-features
@echo "Documentation built successfully!"
@echo "View with: make doc-open"
@echo "Or open: target/doc/floatwm/index.html"
# Build and open documentation in browser
doc-open: doc
@echo "Opening documentation in browser..."
@cargo doc --no-deps --all-features --open
# Serve documentation via simple HTTP server
doc-serve: doc
@echo "Starting documentation server at http://localhost:8000"
@echo "Press Ctrl+C to stop"
@cd target/doc && python3 -m http.server 8000 2>/dev/null || \
cd target/doc && python -m SimpleHTTPServer 8000 2>/dev/null || \
echo "Error: Python not found. Please install Python 3."
# Clean generated documentation
clean-doc:
@echo "Cleaning documentation..."
cargo clean --doc
@echo "Documentation cleaned"
# Run documentation tests (doctests)
test-doc:
@echo "Running documentation tests..."
cargo test --doc --all-features
@echo "Documentation tests completed"
# Install documentation dependencies
install-deps:
@echo "Installing documentation dependencies..."
@cargo install mdbook 2>/dev/null || echo "mdbook installation failed (optional)"
@cargo install cargo-deadlinks 2>/dev/null || echo "cargo-deadlinks installation failed (optional)"
@echo "Dependencies installed"
# Generate architecture diagram
ARCHITECTURE_DIAGRAM := docs/architecture.md
generate-diagram:
@echo "Generating architecture diagrams..."
@echo "# FloatWM Architecture" > $(ARCHITECTURE_DIAGRAM)
@echo "" >> $(ARCHITECTURE_DIAGRAM)
@echo "## Component Overview" >> $(ARCHITECTURE_DIAGRAM)
@echo "" >> $(ARCHITECTURE_DIAGRAM)
@echo "```mermaid" >> $(ARCHITECTURE_DIAGRAM)
@echo "graph TD" >> $(ARCHITECTURE_DIAGRAM)
@echo " A[FloatWM Main] --> B[X11 Connection]" >> $(ARCHITECTURE_DIAGRAM)
@echo " A --> C[Window Manager]" >> $(ARCHITECTURE_DIAGRAM)
@echo " A --> D[Focus Manager]" >> $(ARCHITECTURE_DIAGRAM)
@echo " A --> E[IPC Server]" >> $(ARCHITECTURE_DIAGRAM)
@echo " A --> F[Event Loop]" >> $(ARCHITECTURE_DIAGRAM)
@echo " F --> G[Keyboard Handler]" >> $(ARCHITECTURE_DIAGRAM)
@echo " F --> H[Mouse Handler]" >> $(ARCHITECTURE_DIAGRAM)
@echo " F --> I[Window Creator]" >> $(ARCHITECTURE_DIAGRAM)
@echo " A --> J[Monitor Manager]" >> $(ARCHITECTURE_DIAGRAM)
@echo " A --> K[Workspace Manager]" >> $(ARCHITECTURE_DIAGRAM)
@echo " A --> L[EWMH Manager]" >> $(ARCHITECTURE_DIAGRAM)
@echo "```" >> $(ARCHITECTURE_DIAGRAM)
@echo "Architecture diagram generated"
# Build all documentation (rustdoc + markdown)
build-all: doc generate-diagram
@echo "All documentation built"
# Verify documentation links (requires cargo-deadlinks)
verify-links: install-deps
@echo "Verifying documentation links..."
@cargo deadlinks --dir target/doc || echo "cargo-deadlinks not installed"
@echo "Link verification completed"
# Generate JSON API reference
api-json:
@echo "Generating API reference JSON..."
cargo doc --no-deps --all-features --document-private-items
@echo "API reference JSON generated"
# Check documentation coverage
doc-coverage:
@echo "Checking documentation coverage..."
@cargo doc --no-deps --all-features 2>&1 | grep -i warning || echo "No documentation warnings found"
# Serve as default if no target specified
.DEFAULT:
@$(MAKE) help