From 0f1bcf0ca74703b9d799187ad1113afd713e607c Mon Sep 17 00:00:00 2001 From: antonincms <9219052+antonincms@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:29:53 +0100 Subject: [PATCH] Fix markdown links to multi-version CRDs This change will break existing links in custom Markdown templates, as it now uses GroupVersionID to link to resources. To fix this, replace `## {{ $gv.GroupVersionString }}` in gv_details.tpl with `## {{ $gv.GroupVersionString }}`. --- renderer/markdown.go | 17 ++--- templates/markdown/gv_details.tpl | 2 +- templates/markdown/type.tpl | 4 +- test/expected.md | 94 +++++++++++++------------- test/hide.md | 94 +++++++++++++------------- test/templates/markdown/gv_details.tpl | 2 +- test/templates/markdown/type.tpl | 2 +- 7 files changed, 103 insertions(+), 112 deletions(-) diff --git a/renderer/markdown.go b/renderer/markdown.go index bbc60f0..8758879 100644 --- a/renderer/markdown.go +++ b/renderer/markdown.go @@ -114,23 +114,14 @@ func (m *MarkdownRenderer) RenderTypeLink(t *types.Type) string { } if local { - return m.RenderLocalLink(text) + return m.RenderLocalLink(link, text) } else { return m.RenderExternalLink(link, text) } } -func (m *MarkdownRenderer) RenderLocalLink(text string) string { - anchor := strings.ToLower( - strings.NewReplacer( - " ", "-", - ".", "", - "/", "", - "(", "", - ")", "", - ).Replace(text), - ) - return fmt.Sprintf("[%s](#%s)", text, anchor) +func (m *MarkdownRenderer) RenderLocalLink(link, text string) string { + return fmt.Sprintf("[%s](#%s)", text, link) } func (m *MarkdownRenderer) TemplateValue(key string) string { @@ -145,7 +136,7 @@ func (m *MarkdownRenderer) RenderExternalLink(link, text string) string { } func (m *MarkdownRenderer) RenderGVLink(gv types.GroupVersionDetails) string { - return m.RenderLocalLink(gv.GroupVersionString()) + return m.RenderLocalLink(m.GroupVersionID(gv), gv.GroupVersionString()) } func (m *MarkdownRenderer) RenderFieldDoc(text string) string { diff --git a/templates/markdown/gv_details.tpl b/templates/markdown/gv_details.tpl index 30ad0d7..16e05aa 100644 --- a/templates/markdown/gv_details.tpl +++ b/templates/markdown/gv_details.tpl @@ -1,7 +1,7 @@ {{- define "gvDetails" -}} {{- $gv := . -}} -## {{ $gv.GroupVersionString }} +## {{ $gv.GroupVersionString }} {{ $gv.Doc }} diff --git a/templates/markdown/type.tpl b/templates/markdown/type.tpl index 7d89d04..7b29738 100644 --- a/templates/markdown/type.tpl +++ b/templates/markdown/type.tpl @@ -2,7 +2,7 @@ {{- $type := . -}} {{- if markdownShouldRenderType $type -}} -#### {{ $type.Name }} +#### {{ $type.Name }} {{ if $type.IsAlias }}_Underlying type:_ _{{ markdownRenderTypeLink $type.UnderlyingType }}_{{ end }} @@ -36,7 +36,7 @@ _Appears in:_ {{ end -}} -{{ if $type.EnumValues -}} +{{ if $type.EnumValues -}} | Field | Description | | --- | --- | {{ range $type.EnumValues -}} diff --git a/test/expected.md b/test/expected.md index 5c739b5..063f3ec 100644 --- a/test/expected.md +++ b/test/expected.md @@ -1,17 +1,17 @@ # API Reference ## Packages -- [webapp.test.k8s.elastic.co/common](#webapptestk8selasticcocommon) -- [webapp.test.k8s.elastic.co/v1](#webapptestk8selasticcov1) +- [webapp.test.k8s.elastic.co/common](#webapp-test-k8s-elastic-co-common) +- [webapp.test.k8s.elastic.co/v1](#webapp-test-k8s-elastic-co-v1) -## webapp.test.k8s.elastic.co/common +## webapp.test.k8s.elastic.co/common Package common contains common API Schema definitions -#### CommonString +#### CommonString _Underlying type:_ _string_ @@ -20,25 +20,25 @@ _Underlying type:_ _string_ _Appears in:_ -- [GuestbookSpec](#guestbookspec) -- [GuestbookStatus](#guestbookstatus) +- [GuestbookSpec](#github-com-elastic-crd-ref-docs-api-v1-guestbookspec) +- [GuestbookStatus](#github-com-elastic-crd-ref-docs-api-v1-guestbookstatus) -## webapp.test.k8s.elastic.co/v1 +## webapp.test.k8s.elastic.co/v1 Package v1 contains API Schema definitions for the webapp v1 API group ### Resource Types -- [Embedded](#embedded) -- [Guestbook](#guestbook) -- [GuestbookList](#guestbooklist) -- [Underlying](#underlying) +- [Embedded](#github-com-elastic-crd-ref-docs-api-v1-embedded) +- [Guestbook](#github-com-elastic-crd-ref-docs-api-v1-guestbook) +- [GuestbookList](#github-com-elastic-crd-ref-docs-api-v1-guestbooklist) +- [Underlying](#github-com-elastic-crd-ref-docs-api-v1-underlying) -#### Embedded +#### Embedded @@ -59,7 +59,7 @@ Package v1 contains API Schema definitions for the webapp v1 API group | `value` _[JSON](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#json-v1-apiextensions-k8s-io)_ | | | | -#### Embedded1 +#### Embedded1 @@ -68,7 +68,7 @@ Package v1 contains API Schema definitions for the webapp v1 API group _Appears in:_ -- [Embedded](#embedded) +- [Embedded](#github-com-elastic-crd-ref-docs-api-v1-embedded) | Field | Description | Default | Validation | | --- | --- | --- | --- | @@ -77,7 +77,7 @@ _Appears in:_ | `value` _[JSON](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#json-v1-apiextensions-k8s-io)_ | | | | -#### EmbeddedX +#### EmbeddedX @@ -86,8 +86,8 @@ _Appears in:_ _Appears in:_ -- [Embedded](#embedded) -- [Embedded1](#embedded1) +- [Embedded](#github-com-elastic-crd-ref-docs-api-v1-embedded) +- [Embedded1](#github-com-elastic-crd-ref-docs-api-v1-embedded1) | Field | Description | Default | Validation | | --- | --- | --- | --- | @@ -95,7 +95,7 @@ _Appears in:_ | `value` _[JSON](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#json-v1-apiextensions-k8s-io)_ | | | | -#### Guestbook +#### Guestbook @@ -104,17 +104,17 @@ Guestbook is the Schema for the guestbooks API. _Appears in:_ -- [GuestbookList](#guestbooklist) +- [GuestbookList](#github-com-elastic-crd-ref-docs-api-v1-guestbooklist) | Field | Description | Default | Validation | | --- | --- | --- | --- | | `apiVersion` _string_ | `webapp.test.k8s.elastic.co/v1` | | | | `kind` _string_ | `Guestbook` | | | | `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | | -| `spec` _[GuestbookSpec](#guestbookspec)_ | | \{ page:1 \} | | +| `spec` _[GuestbookSpec](#github-com-elastic-crd-ref-docs-api-v1-guestbookspec)_ | | \{ page:1 \} | | -#### GuestbookEntry +#### GuestbookEntry @@ -123,17 +123,17 @@ GuestbookEntry defines an entry in a guest book. _Appears in:_ -- [GuestbookSpec](#guestbookspec) +- [GuestbookSpec](#github-com-elastic-crd-ref-docs-api-v1-guestbookspec) | Field | Description | Default | Validation | | --- | --- | --- | --- | | `name` _string_ | Name of the guest (pipe \| should be escaped) | | MaxLength: 80
Pattern: `0*[a-z0-9]*[a-z]*[0-9]`
| | `time` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#time-v1-meta)_ | Time of entry | | | | `comment` _string_ | Comment by guest. This can be a multi-line comment.
Like this one.
Now let's test a list:
* a
* b
Another isolated comment.
Looks good? | | Pattern: `0*[a-z0-9]*[a-z]*[0-9]*\|\s`
| -| `rating` _[Rating](#rating)_ | Rating provided by the guest | | Maximum: 5
Minimum: 1
| +| `rating` _[Rating](#github-com-elastic-crd-ref-docs-api-v1-rating)_ | Rating provided by the guest | | Maximum: 5
Minimum: 1
| -#### GuestbookHeader +#### GuestbookHeader _Underlying type:_ _string_ @@ -142,11 +142,11 @@ GuestbookHeaders are strings to include at the top of a page. _Appears in:_ -- [GuestbookSpec](#guestbookspec) +- [GuestbookSpec](#github-com-elastic-crd-ref-docs-api-v1-guestbookspec) -#### GuestbookList +#### GuestbookList @@ -161,10 +161,10 @@ GuestbookList contains a list of Guestbook. | `apiVersion` _string_ | `webapp.test.k8s.elastic.co/v1` | | | | `kind` _string_ | `GuestbookList` | | | | `metadata` _[ListMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#listmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | | -| `items` _[Guestbook](#guestbook) array_ | | | | +| `items` _[Guestbook](#github-com-elastic-crd-ref-docs-api-v1-guestbook) array_ | | | | -#### GuestbookSpec +#### GuestbookSpec @@ -173,23 +173,23 @@ GuestbookSpec defines the desired state of Guestbook. _Appears in:_ -- [Guestbook](#guestbook) +- [Guestbook](#github-com-elastic-crd-ref-docs-api-v1-guestbook) | Field | Description | Default | Validation | | --- | --- | --- | --- | -| `page` _[PositiveInt](#positiveint)_ | Page indicates the page number | 1 | Minimum: 1
| -| `entries` _[GuestbookEntry](#guestbookentry) array_ | Entries contain guest book entries for the page | | | +| `page` _[PositiveInt](#github-com-elastic-crd-ref-docs-api-v1-positiveint)_ | Page indicates the page number | 1 | Minimum: 1
| +| `entries` _[GuestbookEntry](#github-com-elastic-crd-ref-docs-api-v1-guestbookentry) array_ | Entries contain guest book entries for the page | | | | `selector` _[LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#labelselector-v1-meta)_ | Selector selects something | | | -| `headers` _[GuestbookHeader](#guestbookheader) array_ | Headers contains a list of header items to include in the page | | MaxItems: 10
UniqueItems: true
| +| `headers` _[GuestbookHeader](#github-com-elastic-crd-ref-docs-api-v1-guestbookheader) array_ | Headers contains a list of header items to include in the page | | MaxItems: 10
UniqueItems: true
| | `certificateRef` _[SecretObjectReference](https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1beta1.SecretObjectReference)_ | CertificateRef is a reference to a secret containing a certificate | | | -| `str` _[CommonString](#commonstring)_ | | | | -| `enum` _[MyEnum](#myenum)_ | Enumeration is an example of an aliased enumeration type | | Enum: [MyFirstValue MySecondValue]
| +| `str` _[CommonString](#github-com-elastic-crd-ref-docs-api-common-commonstring)_ | | | | +| `enum` _[MyEnum](#github-com-elastic-crd-ref-docs-api-v1-myenum)_ | Enumeration is an example of an aliased enumeration type | | Enum: [MyFirstValue MySecondValue]
| | `digest` _string_ | Digest is the content-addressable identifier of the guestbook | | Pattern: `^sha256:[a-fA-F0-9]\{64\}$`
| -#### MyEnum +#### MyEnum _Underlying type:_ _string_ @@ -199,7 +199,7 @@ _Validation:_ - Enum: [MyFirstValue MySecondValue] _Appears in:_ -- [GuestbookSpec](#guestbookspec) +- [GuestbookSpec](#github-com-elastic-crd-ref-docs-api-v1-guestbookspec) | Field | Description | | --- | --- | @@ -207,7 +207,7 @@ _Appears in:_ | `MySecondValue` | MySecondValue is what you use when you can't use MyFirstValue
| -#### PositiveInt +#### PositiveInt _Underlying type:_ _integer_ @@ -217,11 +217,11 @@ _Validation:_ - Minimum: 1 _Appears in:_ -- [GuestbookSpec](#guestbookspec) +- [GuestbookSpec](#github-com-elastic-crd-ref-docs-api-v1-guestbookspec) -#### Rating +#### Rating _Underlying type:_ _integer_ @@ -232,13 +232,13 @@ _Validation:_ - Minimum: 1 _Appears in:_ -- [GuestbookEntry](#guestbookentry) +- [GuestbookEntry](#github-com-elastic-crd-ref-docs-api-v1-guestbookentry) -#### Underlying +#### Underlying @@ -253,12 +253,12 @@ Underlying tests that Underlying1's underlying type is Underlying2 instead of st | `apiVersion` _string_ | `webapp.test.k8s.elastic.co/v1` | | | | `kind` _string_ | `Underlying` | | | | `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | | -| `a` _[Underlying1](#underlying1)_ | | b | MaxLength: 10
| +| `a` _[Underlying1](#github-com-elastic-crd-ref-docs-api-v1-underlying1)_ | | b | MaxLength: 10
| -#### Underlying1 +#### Underlying1 -_Underlying type:_ _[Underlying2](#underlying2)_ +_Underlying type:_ _[Underlying2](#github-com-elastic-crd-ref-docs-api-v1-underlying2)_ Underlying1 has an underlying type with an underlying type @@ -266,11 +266,11 @@ _Validation:_ - MaxLength: 10 _Appears in:_ -- [Underlying](#underlying) +- [Underlying](#github-com-elastic-crd-ref-docs-api-v1-underlying) -#### Underlying2 +#### Underlying2 _Underlying type:_ _string_ @@ -280,7 +280,7 @@ _Validation:_ - MaxLength: 10 _Appears in:_ -- [Underlying1](#underlying1) +- [Underlying1](#github-com-elastic-crd-ref-docs-api-v1-underlying1) diff --git a/test/hide.md b/test/hide.md index 390766e..af1d9b9 100644 --- a/test/hide.md +++ b/test/hide.md @@ -3,18 +3,18 @@ Here is a template value: `v1`. ## Packages -- [webapp.test.k8s.elastic.co/common](#webapptestk8selasticcocommon) -- [webapp.test.k8s.elastic.co/v1](#webapptestk8selasticcov1) +- [webapp.test.k8s.elastic.co/common](#webapp-test-k8s-elastic-co-common) +- [webapp.test.k8s.elastic.co/v1](#webapp-test-k8s-elastic-co-v1) -## webapp.test.k8s.elastic.co/common +## webapp.test.k8s.elastic.co/common Package common contains common API Schema definitions *Important: This package is special and should be treated differently.* -#### CommonString +#### CommonString _Underlying type:_ _string_ @@ -23,25 +23,25 @@ _Underlying type:_ _string_ _Appears in:_ -- [GuestbookSpec](#guestbookspec) -- [GuestbookStatus](#guestbookstatus) +- [GuestbookSpec](#github-com-elastic-crd-ref-docs-api-v1-guestbookspec) +- [GuestbookStatus](#github-com-elastic-crd-ref-docs-api-v1-guestbookstatus) -## webapp.test.k8s.elastic.co/v1 +## webapp.test.k8s.elastic.co/v1 Package v1 contains API Schema definitions for the webapp v1 API group ### Resource Types -- [Embedded](#embedded) -- [Guestbook](#guestbook) -- [GuestbookList](#guestbooklist) -- [Underlying](#underlying) +- [Embedded](#github-com-elastic-crd-ref-docs-api-v1-embedded) +- [Guestbook](#github-com-elastic-crd-ref-docs-api-v1-guestbook) +- [GuestbookList](#github-com-elastic-crd-ref-docs-api-v1-guestbooklist) +- [Underlying](#github-com-elastic-crd-ref-docs-api-v1-underlying) -#### Embedded +#### Embedded @@ -61,7 +61,7 @@ Package v1 contains API Schema definitions for the webapp v1 API group | `value` _[JSON](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#json-v1-apiextensions-k8s-io)_ | | | | -#### Embedded1 +#### Embedded1 @@ -70,7 +70,7 @@ Package v1 contains API Schema definitions for the webapp v1 API group _Appears in:_ -- [Embedded](#embedded) +- [Embedded](#github-com-elastic-crd-ref-docs-api-v1-embedded) | Field | Description | Default | Validation | | --- | --- | --- | --- | @@ -78,7 +78,7 @@ _Appears in:_ | `value` _[JSON](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#json-v1-apiextensions-k8s-io)_ | | | | -#### EmbeddedX +#### EmbeddedX @@ -87,8 +87,8 @@ _Appears in:_ _Appears in:_ -- [Embedded](#embedded) -- [Embedded1](#embedded1) +- [Embedded](#github-com-elastic-crd-ref-docs-api-v1-embedded) +- [Embedded1](#github-com-elastic-crd-ref-docs-api-v1-embedded1) | Field | Description | Default | Validation | | --- | --- | --- | --- | @@ -96,7 +96,7 @@ _Appears in:_ | `value` _[JSON](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#json-v1-apiextensions-k8s-io)_ | | | | -#### Guestbook +#### Guestbook @@ -105,17 +105,17 @@ Guestbook is the Schema for the guestbooks API. _Appears in:_ -- [GuestbookList](#guestbooklist) +- [GuestbookList](#github-com-elastic-crd-ref-docs-api-v1-guestbooklist) | Field | Description | Default | Validation | | --- | --- | --- | --- | | `apiVersion` _string_ | `webapp.test.k8s.elastic.co/v1` | | | | `kind` _string_ | `Guestbook` | | | | `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | | -| `spec` _[GuestbookSpec](#guestbookspec)_ | | \{ page:1 \} | | +| `spec` _[GuestbookSpec](#github-com-elastic-crd-ref-docs-api-v1-guestbookspec)_ | | \{ page:1 \} | | -#### GuestbookEntry +#### GuestbookEntry @@ -124,17 +124,17 @@ GuestbookEntry defines an entry in a guest book. _Appears in:_ -- [GuestbookSpec](#guestbookspec) +- [GuestbookSpec](#github-com-elastic-crd-ref-docs-api-v1-guestbookspec) | Field | Description | Default | Validation | | --- | --- | --- | --- | | `name` _string_ | Name of the guest (pipe \| should be escaped) | | MaxLength: 80
Pattern: `0*[a-z0-9]*[a-z]*[0-9]`
| | `time` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#time-v1-meta)_ | Time of entry | | | | `comment` _string_ | Comment by guest. This can be a multi-line comment.
Like this one.
Now let's test a list:
* a
* b
Another isolated comment.
Looks good? | | Pattern: `0*[a-z0-9]*[a-z]*[0-9]*\|\s`
| -| `rating` _[Rating](#rating)_ | Rating provided by the guest | | Maximum: 5
Minimum: 1
| +| `rating` _[Rating](#github-com-elastic-crd-ref-docs-api-v1-rating)_ | Rating provided by the guest | | Maximum: 5
Minimum: 1
| -#### GuestbookHeader +#### GuestbookHeader _Underlying type:_ _string_ @@ -143,11 +143,11 @@ GuestbookHeaders are strings to include at the top of a page. _Appears in:_ -- [GuestbookSpec](#guestbookspec) +- [GuestbookSpec](#github-com-elastic-crd-ref-docs-api-v1-guestbookspec) -#### GuestbookList +#### GuestbookList @@ -162,10 +162,10 @@ GuestbookList contains a list of Guestbook. | `apiVersion` _string_ | `webapp.test.k8s.elastic.co/v1` | | | | `kind` _string_ | `GuestbookList` | | | | `metadata` _[ListMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#listmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | | -| `items` _[Guestbook](#guestbook) array_ | | | | +| `items` _[Guestbook](#github-com-elastic-crd-ref-docs-api-v1-guestbook) array_ | | | | -#### GuestbookSpec +#### GuestbookSpec @@ -174,23 +174,23 @@ GuestbookSpec defines the desired state of Guestbook. _Appears in:_ -- [Guestbook](#guestbook) +- [Guestbook](#github-com-elastic-crd-ref-docs-api-v1-guestbook) | Field | Description | Default | Validation | | --- | --- | --- | --- | -| `page` _[PositiveInt](#positiveint)_ | Page indicates the page number | 1 | Minimum: 1
| -| `entries` _[GuestbookEntry](#guestbookentry) array_ | Entries contain guest book entries for the page | | | +| `page` _[PositiveInt](#github-com-elastic-crd-ref-docs-api-v1-positiveint)_ | Page indicates the page number | 1 | Minimum: 1
| +| `entries` _[GuestbookEntry](#github-com-elastic-crd-ref-docs-api-v1-guestbookentry) array_ | Entries contain guest book entries for the page | | | | `selector` _[LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#labelselector-v1-meta)_ | Selector selects something | | | -| `headers` _[GuestbookHeader](#guestbookheader) array_ | Headers contains a list of header items to include in the page | | MaxItems: 10
UniqueItems: true
| +| `headers` _[GuestbookHeader](#github-com-elastic-crd-ref-docs-api-v1-guestbookheader) array_ | Headers contains a list of header items to include in the page | | MaxItems: 10
UniqueItems: true
| | `certificateRef` _[SecretObjectReference](https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1beta1.SecretObjectReference)_ | CertificateRef is a reference to a secret containing a certificate | | | -| `str` _[CommonString](#commonstring)_ | | | | -| `enum` _[MyEnum](#myenum)_ | Enumeration is an example of an aliased enumeration type | | Enum: [MyFirstValue MySecondValue]
| +| `str` _[CommonString](#github-com-elastic-crd-ref-docs-api-common-commonstring)_ | | | | +| `enum` _[MyEnum](#github-com-elastic-crd-ref-docs-api-v1-myenum)_ | Enumeration is an example of an aliased enumeration type | | Enum: [MyFirstValue MySecondValue]
| | `digest` _string_ | Digest is the content-addressable identifier of the guestbook | | Pattern: `^sha256:[a-fA-F0-9]\{64\}$`
| -#### MyEnum +#### MyEnum _Underlying type:_ _string_ @@ -200,14 +200,14 @@ _Validation:_ - Enum: [MyFirstValue MySecondValue] _Appears in:_ -- [GuestbookSpec](#guestbookspec) +- [GuestbookSpec](#github-com-elastic-crd-ref-docs-api-v1-guestbookspec) | Field | Description | | `MyFirstValue` | MyFirstValue is an interesting value to use
| | `MySecondValue` | MySecondValue is what you use when you can't use MyFirstValue
| -#### PositiveInt +#### PositiveInt _Underlying type:_ _integer_ @@ -217,11 +217,11 @@ _Validation:_ - Minimum: 1 _Appears in:_ -- [GuestbookSpec](#guestbookspec) +- [GuestbookSpec](#github-com-elastic-crd-ref-docs-api-v1-guestbookspec) -#### Rating +#### Rating _Underlying type:_ _integer_ @@ -232,13 +232,13 @@ _Validation:_ - Minimum: 1 _Appears in:_ -- [GuestbookEntry](#guestbookentry) +- [GuestbookEntry](#github-com-elastic-crd-ref-docs-api-v1-guestbookentry) -#### Underlying +#### Underlying @@ -253,12 +253,12 @@ Underlying tests that Underlying1's underlying type is Underlying2 instead of st | `apiVersion` _string_ | `webapp.test.k8s.elastic.co/v1` | | | | `kind` _string_ | `Underlying` | | | | `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | | -| `a` _[Underlying1](#underlying1)_ | | b | MaxLength: 10
| +| `a` _[Underlying1](#github-com-elastic-crd-ref-docs-api-v1-underlying1)_ | | b | MaxLength: 10
| -#### Underlying1 +#### Underlying1 -_Underlying type:_ _[Underlying2](#underlying2)_ +_Underlying type:_ _[Underlying2](#github-com-elastic-crd-ref-docs-api-v1-underlying2)_ Underlying1 has an underlying type with an underlying type @@ -266,11 +266,11 @@ _Validation:_ - MaxLength: 10 _Appears in:_ -- [Underlying](#underlying) +- [Underlying](#github-com-elastic-crd-ref-docs-api-v1-underlying) -#### Underlying2 +#### Underlying2 _Underlying type:_ _string_ @@ -280,7 +280,7 @@ _Validation:_ - MaxLength: 10 _Appears in:_ -- [Underlying1](#underlying1) +- [Underlying1](#github-com-elastic-crd-ref-docs-api-v1-underlying1) diff --git a/test/templates/markdown/gv_details.tpl b/test/templates/markdown/gv_details.tpl index 103ae17..2827220 100644 --- a/test/templates/markdown/gv_details.tpl +++ b/test/templates/markdown/gv_details.tpl @@ -1,7 +1,7 @@ {{- define "gvDetails" -}} {{- $gv := . -}} -## {{ $gv.GroupVersionString }} +## {{ $gv.GroupVersionString }} {{ $gv.Doc }} diff --git a/test/templates/markdown/type.tpl b/test/templates/markdown/type.tpl index 1ef5d62..9dbf835 100644 --- a/test/templates/markdown/type.tpl +++ b/test/templates/markdown/type.tpl @@ -2,7 +2,7 @@ {{- $type := . -}} {{- if markdownShouldRenderType $type -}} -#### {{ $type.Name }} +#### {{ $type.Name }} {{ if $type.IsAlias }}_Underlying type:_ _{{ markdownRenderTypeLink $type.UnderlyingType }}_{{ end }}