-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add make target to automatically generate API docs.
- Loading branch information
1 parent
ee547a3
commit d7848a6
Showing
8 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
render: | ||
kubernetesVersion: "1.20" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{- define "gvDetails" -}} | ||
{{- $gv := . -}} | ||
[id="{{ asciidocGroupVersionID $gv | asciidocRenderAnchorID }}"] | ||
== {{ $gv.GroupVersionString }} | ||
|
||
{{ $gv.Doc }} | ||
|
||
{{- if $gv.Kinds }} | ||
.Resource Types | ||
{{- range $gv.SortedKinds }} | ||
- {{ $gv.TypeForKind . | asciidocRenderTypeLink }} | ||
{{- end }} | ||
{{ end }} | ||
|
||
=== Definitions | ||
{{ range $gv.SortedTypes }} | ||
{{ template "type" . }} | ||
{{ end }} | ||
|
||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{- define "gvList" -}} | ||
{{- $groupVersions := . -}} | ||
|
||
// Generated documentation. Please do not edit. | ||
:anchor_prefix: k8s-api | ||
|
||
[id="{p}-api-reference"] | ||
= API Reference | ||
|
||
.Packages | ||
{{- range $groupVersions }} | ||
- {{ asciidocRenderGVLink . }} | ||
{{- end }} | ||
|
||
{{ range $groupVersions }} | ||
{{ template "gvDetails" . }} | ||
{{ end }} | ||
|
||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{{- define "type" -}} | ||
{{- $type := . -}} | ||
{{- if asciidocShouldRenderType $type -}} | ||
|
||
[id="{{ asciidocTypeID $type | asciidocRenderAnchorID }}"] | ||
==== {{ $type.Name }} {{ if $type.IsAlias }}({{ asciidocRenderTypeLink $type.UnderlyingType }}) {{ end }} | ||
|
||
{{ $type.Doc }} | ||
|
||
{{ if $type.References -}} | ||
.Appears In: | ||
**** | ||
{{- range $type.SortedReferences }} | ||
- {{ asciidocRenderTypeLink . }} | ||
{{- end }} | ||
**** | ||
{{- end }} | ||
|
||
{{ if $type.Members -}} | ||
[cols="25a,75a", options="header"] | ||
|=== | ||
| Field | Description | ||
{{ if $type.GVK -}} | ||
| *`apiVersion`* __string__ | `{{ $type.GVK.Group }}/{{ $type.GVK.Version }}` | ||
| *`kind`* __string__ | `{{ $type.GVK.Kind }}` | ||
{{ end -}} | ||
|
||
{{ range $type.Members -}} | ||
| *`{{ .Name }}`* __{{ asciidocRenderType .Type }}__ | {{ template "type_members" . }} | ||
{{ end -}} | ||
|=== | ||
{{ end -}} | ||
|
||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{{- define "type_members" -}} | ||
{{- $field := . -}} | ||
{{- if eq $field.Name "metadata" -}} | ||
Refer to Kubernetes API documentation for fields of `metadata`. | ||
{{ else -}} | ||
{{ $field.Doc }} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters