Skip to content

Commit ea213ec

Browse files
committed
Makefile: allow a different port to serve the doc
1 parent 0341fff commit ea213ec

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

Makefile

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ NETWORK ?= devnet
3030
VERBOSITY ?= info
3131
GIT_COMMIT := $(shell git rev-parse --short=8 HEAD)
3232

33+
# Documentation server port
34+
DOCS_PORT ?= 3000
35+
3336
OPAM_PATH := $(shell command -v opam 2>/dev/null)
3437

3538
ifdef OPAM_PATH
@@ -41,6 +44,16 @@ endif
4144

4245
.PHONY: help
4346
help: ## Ask for help!
47+
@echo "Mina Rust Makefile - Common Variables:"
48+
@echo " DOCS_PORT=<port> Set documentation server port (default: 3000)"
49+
@echo " NETWORK=<network> Set network (default: devnet)"
50+
@echo " VERBOSITY=<level> Set logging verbosity (default: info)"
51+
@echo ""
52+
@echo "Examples:"
53+
@echo " make docs-serve DOCS_PORT=8080 # Start docs server on port 8080"
54+
@echo " make run-node NETWORK=mainnet # Run node on mainnet"
55+
@echo ""
56+
@echo "Available targets:"
4457
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
4558

4659
.PHONY: build
@@ -470,13 +483,13 @@ docs-build: docs-integrate-rust docs-install ## Build the documentation website
470483
.PHONY: docs-serve
471484
docs-serve: docs-integrate-rust docs-install ## Serve the documentation website locally with Rust API docs
472485
@echo "Starting documentation server with Rust API documentation..."
473-
@echo "Documentation will be available at: http://localhost:3000"
474-
@cd website && npm start
486+
@echo "Documentation will be available at: http://localhost:$(DOCS_PORT)"
487+
@cd website && npm start -- --port $(DOCS_PORT)
475488

476489
.PHONY: docs-build-serve
477490
docs-build-serve: docs-build ## Build and serve the documentation website locally with Rust API docs
478-
@echo "Serving built documentation with Rust API documentation at: http://localhost:3000"
479-
@cd website && npm run serve
491+
@echo "Serving built documentation with Rust API documentation at: http://localhost:$(DOCS_PORT)"
492+
@cd website && npm run serve -- --port $(DOCS_PORT)
480493

481494
.PHONY: docs-build-only
482495
docs-build-only: docs-install ## Build the documentation website without Rust API docs
@@ -488,8 +501,8 @@ docs-build-only: docs-install ## Build the documentation website without Rust AP
488501
.PHONY: docs-serve-only
489502
docs-serve-only: docs-install ## Serve the documentation website locally without Rust API docs
490503
@echo "Starting documentation server (without Rust API docs)..."
491-
@echo "Documentation will be available at: http://localhost:3000"
492-
@cd website && npm start
504+
@echo "Documentation will be available at: http://localhost:$(DOCS_PORT)"
505+
@cd website && npm start -- --port $(DOCS_PORT)
493506

494507
.PHONY: docs-rust
495508
docs-rust: ## Generate Rust API documentation

0 commit comments

Comments
 (0)