Skip to content

Commit b347428

Browse files
authored
chore: migrate api document generation to tool to crd-ref-docs (#5702)
* chore(docs): regenerate API reference documentation with new tool - Replace old API doc generation script with crd-ref-docs tool invocation - Update Makefile to download and use crd-ref-docs binary - Set crd-ref-docs tool version and local binary path in Makefile Signed-off-by: TzZtzt <trafalgarz@outlook.com> * minor fix Signed-off-by: TzZtzt <trafalgarz@outlook.com> --------- Signed-off-by: TzZtzt <trafalgarz@outlook.com>
1 parent 2b550e9 commit b347428

10 files changed

Lines changed: 5157 additions & 25635 deletions

File tree

Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ gen-sdk:
203203
./hack/sdk/gen-sdk.sh
204204

205205
.PHONY: update-api-doc
206-
update-api-doc:
207-
bash tools/api-doc-gen/generate_api_doc.sh && mv tools/api-doc-gen/api_doc.md docs/zh/dev/api_doc.md && cp docs/zh/dev/api_doc.md docs/en/dev/api_doc.md
206+
update-api-doc: crd-ref-docs
207+
./bin/crd-ref-docs --source-path=api --output-path=docs/zh/dev/api_doc.md --config=./tools/crd-ref-docs/config.yaml --renderer=markdown && cp docs/zh/dev/api_doc.md docs/en/dev/api_doc.md
208208

209209
# Build binary
210210
.PHONY: build
@@ -444,10 +444,12 @@ $(LOCALBIN):
444444
## Tool Binaries
445445
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
446446
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint
447+
CRD_REF_DOCS ?= $(LOCALBIN)/crd-ref-docs
447448

448449
## Tool Versions
449450
CONTROLLER_TOOLS_VERSION ?= v0.19.0
450451
GOLANGCI_LINT_VERSION ?= v1.64.8
452+
CRD_REF_DOCS_VERSION ?= v0.3.0
451453

452454
.PHONY: controller-gen
453455
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
@@ -459,6 +461,11 @@ golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
459461
$(GOLANGCI_LINT): $(LOCALBIN)
460462
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
461463

464+
.PHONY: crd-ref-docs
465+
crd-ref-docs: $(CRD_REF_DOCS) ## Download crd-ref-docs locally if necessary.
466+
$(CRD_REF_DOCS): $(LOCALBIN)
467+
$(call go-install-tool,$(CRD_REF_DOCS),github.com/elastic/crd-ref-docs,$(CRD_REF_DOCS_VERSION))
468+
462469
# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
463470
# $1 - target path with name of binary
464471
# $2 - package url which can be installed

0 commit comments

Comments
 (0)