aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 15 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 2885ba3..151ba66 100644
--- a/Makefile
+++ b/Makefile
@@ -2,8 +2,9 @@ BINARY_NAME=metachan
BUILD_PATH=bin/$(BINARY_NAME)
MAIN_PATH=$(BINARY_NAME)/main.go
ENV_PATH=.env
+DOCS_PATH=docs
-.PHONY: setup clean build run dev all
+.PHONY: setup clean build run dev docs docs-serve all
define ensure_setup
@if [ ! -f $(ENV_PATH) ]; then \
@@ -41,6 +42,19 @@ dev:
@echo "Running in development mode..."
@go run $(MAIN_PATH) || true
+docs:
+ @echo "Generating API documentation..."
+ @command -v redocly >/dev/null 2>&1 || { echo "Redocly CLI not found. Install with: npm install -g @redocly/cli"; exit 1; }
+ @mkdir -p public
+ @redocly build-docs $(DOCS_PATH)/openapi.yaml --output public/index.html --title "Metachan API Documentation"
+ @echo "Documentation generated at public/index.html"
+ @echo "Open public/index.html in your browser to view"
+
+docs-serve: docs
+ @echo "Documentation server starting at http://localhost:8080"
+ @echo "Press Ctrl+C to stop"
+ @cd public && python3 -m http.server 8080
+
all: setup clean build run
.SILENT: \ No newline at end of file