Skip to content

Commit c1339e7

Browse files
committed
Makefile: add docs rust related targets
1 parent 82220cf commit c1339e7

File tree

1 file changed

+36
-7
lines changed

1 file changed

+36
-7
lines changed

Makefile

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -309,25 +309,54 @@ docs-install: ## Install documentation dependencies
309309
@cd website && npm install
310310

311311
.PHONY: docs-build
312-
docs-build: docs-install ## Build the documentation website
313-
@echo "Building documentation website..."
312+
docs-build: docs-integrate-rust docs-install ## Build the documentation website with Rust API docs
313+
@echo "Building documentation website with Rust API documentation..."
314314
@cd website && npm run build
315315
@echo "Documentation built successfully!"
316316
@echo "Built files are in website/build/"
317317

318318
.PHONY: docs-serve
319-
docs-serve: docs-install ## Serve the documentation website locally
320-
@echo "Starting documentation server..."
319+
docs-serve: docs-integrate-rust docs-install ## Serve the documentation website locally with Rust API docs
320+
@echo "Starting documentation server with Rust API documentation..."
321321
@echo "Documentation will be available at: http://localhost:3000"
322322
@cd website && npm start
323323

324324
.PHONY: docs-build-serve
325-
docs-build-serve: docs-build ## Build and serve the documentation website locally
326-
@echo "Serving built documentation at: http://localhost:3000"
325+
docs-build-serve: docs-build ## Build and serve the documentation website locally with Rust API docs
326+
@echo "Serving built documentation with Rust API documentation at: http://localhost:3000"
327327
@cd website && npm run serve
328328

329+
.PHONY: docs-build-only
330+
docs-build-only: docs-install ## Build the documentation website without Rust API docs
331+
@echo "Building documentation website (without Rust API docs)..."
332+
@cd website && npm run build
333+
@echo "Documentation built successfully!"
334+
@echo "Built files are in website/build/"
335+
336+
.PHONY: docs-serve-only
337+
docs-serve-only: docs-install ## Serve the documentation website locally without Rust API docs
338+
@echo "Starting documentation server (without Rust API docs)..."
339+
@echo "Documentation will be available at: http://localhost:3000"
340+
@cd website && npm start
341+
342+
.PHONY: docs-rust
343+
docs-rust: ## Generate Rust API documentation
344+
@echo "Generating Rust API documentation..."
345+
@DATABASE_URL="sqlite::memory:" cargo doc --no-deps --document-private-items --workspace --exclude heartbeats-processor --lib --bins
346+
@echo "Rust documentation generated in target/doc/"
347+
@echo "Entry point: target/doc/index.html"
348+
349+
.PHONY: docs-integrate-rust
350+
docs-integrate-rust: docs-rust ## Integrate Rust API documentation into website
351+
@echo "Integrating Rust API documentation..."
352+
@mkdir -p website/static/api-docs
353+
@rm -rf website/static/api-docs/*
354+
@cp -r target/doc/* website/static/api-docs/
355+
@echo "Rust API documentation integrated into website/static/api-docs/"
356+
357+
329358
.PHONY: docs-clean
330359
docs-clean: ## Clean documentation build artifacts
331360
@echo "Cleaning documentation build artifacts..."
332-
@rm -rf website/build website/.docusaurus
361+
@rm -rf website/build website/.docusaurus website/static/api-docs target/doc
333362
@echo "Documentation artifacts cleaned!"

0 commit comments

Comments
 (0)