Skip to content

Commit e4c6f08

Browse files
committed
docs: gen crd markdown file
Signed-off-by: ashing <[email protected]>
1 parent d07a2ec commit e4c6f08

File tree

4 files changed

+1013
-0
lines changed

4 files changed

+1013
-0
lines changed

Makefile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ GATEAY_API_VERSION ?= v1.2.0
1515
DASHBOARD_VERSION ?= dev
1616
TEST_TIMEOUT ?= 45m
1717

18+
# CRD Reference Documentation
19+
CRD_REF_DOCS_VERSION ?= v0.1.0
20+
CRD_REF_DOCS ?= $(LOCALBIN)/crd-ref-docs
21+
CRD_DOCS_CONFIG ?= docs/crd/config.yaml
22+
CRD_DOCS_OUTPUT ?= docs/crd/api.md
23+
1824
export KUBECONFIG = /tmp/$(KIND_NAME).kubeconfig
1925

2026
# go
@@ -346,3 +352,26 @@ helm-build-crds:
346352
sort-import:
347353
@./scripts/goimports-reviser.sh >/dev/null 2>&1
348354
.PHONY: sort-import
355+
356+
.PHONY: generate-crd-docs
357+
generate-crd-docs: manifests ## Generate CRD reference documentation in a single file
358+
@mkdir -p $(dir $(CRD_DOCS_OUTPUT))
359+
@echo "Generating CRD reference documentation"
360+
@$(CRD_REF_DOCS) \
361+
--source-path=./api \
362+
--config=$(CRD_DOCS_CONFIG) \
363+
--renderer=markdown \
364+
--output-path=$(CRD_DOCS_OUTPUT)
365+
@echo "CRD reference documentation generated at $(CRD_DOCS_OUTPUT)"
366+
367+
.PHONY: generate-crd-docs-grouped
368+
generate-crd-docs-grouped: manifests ## Generate CRD reference documentation grouped by API group
369+
@mkdir -p docs/crd/groups
370+
@echo "Generating CRD reference documentation (grouped by API)"
371+
@$(CRD_REF_DOCS) \
372+
--source-path=./api \
373+
--config=$(CRD_DOCS_CONFIG) \
374+
--renderer=markdown \
375+
--output-path=docs/crd/groups \
376+
--output-mode=group
377+
@echo "CRD reference documentation generated in docs/crd/groups directory"

0 commit comments

Comments
 (0)