Skip to content

Commit 10f1288

Browse files
committed
Use crd-ref-docs for API reference documentation generation
similar to PR#563 for metal-operator this replaces outdated [`github.com/ahmetb/gen-crd-api-reference-docs`](https://github.com/ahmetb/gen-crd-api-reference-docs) (v0.3.0, last updated 2020) with [`github.com/elastic/crd-ref-docs`](https://github.com/elastic/crd-ref-docs) (v0.2.0). also removes obsolete templates, changes config format to yaml.
1 parent 901b4e7 commit 10f1288

File tree

7 files changed

+199
-856
lines changed

7 files changed

+199
-856
lines changed

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
190190
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint
191191
ADDLICENSE ?= $(LOCALBIN)/addlicense
192192
GOIMPORTS ?= $(LOCALBIN)/goimports
193-
GEN_CRD_API_REFERENCE_DOCS ?= $(LOCALBIN)/gen-crd-api-reference-docs
193+
CRD_REF_DOCS ?= $(LOCALBIN)/crd-ref-docs
194194
KUBEBUILDER ?= $(LOCALBIN)/kubebuilder
195195
SETUP_ENVTEST_VERSION ?= v0.17.1 # example pre-0.22
196196

@@ -204,7 +204,7 @@ ENVTEST_K8S_VERSION ?= $(shell go list -m -f "{{ .Version }}" k8s.io/api | awk -
204204
GOLANGCI_LINT_VERSION ?= v2.1
205205
ADDLICENSE_VERSION ?= v1.1.1
206206
GOIMPORTS_VERSION ?= v0.31.0
207-
GEN_CRD_API_REFERENCE_DOCS_VERSION ?= v0.3.0
207+
CRD_REF_DOCS_VERSION ?= v0.2.0
208208
KUBEBUILDER_VERSION ?= v4.5.1
209209

210210
.PHONY: kustomize
@@ -256,13 +256,13 @@ $(GOIMPORTS): $(LOCALBIN)
256256
$(call go-install-tool,$(GOIMPORTS),golang.org/x/tools/cmd/goimports,$(GOIMPORTS_VERSION))
257257

258258
.PHONY: docs
259-
docs: gen-crd-api-reference-docs ## Run go generate to generate API reference documentation.
260-
$(GEN_CRD_API_REFERENCE_DOCS) -api-dir ./api/v1alpha1 -config ./hack/api-reference/config.json -template-dir ./hack/api-reference/template -out-file ./docs/api-reference/api.md
259+
docs: crd-ref-docs ## Run go generate to generate API reference documentation.
260+
$(CRD_REF_DOCS) --source-path=./api/v1alpha1 --config=./hack/api-reference/config.yaml --renderer=markdown --output-path=./docs/api-reference/api.md
261261

262-
.PHONY: gen-crd-api-reference-docs
263-
gen-crd-api-reference-docs: $(GEN_CRD_API_REFERENCE_DOCS) ## Download gen-crd-api-reference-docs locally if necessary.
264-
$(GEN_CRD_API_REFERENCE_DOCS): $(LOCALBIN)
265-
$(call go-install-tool,$(GEN_CRD_API_REFERENCE_DOCS),github.com/ahmetb/gen-crd-api-reference-docs,$(GEN_CRD_API_REFERENCE_DOCS_VERSION))
262+
.PHONY: crd-ref-docs
263+
crd-ref-docs: $(CRD_REF_DOCS) ## Download crd-ref-docs locally if necessary.
264+
$(CRD_REF_DOCS): $(LOCALBIN)
265+
$(call go-install-tool,$(CRD_REF_DOCS),github.com/elastic/crd-ref-docs,$(CRD_REF_DOCS_VERSION))
266266

267267
.PHONY: kubebuilder
268268
kubebuilder: $(KUBEBUILDER) ## Download kubebuilder locally if necessary.

0 commit comments

Comments
 (0)