Skip to content

Commit 2c46bee

Browse files
authored
Merge pull request #27443 from ydFu/update-kubernetes-api
[zh] Sync contribute pages for kubernetes-api.md
2 parents 323331b + 0241569 commit 2c46bee

File tree

1 file changed

+37
-24
lines changed

1 file changed

+37
-24
lines changed

content/zh/docs/contribute/generate-ref-docs/kubernetes-api.md

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@ weight: 50
1212
<!-- overview -->
1313

1414
<!--
15-
This page shows how to update the generated reference docs for the Kubernetes API.
15+
This page shows how to update the Kubernetes API reference documentation.
1616
1717
The Kubernetes API reference documentation is built from the
1818
[Kubernetes OpenAPI spec](https://github.com/kubernetes/kubernetes/blob/master/api/openapi-spec/swagger.json)
19-
and tools from [kubernetes-sigs/reference-docs](https://github.com/kubernetes-sigs/reference-docs).
19+
using the [kubernetes-sigs/reference-docs](https://github.com/kubernetes-sigs/reference-docs) generation code.
2020
2121
If you find bugs in the generated documentation, you need to
2222
[fix them upstream](/docs/contribute/generate-ref-docs/contribute-upstream/).
2323
2424
If you need only to regenerate the reference documentation from the [OpenAPI](https://github.com/OAI/OpenAPI-Specification)
2525
spec, continue reading this page.
2626
-->
27-
本页面展示了如何为 Kubernetes API 更新自动生成的参考文档
27+
本页面显示了如何更新 Kubernetes API 参考文档
2828

2929
Kubernetes API 参考文档是从
3030
[Kubernetes OpenAPI 规范](https://github.com/kubernetes/kubernetes/blob/master/api/openapi-spec/swagger.json)
31-
构建的,而工具是从
32-
[kubernetes-sigs/reference-docs](https://github.com/kubernetes-sigs/reference-docs) 构建的
31+
构建的,
32+
且使用[kubernetes-sigs/reference-docs](https://github.com/kubernetes-sigs/reference-docs) 生成代码
3333

3434
如果您在生成的文档中发现错误,则需要[在上游修复](/zh/docs/contribute/generate-ref-docs/contribute-upstream/)
3535

@@ -55,23 +55,30 @@ mkdir -p $HOME/<workspace>
5555
export GOPATH=$HOME/<workspace>
5656
```
5757

58-
<!-- Get a local clone of the following repositories: -->
58+
<!--
59+
Get a local clone of the following repositories:
60+
-->
5961
获取以下仓库的本地克隆:
6062

6163
```shell
62-
go get -u github.com/kubernetes-incubator/reference-docs
64+
go get -u github.com/kubernetes-sigs/reference-docs
65+
6366
go get -u github.com/go-openapi/loads
6467
go get -u github.com/go-openapi/spec
6568
```
6669

67-
<!-- If you don't already have the kubernetes/website repository, get it now: -->
70+
<!--
71+
If you don't already have the kubernetes/website repository, get it now:
72+
-->
6873
如果你还没有下载过 `kubernetes/website` 仓库,现在下载:
6974

7075
```shell
7176
git clone https://github.com/<your-username>/website $GOPATH/src/github.com/<your-username>/website
7277
```
7378

74-
<!-- Get a clone of the kubernetes/kubernetes repository as k8s.io/kubernetes: -->
79+
<!--
80+
Get a clone of the kubernetes/kubernetes repository as k8s.io/kubernetes:
81+
-->
7582
克隆 kubernetes/kubernetes 仓库作为 k8s.io/kubernetes:
7683

7784
```shell
@@ -90,16 +97,16 @@ The remaining steps refer to your base directory as `<k8s-base>`.
9097
The remaining steps refer to your base directory as `<web-base>`.
9198
9299
* The base directory of your clone of the
93-
[kubernetes-incubator/reference-docs](https://github.com/kubernetes-incubator/reference-docs)
94-
repository is `$GOPATH/src/github.com/kubernetes-incubator/reference-docs.`
100+
[kubernetes-sigs/reference-docs](https://github.com/kubernetes-sigs/reference-docs)
101+
repository is `$GOPATH/src/github.com/kubernetes-sigs/reference-docs.`
95102
The remaining steps refer to your base directory as `<rdocs-base>`.
96103
-->
97104
* [kubernetes/kubernetes](https://github.com/kubernetes/kubernetes) 仓库克隆后的根目录为
98105
`$GOPATH/src/k8s.io/kubernetes`。 后续步骤将此目录称为 `<k8s-base>`
99106
* [kubernetes/website](https://github.com/kubernetes/website) 仓库克隆后的根目录为
100107
`$GOPATH/src/github.com/<your username>/website`。后续步骤将此目录称为 `<web-base>`
101108
* [kubernetes-sigs/reference-docs](https://github.com/kubernetes-sigs/reference-docs)
102-
仓库克隆后的基本目录为 `$GOPATH/src/github.com/kubernetes-sigs/reference-docs`
109+
仓库克隆后的基本目录为 `$GOPATH/src/github.com/kubernetes-sigs/reference-docs.`
103110
后续步骤将此目录称为 `<rdocs-base>`
104111

105112
<!--
@@ -122,21 +129,23 @@ Go to `<rdocs-base>`, and open the `Makefile` for editing:
122129
<!--
123130
* Set `K8S_ROOT` to `<k8s-base>`.
124131
* Set `K8S_WEBROOT` to `<web-base>`.
125-
* Set `K8S_RELEASE` to the minor version of the docs you want to build.
126-
For example, if you want to build docs for Kubernetes 1.17, set `K8S_RELEASE` to 1.17.
132+
* Set `K8S_RELEASE` to the version of the docs you want to build.
133+
For example, if you want to build docs for Kubernetes 1.17.0, set `K8S_RELEASE` to 1.17.0.
127134
-->
128135
* 设置 `K8S_ROOT``<k8s-base>`.
129136
* 设置 `K8S_WEBROOT``<web-base>`.
130137
* 设置 `K8S_RELEASE` 为要构建的文档的版本。
131-
例如,如果您想为 Kubernetes 1.17 构建文档,请将 `K8S_RELEASE` 设置为 1.17。
138+
例如,如果您想为 Kubernetes 1.17.0 构建文档,请将 `K8S_RELEASE` 设置为 1.17.0
132139

133-
<!-- For example, update the following variables: -->
140+
<!--
141+
For example:
142+
-->
134143
例如:
135144

136-
```
145+
```shell
137146
export K8S_WEBROOT=$(GOPATH)/src/github.com/<your-username>/website
138147
export K8S_ROOT=$(GOPATH)/src/k8s.io/kubernetes
139-
export K8S_RELEASE=1.17
148+
export K8S_RELEASE=1.17.0
140149
```
141150

142151
<!--
@@ -156,9 +165,9 @@ The versioned directory name follows the pattern of `v<major>_<minor>`.
156165
版本化目录的名称形式为 `v<major>_<minor>`
157166

158167
<!--
159-
In the '<rdocs-base>' directory, run the following build target:
168+
In the `<rdocs-base>` directory, run the following build target:
160169
-->
161-
'<rdocs-base>' 目录中,运行以下命令来构建:
170+
`<rdocs-base>` 目录中,运行以下命令来构建:
162171

163172
```shell
164173
cd <rdocs-base>
@@ -184,12 +193,14 @@ cd <rdocs-base>
184193
make copyapi
185194
```
186195

187-
<!-- Verify that these two files have been generated: -->
196+
<!--
197+
Verify that these two files have been generated:
198+
-->
188199
验证是否已生成这两个文件:
189200

190201
```shell
191-
[ -e "<rdocs-base>/gen-apidocs/generators/build/index.html" ] && echo "index.html built" || echo "no index.html"
192-
[ -e "<rdocs-base>/gen-apidocs/generators/build/navData.js" ] && echo "navData.js built" || echo "no navData.js"
202+
[ -e "<rdocs-base>/gen-apidocs/build/index.html" ] && echo "index.html built" || echo "no index.html"
203+
[ -e "<rdocs-base>/gen-apidocs/build/navData.js" ] && echo "navData.js built" || echo "no navData.js"
193204
```
194205

195206
<!--
@@ -203,7 +214,9 @@ cd <web-base>
203214
git status
204215
```
205216

206-
<!-- The output is similar to: -->
217+
<!--
218+
The output is similar to:
219+
-->
207220
输出类似于:
208221

209222
```

0 commit comments

Comments
 (0)