Skip to content

Commit 0c56ab2

Browse files
committed
show (deprecated) for deprecated APIs on API reference
Signed-off-by: Jared Watts <[email protected]>
1 parent d060988 commit 0c56ab2

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
{{/* Pass a schema and find the currently active version and return a dict of (version: <version>, schema: <schema>) */}}
22
{{ $version := "" }}
33
{{ $schema := dict }}
4+
{{ $deprecated := false }}
45

56
{{ range .versions }}
67
{{ if index . "storage" }}
78
{{ $version = .name }}
89
{{ $schema = .schema }}
10+
{{ $deprecated = .deprecated }}
911
{{ else if (and (index . "served") (not $version)) }}
1012
{{ $version = .name }}
1113
{{ $schema = .schema }}
14+
{{ $deprecated = .deprecated }}
1215
{{ end }}
1316
{{ end }}
1417

1518
{{ return (dict "version" $version
16-
"schema" $schema)
19+
"schema" $schema
20+
"deprecated" $deprecated)
1721
}}
1822

1923

themes/geekboot/layouts/partials/apiBuilder/printGKVExpander.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{{ $group := .group }}
33
{{ $kind := .kind }}
44
{{ $version := .version }}
5+
{{ $deprecated := .deprecated }}
56
{{ $bigName := partial "apiBuilder/checkBigName" $kind }}
67

78
{{/* Collapse/Expand Button and Kind name */}}
@@ -11,7 +12,7 @@
1112

1213
{{/* CRD name text */}}
1314
<button class="crd-root collapsed align-middle" data-bs-toggle="collapse" data-bs-target="#{{$kind}}" type="button" aria-expanded="false" aria-controls="{{$kind}}">
14-
<span class="align-middle {{ $kind }}"><a class="expansion-link" name="{{ $kind }}">{{ $kind }}</a></span>
15+
<span class="align-middle {{ $kind }}"><a class="expansion-link" name="{{ $kind }}">{{ $kind }}{{ if $deprecated }} (deprecated){{ end }}</a></span>
1516
</button>
1617
</div>
1718

themes/geekboot/layouts/partials/crds.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@
2727
{{ $versionAndSchema := partial "apiBuilder/getVersionAndSchema" $crdContent.spec }}
2828
{{ $schema := $versionAndSchema.schema.openAPIV3Schema }}
2929
{{ $version := $versionAndSchema.version }}
30+
{{ $deprecated := $versionAndSchema.deprecated }}
3031
{{ $description := $schema.description }}
3132

3233
{{/* The div containing the entire CRD information including the Expand All/Collapse All row */}}
3334
<div class="crd-root-row crd-container row align-middle bigName-row" data-kind="{{ $kind }}" data-group="{{ $group }}-{{ $kind}}" data-version="{{ $version }}-{{ $kind }}">
3435

3536
{{/* generate the GKV line to expand/collapse the CRD data */}}
36-
{{ partial "apiBuilder/printGKVExpander" (dict "group" $group "version" $version "kind" $kind) }}
37+
{{ partial "apiBuilder/printGKVExpander" (dict "group" $group "version" $version "kind" $kind "deprecated" $deprecated) }}
3738

3839

3940
{{/* The container to show/hide with information related to the CRD */}}

0 commit comments

Comments
 (0)