Skip to content

Commit 1d42ae7

Browse files
committed
Generate both v1beta1 and v1alpha2 api-docs
We automatically generate the api docs for the most recent verion of the Gateway API. However, as the documentation refers to both v1beta1 resources, and some resources which have not yet graduted (eg TCPRoutes etc) we have change the api-docs generation to include both.
1 parent 1832068 commit 1d42ae7

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

apis/doc.go

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
Copyright 2020 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package apis

hack/api-docs/generate.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ gendoc::exec() {
4242
"$@"
4343
}
4444

45-
if [ "$#" != "2" ]; then
46-
echo "usage: generate.sh API_VERSION OUTFILE"
45+
if [ "$#" != "1" ]; then
46+
echo "usage: generate.sh OUTFILE"
4747
exit 2
4848
fi
4949

5050
gendoc::build
5151
gendoc::exec \
52-
-api-dir "sigs.k8s.io/gateway-api/apis/${1}" \
53-
-out-file "${2}"
52+
-api-dir "sigs.k8s.io/gateway-api/apis/" \
53+
-out-file "${1}"

hack/make-docs.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ mkdir -p site
3535
# Generate docs with mkdocs
3636
mkdocs build
3737
# Generate v1alpha2 API docs
38-
./hack/api-docs/generate.sh v1alpha2 site/v1alpha2-spec.html
38+
./hack/api-docs/generate.sh site/spec.html
3939
# Add them to spec page originally generated by mkdocs
40-
run::sed -e '/REPLACE_WITH_GENERATED_CONTENT/{r site/v1alpha2-spec.html' -e 'd;}' site/v1alpha2/references/spec/index.html
40+
run::sed -e '/REPLACE_WITH_GENERATED_CONTENT/{r site/spec.html' -e 'd;}' site/v1alpha2/references/spec/index.html

0 commit comments

Comments
 (0)