1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-05 15:37:19 +00:00

(docs) changed docs tool to kubernetes-sigs/reference-docs (#9212)

* (docs) updated gen-crd tool to reference-docs/genref

Signed-off-by: Srikanth Iyengar <ksrikanth3012@gmail.com>

* (docs) updated branch with recent docs

Signed-off-by: Srikanth Iyengar <ksrikanth3012@gmail.com>

* codegen

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* codegen

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* codegen

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* (docs) codegen

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* codegen

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Srikanth Iyengar <ksrikanth3012@gmail.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
This commit is contained in:
Srikanth Iyengar 2024-02-04 18:27:00 +05:30 committed by GitHub
parent 204d061a93
commit 63b03a8442
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 20683 additions and 4 deletions

View file

@ -48,6 +48,8 @@ APPLYCONFIGURATION_GEN ?= $(TOOLS_DIR)/applyconfiguration-gen
CODE_GEN_VERSION ?= v0.28.0 CODE_GEN_VERSION ?= v0.28.0
GEN_CRD_API_REFERENCE_DOCS ?= $(TOOLS_DIR)/gen-crd-api-reference-docs GEN_CRD_API_REFERENCE_DOCS ?= $(TOOLS_DIR)/gen-crd-api-reference-docs
GEN_CRD_API_REFERENCE_DOCS_VERSION ?= latest GEN_CRD_API_REFERENCE_DOCS_VERSION ?= latest
GENREF ?= $(TOOLS_DIR)/genref
GENREF_VERSION ?= master
GO_ACC ?= $(TOOLS_DIR)/go-acc GO_ACC ?= $(TOOLS_DIR)/go-acc
GO_ACC_VERSION ?= latest GO_ACC_VERSION ?= latest
GOIMPORTS ?= $(TOOLS_DIR)/goimports GOIMPORTS ?= $(TOOLS_DIR)/goimports
@ -59,7 +61,7 @@ HELM_DOCS_VERSION ?= v1.11.0
KO ?= $(TOOLS_DIR)/ko KO ?= $(TOOLS_DIR)/ko
KO_VERSION ?= v0.14.1 KO_VERSION ?= v0.14.1
KUBE_VERSION ?= v1.25.0 KUBE_VERSION ?= v1.25.0
TOOLS := $(KIND) $(CONTROLLER_GEN) $(CLIENT_GEN) $(LISTER_GEN) $(INFORMER_GEN) $(OPENAPI_GEN) $(REGISTER_GEN) $(DEEPCOPY_GEN) $(DEFAULTER_GEN) $(APPLYCONFIGURATION_GEN) $(GEN_CRD_API_REFERENCE_DOCS) $(GO_ACC) $(GOIMPORTS) $(HELM) $(HELM_DOCS) $(KO) TOOLS := $(KIND) $(CONTROLLER_GEN) $(CLIENT_GEN) $(LISTER_GEN) $(INFORMER_GEN) $(OPENAPI_GEN) $(REGISTER_GEN) $(DEEPCOPY_GEN) $(DEFAULTER_GEN) $(APPLYCONFIGURATION_GEN) $(GEN_CRD_API_REFERENCE_DOCS) $(GENREF) $(GO_ACC) $(GOIMPORTS) $(HELM) $(HELM_DOCS) $(KO)
ifeq ($(GOOS), darwin) ifeq ($(GOOS), darwin)
SED := gsed SED := gsed
else else
@ -111,6 +113,10 @@ $(GEN_CRD_API_REFERENCE_DOCS):
@echo Install gen-crd-api-reference-docs... >&2 @echo Install gen-crd-api-reference-docs... >&2
@GOBIN=$(TOOLS_DIR) go install github.com/ahmetb/gen-crd-api-reference-docs@$(GEN_CRD_API_REFERENCE_DOCS_VERSION) @GOBIN=$(TOOLS_DIR) go install github.com/ahmetb/gen-crd-api-reference-docs@$(GEN_CRD_API_REFERENCE_DOCS_VERSION)
$(GENREF):
@echo Install genref... >&2
@GOBIN=$(TOOLS_DIR) go install github.com/kubernetes-sigs/reference-docs/genref@$(GENREF_VERSION)
$(GO_ACC): $(GO_ACC):
@echo Install go-acc... >&2 @echo Install go-acc... >&2
@GOBIN=$(TOOLS_DIR) go install github.com/ory/go-acc@$(GO_ACC_VERSION) @GOBIN=$(TOOLS_DIR) go install github.com/ory/go-acc@$(GO_ACC_VERSION)
@ -520,7 +526,7 @@ codegen-helm-docs: ## Generate helm docs
@docker run -v ${PWD}/charts:/work -w /work jnorwood/helm-docs:v1.11.0 -s file @docker run -v ${PWD}/charts:/work -w /work jnorwood/helm-docs:v1.11.0 -s file
.PHONY: codegen-api-docs .PHONY: codegen-api-docs
codegen-api-docs: $(PACKAGE_SHIM) $(GEN_CRD_API_REFERENCE_DOCS) ## Generate API docs codegen-api-docs: $(PACKAGE_SHIM) $(GEN_CRD_API_REFERENCE_DOCS) $(GENREF) ## Generate API docs
@echo Generate api docs... >&2 @echo Generate api docs... >&2
@rm -rf docs/user/crd && mkdir -p docs/user/crd @rm -rf docs/user/crd && mkdir -p docs/user/crd
@GOPATH=$(GOPATH_SHIM) $(GEN_CRD_API_REFERENCE_DOCS) -v 4 \ @GOPATH=$(GOPATH_SHIM) $(GEN_CRD_API_REFERENCE_DOCS) -v 4 \
@ -528,9 +534,13 @@ codegen-api-docs: $(PACKAGE_SHIM) $(GEN_CRD_API_REFERENCE_DOCS) ## Generate API
-config docs/user/config.json \ -config docs/user/config.json \
-template-dir docs/user/template \ -template-dir docs/user/template \
-out-file docs/user/crd/index.html -out-file docs/user/crd/index.html
@cd ./docs/user && GOPATH=$(GOPATH_SHIM) $(GENREF) \
-c config-api.yaml \
-o crd \
-f html
.PHONY: codegen-cli-api-docs .PHONY: codegen-cli-api-docs
codegen-cli-api-docs: $(PACKAGE_SHIM) $(GEN_CRD_API_REFERENCE_DOCS) ## Generate CLI API docs codegen-cli-api-docs: $(PACKAGE_SHIM) $(GEN_CRD_API_REFERENCE_DOCS) $(GENREF) ## Generate CLI API docs
@echo Generate CLI api docs... >&2 @echo Generate CLI api docs... >&2
@rm -rf docs/user/cli/crd && mkdir -p docs/user/cli/crd @rm -rf docs/user/cli/crd && mkdir -p docs/user/cli/crd
@GOPATH=$(GOPATH_SHIM) $(GEN_CRD_API_REFERENCE_DOCS) -v 4 \ @GOPATH=$(GOPATH_SHIM) $(GEN_CRD_API_REFERENCE_DOCS) -v 4 \
@ -538,6 +548,10 @@ codegen-cli-api-docs: $(PACKAGE_SHIM) $(GEN_CRD_API_REFERENCE_DOCS) ## Generate
-config docs/user/config.json \ -config docs/user/config.json \
-template-dir docs/user/template \ -template-dir docs/user/template \
-out-file docs/user/cli/crd/index.html -out-file docs/user/cli/crd/index.html
@cd ./docs/user && GOPATH=$(GOPATH_SHIM) $(GENREF) \
-c config-cli-api.yaml \
-o cli/crd \
-f html
.PHONY: codegen-cli-docs .PHONY: codegen-cli-docs
codegen-cli-docs: $(CLI_BIN) ## Generate CLI docs codegen-cli-docs: $(CLI_BIN) ## Generate CLI docs
@ -555,7 +569,7 @@ codegen-cli-crds: codegen-crds-kyverno ## Copy generated CRDs to embed in the CL
@cp cmd/cli/kubectl-kyverno/config/crds/* cmd/cli/kubectl-kyverno/data/crds @cp cmd/cli/kubectl-kyverno/config/crds/* cmd/cli/kubectl-kyverno/data/crds
.PHONY: codegen-docs-all .PHONY: codegen-docs-all
codegen-docs-all: codegen-helm-docs codegen-cli-docs codegen-api-docs ## Generate all docs codegen-docs-all: codegen-helm-docs codegen-cli-docs codegen-api-docs codegen-cli-api-docs ## Generate all docs
.PHONY: codegen-fix-tests .PHONY: codegen-fix-tests
codegen-fix-tests: $(CLI_BIN) ## Fix CLI test files codegen-fix-tests: $(CLI_BIN) ## Fix CLI test files

File diff suppressed because it is too large Load diff

54
docs/user/config-api.yaml Normal file
View file

@ -0,0 +1,54 @@
hiddenMemberFields:
- "TypeMeta"
externalPackages:
- match: ^k8s\\.io/apimachinery/pkg/apis/meta/v1\\.Duration$
target: https://godoc.org/k8s.io/apimachinery/pkg/apis/meta/v1#Duration
- match: ^k8s\\.io/(api|apimachinery|apiextensions-apiserver/pkg/apis)/
target: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#{{lower .TypeIdentifier}}-{{arrIndex .PackageSegments -1}}-{{arrIndex .PackageSegments -2}}
- match: ^github\\.com/knative/pkg/apis/duck/
target: https://godoc.org/github.com/knative/pkg/apis/duck/{{arrIndex .PackageSegments -1}}#{{.TypeIdentifier}}
hideTypePatterns:
- "ParseError$"
- "List$"
markdownDisabled: false
stripPrefix:
- k8s.io/api/
- k8s.io/apimachinery/pkg/apis/
- github.com/tengqm/kubeconfig/config/kubeadm/v1beta2.
- github.com/tengqm/kubeconfig/config/kubeadm/v1beta3.
- github.com/tengqm/kubeconfig/config/bootstraptoken/v1.
apis:
- name: kyverno
title: kyverno (v1)
package: github.com/kyverno/kyverno
path: api/kyverno/v1
- name: kyverno
title: kyverno (v1alpha2)
package: github.com/kyverno/kyverno
path: api/kyverno/v1alpha2
- name: kyverno
title: kyverno (v2alpha1)
package: github.com/kyverno/kyverno
path: api/kyverno/v2alpha1
- name: kyverno
title: kyverno (v1beta1)
package: github.com/kyverno/kyverno
path: api/kyverno/v1beta1
- name: kyverno
title: kyverno (v2beta1)
package: github.com/kyverno/kyverno
path: api/kyverno/v2beta1
- name: kyverno_policyreport
title: kyverno policy report (v1alpha2)
package: github.com/kyverno/kyverno
path: api/policyreport/v1alpha2

View file

@ -0,0 +1,29 @@
hiddenMemberFields:
- "TypeMeta"
externalPackages:
- match: ^k8s\\.io/apimachinery/pkg/apis/meta/v1\\.Duration$
target: https://godoc.org/k8s.io/apimachinery/pkg/apis/meta/v1#Duration
- match: ^k8s\\.io/(api|apimachinery|apiextensions-apiserver/pkg/apis)/
target: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#{{lower .TypeIdentifier}}-{{arrIndex .PackageSegments -1}}-{{arrIndex .PackageSegments -2}}
- match: ^github\\.com/knative/pkg/apis/duck/
target: https://godoc.org/github.com/knative/pkg/apis/duck/{{arrIndex .PackageSegments -1}}#{{.TypeIdentifier}}
hideTypePatterns:
- "ParseError$"
- "List$"
markdownDisabled: false
stripPrefix:
- k8s.io/api/
- k8s.io/apimachinery/pkg/apis/
- github.com/tengqm/kubeconfig/config/kubeadm/v1beta2.
- github.com/tengqm/kubeconfig/config/kubeadm/v1beta3.
- github.com/tengqm/kubeconfig/config/bootstraptoken/v1.
apis:
- name: kyverno_kubectl
title: cli (v1alpha1)
package: github.com/kyverno/kyverno
path: cmd/cli/kubectl-kyverno/apis/v1alpha1

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,771 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<style>
.bg-blue {
color: #ffffff;
background-color: #1589dd;
}
</style>
</head>
<body>
<div class="container">
<h2 id="kyverno-io-v1alpha2">Package: <span style="font-family: monospace">kyverno.io/v1alpha2</span></h2>
<p><p>Package v1alpha2 contains API Schema definitions for the policy v1alpha2 API group</p>
</p>
<h3>Resource Types:</h3>
<ul><li>
<a href="#kyverno-io-v1alpha2-AdmissionReport">AdmissionReport</a>
</li><li>
<a href="#kyverno-io-v1alpha2-BackgroundScanReport">BackgroundScanReport</a>
</li><li>
<a href="#kyverno-io-v1alpha2-ClusterAdmissionReport">ClusterAdmissionReport</a>
</li><li>
<a href="#kyverno-io-v1alpha2-ClusterBackgroundScanReport">ClusterBackgroundScanReport</a>
</li></ul>
<H3 id="kyverno-io-v1alpha2-AdmissionReport">AdmissionReport
</H3>
<p><p>AdmissionReport is the Schema for the AdmissionReports API</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>apiVersion</code></br>string</td>
<td><code>kyverno.io/v1alpha2</code></td>
</tr>
<tr>
<td><code>kind</code></br>string</td>
<td><code>AdmissionReport</code></td>
</tr>
<tr>
<td><code>metadata</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">meta/v1.ObjectMeta</span>
</td>
<td>
Refer to the Kubernetes API documentation for the fields of the
<code>metadata</code> field.
</td>
</tr>
<tr>
<td><code>spec</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">github.com/kyverno/kyverno/api/kyverno/v2.AdmissionReportSpec</span>
</td>
<td>
<br/>
<br/>
<table>
<tr>
<td><code>owner</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">meta/v1.OwnerReference</span>
</td>
<td>
<p>Owner is a reference to the report owner (e.g. a Deployment, Namespace, or Node)</p>
</td>
</tr>
<tr>
<td><code>summary</code>
</br>
<span style="font-family: monospace">github.com/kyverno/kyverno/api/policyreport/v1alpha2.PolicyReportSummary</span>
</td>
<td>
<p>PolicyReportSummary provides a summary of results</p>
</td>
</tr>
<tr>
<td><code>results</code>
</br>
<span style="font-family: monospace">[]github.com/kyverno/kyverno/api/policyreport/v1alpha2.PolicyReportResult</span>
</td>
<td>
<p>PolicyReportResult provides result details</p>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<H3 id="kyverno-io-v1alpha2-BackgroundScanReport">BackgroundScanReport
</H3>
<p><p>BackgroundScanReport is the Schema for the BackgroundScanReports API</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>apiVersion</code></br>string</td>
<td><code>kyverno.io/v1alpha2</code></td>
</tr>
<tr>
<td><code>kind</code></br>string</td>
<td><code>BackgroundScanReport</code></td>
</tr>
<tr>
<td><code>metadata</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">meta/v1.ObjectMeta</span>
</td>
<td>
Refer to the Kubernetes API documentation for the fields of the
<code>metadata</code> field.
</td>
</tr>
<tr>
<td><code>spec</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">github.com/kyverno/kyverno/api/kyverno/v2.BackgroundScanReportSpec</span>
</td>
<td>
<br/>
<br/>
<table>
<tr>
<td><code>summary</code>
</br>
<span style="font-family: monospace">github.com/kyverno/kyverno/api/policyreport/v1alpha2.PolicyReportSummary</span>
</td>
<td>
<p>PolicyReportSummary provides a summary of results</p>
</td>
</tr>
<tr>
<td><code>results</code>
</br>
<span style="font-family: monospace">[]github.com/kyverno/kyverno/api/policyreport/v1alpha2.PolicyReportResult</span>
</td>
<td>
<p>PolicyReportResult provides result details</p>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<H3 id="kyverno-io-v1alpha2-ClusterAdmissionReport">ClusterAdmissionReport
</H3>
<p><p>ClusterAdmissionReport is the Schema for the ClusterAdmissionReports API</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>apiVersion</code></br>string</td>
<td><code>kyverno.io/v1alpha2</code></td>
</tr>
<tr>
<td><code>kind</code></br>string</td>
<td><code>ClusterAdmissionReport</code></td>
</tr>
<tr>
<td><code>metadata</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">meta/v1.ObjectMeta</span>
</td>
<td>
Refer to the Kubernetes API documentation for the fields of the
<code>metadata</code> field.
</td>
</tr>
<tr>
<td><code>spec</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">github.com/kyverno/kyverno/api/kyverno/v2.AdmissionReportSpec</span>
</td>
<td>
<br/>
<br/>
<table>
<tr>
<td><code>owner</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">meta/v1.OwnerReference</span>
</td>
<td>
<p>Owner is a reference to the report owner (e.g. a Deployment, Namespace, or Node)</p>
</td>
</tr>
<tr>
<td><code>summary</code>
</br>
<span style="font-family: monospace">github.com/kyverno/kyverno/api/policyreport/v1alpha2.PolicyReportSummary</span>
</td>
<td>
<p>PolicyReportSummary provides a summary of results</p>
</td>
</tr>
<tr>
<td><code>results</code>
</br>
<span style="font-family: monospace">[]github.com/kyverno/kyverno/api/policyreport/v1alpha2.PolicyReportResult</span>
</td>
<td>
<p>PolicyReportResult provides result details</p>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<H3 id="kyverno-io-v1alpha2-ClusterBackgroundScanReport">ClusterBackgroundScanReport
</H3>
<p><p>ClusterBackgroundScanReport is the Schema for the ClusterBackgroundScanReports API</p>
</p>
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>apiVersion</code></br>string</td>
<td><code>kyverno.io/v1alpha2</code></td>
</tr>
<tr>
<td><code>kind</code></br>string</td>
<td><code>ClusterBackgroundScanReport</code></td>
</tr>
<tr>
<td><code>metadata</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">meta/v1.ObjectMeta</span>
</td>
<td>
Refer to the Kubernetes API documentation for the fields of the
<code>metadata</code> field.
</td>
</tr>
<tr>
<td><code>spec</code>
<span style="color:blue;"> *</span>
</br>
<span style="font-family: monospace">github.com/kyverno/kyverno/api/kyverno/v2.BackgroundScanReportSpec</span>
</td>
<td>
<br/>
<br/>
<table>
<tr>
<td><code>summary</code>
</br>
<span style="font-family: monospace">github.com/kyverno/kyverno/api/policyreport/v1alpha2.PolicyReportSummary</span>
</td>
<td>
<p>PolicyReportSummary provides a summary of results</p>
</td>
</tr>
<tr>
<td><code>results</code>
</br>
<span style="font-family: monospace">[]github.com/kyverno/kyverno/api/policyreport/v1alpha2.PolicyReportResult</span>
</td>
<td>
<p>PolicyReportResult provides result details</p>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<hr />
</div>
</body>
</html>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,48 @@
{{ define "members" }}
{{/* . is a apiType */}}
{{ range .GetMembers }}
{{/* . is a apiMember */}}
{{ if not .Hidden }}
<tr>
<td><code>{{ .FieldName }}</code>
{{ if not .IsOptional }}
<span style="color:blue;"> *</span>
{{ end }}
</br>
{{/* Link for type reference */}}
{{ with .GetType }}
{{ if .Link }}
<a href="{{ .Link }}">
<span style="font-family: monospace">{{ .DisplayName }}</span>
</a>
{{ else }}
<span style="font-family: monospace">{{ .DisplayName }}</span>
{{ end }}
{{ end }}
</td>
<td>
{{ if .IsInline }}
<p>(Members of <code>{{ .FieldName }}</code> are embedded into this type.)</p>
{{ end}}
{{ .GetComment }}
{{ if and (eq (.GetType.Name.Name) "ObjectMeta") }}
Refer to the Kubernetes API documentation for the fields of the
<code>metadata</code> field.
{{ end }}
{{ if or (eq .FieldName "spec") }}
<br/>
<br/>
<table>
{{ template "members" .GetType }}
</table>
{{ end }}
</td>
</tr>
{{ end }}
{{ end }}
{{ end }}

