Single-binary Go server that fetches markdown from Gitea (mc org), renders to HTML with goldmark (GFM, chroma syntax highlighting, heading anchors), and serves a navigable read-only documentation site. Features: - Boot fetch with retry, webhook refresh, 15-minute poll fallback - In-memory cache with atomic per-repo swap - chi router with htmx partial responses for SPA-like navigation - HMAC-SHA256 webhook validation - Responsive CSS, TOC generation, priority doc ordering - $PORT env var support for MCP agent port assignment 33 tests across config, cache, render, and server packages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
32 lines
705 B
Makefile
32 lines
705 B
Makefile
.PHONY: build test vet lint clean docker all devserver
|
|
|
|
LDFLAGS := -trimpath -ldflags="-s -w -X main.version=$(shell git describe --tags --always --dirty)"
|
|
|
|
mcdoc:
|
|
CGO_ENABLED=0 go build $(LDFLAGS) -o mcdoc ./cmd/mcdoc
|
|
|
|
build:
|
|
go build ./...
|
|
|
|
test:
|
|
go test ./...
|
|
|
|
vet:
|
|
go vet ./...
|
|
|
|
lint:
|
|
golangci-lint run ./...
|
|
|
|
clean:
|
|
rm -f mcdoc
|
|
|
|
docker:
|
|
docker build --build-arg VERSION=$(shell git describe --tags --always --dirty) -t mcdoc -f Dockerfile .
|
|
|
|
devserver: mcdoc
|
|
@mkdir -p srv
|
|
@if [ ! -f srv/mcdoc.toml ]; then cp deploy/examples/mcdoc.toml srv/mcdoc.toml; echo "Created srv/mcdoc.toml from example — edit before running."; fi
|
|
./mcdoc server --config srv/mcdoc.toml
|
|
|
|
all: vet lint test mcdoc
|