56
docs/user/html/pkg.tpl Normal file
View file

@ -0,0 +1,56 @@
{{ define "packages" }}
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<style>
.bg-blue {
color: #ffffff;
background-color: #1589dd;
}
</style>
</head>
<body>
<div class="container">
{{ range .packages }}
{{/* Only display package that has a group name */}}
{{ if ne .GroupName "" }}
<h2 id="{{- .Anchor -}}">Package: <span style="font-family: monospace">{{- .DisplayName -}}</span></h2>
<p>{{ .GetComment }}</p>
{{ end }}
{{ end }}
{{ range .packages }}
{{ if ne .GroupName "" }}
{{/* TODO: Make the following line conditional */}}
<h3>Resource Types:</h3>
<ul>
{{- range .VisibleTypes -}}
{{ if .IsExported -}}
<li>
<a href="{{ .Link }}">{{ .DisplayName }}</a>
</li>
{{- end }}
{{- end -}}
</ul>
{{/* For package with a group name, list all type definitions in it. */}}
{{ range .VisibleTypes }}
{{- if or .Referenced .IsExported -}}
{{ template "type" . }}
{{- end -}}
{{ end }}
{{ else }}
{{/* For package without a group name, list only type definitions that are referenced. */}}
{{ range .VisibleTypes }}
{{ if .Referenced }}
{{ template "type" . }}
{{ end }}
{{ end }}
{{ end }}
<hr />
{{ end }}
</div>
</body>
</html>
{{ end }}

52
docs/user/html/type.tpl Normal file
View file

@ -0,0 +1,52 @@
{{ define "type" }}
<H3 id="{{ .Anchor }}">
{{- .Name.Name }}
{{ if eq .Kind "Alias" }}(<code>{{ .Underlying }}</code> alias)</p>{{ end -}}
</H3>
{{ with .References }}
<p>
(<em>Appears in:</em>
{{- $prev := "" -}}
{{- range . -}}
{{- if or .Referenced .IsExported -}}
{{- if $prev -}}, {{ end -}}
{{ $prev = . }}
<a href="{{ .Link }}">{{ .DisplayName }}</a>
{{- end }}
{{- end -}}
)
</p>
{{ end }}
<p>{{ .GetComment }}</p>
{{ if .GetMembers }}
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{{/* . is a apiType */}}
{{ if .IsExported }}
{{/* Add apiVersion and kind rows if deemed necessary */}}
<tr>
<td><code>apiVersion</code></br>string</td>
<td><code>{{ .APIGroup }}</code></td>
</tr>
<tr>
<td><code>kind</code></br>string</td>
<td><code>{{ .Name.Name }}</code></td>
</tr>
{{ end }}
{{/* The actual list of members is in the following template */}}
{{ template "members" .}}
</tbody>
</table>
{{ end }}
{{ end }}