Skip to content

Commit c5641f1

Browse files
committed
[zh-cn] sync contribute/style/*
Signed-off-by: xin.li <xin.li@daocloud.io>
1 parent 738f936 commit c5641f1

File tree

3 files changed

+65
-37
lines changed

3 files changed

+65
-37
lines changed

content/zh-cn/docs/contribute/style/diagram-guide.md

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ flowchart LR
3838
subgraph m[Mermaid.js]
3939
direction TB
4040
S[ ]-.-
41-
C[使用 markdown 来<br>构造图表] -->
41+
C[使用 Markdown 来<br>构造图表] -->
4242
D[在线<br>编辑器]
4343
end
4444
A[为什么图表<br>很有用] --> m
@@ -120,11 +120,11 @@ The user benefits include:
120120
* __Better retention__. For some, it is easier to recall pictures rather than text.
121121
-->
122122
用户获得的好处有:
123-
* __较为友好的初次体验__:非常详尽的、只包含文本的欢迎页面对用户而言是蛮恐怖的,
123+
* **较为友好的初次体验**:非常详尽的、只包含文本的欢迎页面对用户而言是蛮恐怖的,
124124
尤其是初次接触 Kubernetes 的用户。
125-
* __快速理解概念__:图表可以帮助用户理解复杂主题下的要点。
125+
* **快速理解概念**:图表可以帮助用户理解复杂主题下的要点。
126126
你的图表可以作为一种可视化的学习指南,将用户带入主题的细节。
127-
* __便于记忆__:对某些人而言,图形(图像)要比文字更容易记忆。
127+
* **便于记忆**:对某些人而言,图形(图像)要比文字更容易记忆。
128128

129129
<!--
130130
The contributor benefits include:
@@ -138,9 +138,9 @@ The contributor benefits include:
138138
-->
139139
对贡献者而言的好处有:
140140

141-
* __帮助确立所贡献文档的结构和内容__。例如,
141+
* **帮助确立所贡献文档的结构和内容**。例如,
142142
你可以先提供一个覆盖所有顶层要点的图表,然后再逐步展开细节。
143-
* __培养用户社区并提升其能力__。容易理解的文档,附以图表,能够吸引新的用户,
143+
* **培养用户社区并提升其能力**。容易理解的文档,附以图表,能够吸引新的用户,
144144
尤其是那些因为预见到复杂性而不愿参与的用户。
145145

146146
<!--
@@ -212,7 +212,7 @@ in your environment. This method is called __Mermaid+SVG__ and is explained
212212
below.
213213
-->
214214
即使你的工作环境中不支持,你仍然可以使用 Mermaid 来创建、编辑图表。
215-
这种方法称作 __Mermaid+SVG__,在后文详细解释。
215+
这种方法称作 **Mermaid+SVG**,在后文详细解释。
216216
{{< /note >}}
217217

218218
<!--
@@ -585,7 +585,7 @@ method for adding `.svg` image files.
585585
图 5 给出使用外部工具来添加图表时所遵循的步骤。
586586

587587
首先,要使用你的外部工具来创建图表,并将其保存为一个 `.svg` 文件或 `.png` 图片文件。
588-
之后,使用 __Mermaid+SVG__ 方法中相同的步骤添加 `.svg``.png`)文件。
588+
之后,使用 **Mermaid+SVG** 方法中相同的步骤添加 `.svg``.png`)文件。
589589

590590
{{< mermaid >}}
591591
flowchart LR
@@ -622,7 +622,7 @@ click E "https://mermaid-js.github.io/mermaid-live-editor/edit/#eyJjb2RlIjoiZmxv
622622
<!--
623623
Figure 5. External Tool method steps
624624
-->
625-
图 5. 外部工具方法步骤.
625+
图 5. 外部工具方法步骤
626626

627627
<!--
628628
The following lists the steps you should follow for adding a diagram using the External Tool method:
@@ -639,11 +639,11 @@ The following lists the steps you should follow for adding a diagram using the E
639639
使用外部工具方法来添加图表时,你要遵从的步骤如下:
640640

641641
1. 使用你的外部工具来创建图表。
642-
1. 将图表的位置保存起来供其他贡献者访问。例如,你的工具可能提供一个指向图表的链接,
642+
2. 将图表的位置保存起来供其他贡献者访问。例如,你的工具可能提供一个指向图表的链接,
643643
或者你可以将源码文件(例如一个 `.xml` 文件)放置到一个公开的仓库,
644644
以便其他贡献者访问。
645-
1. 生成图表并将其下载为 `.svg``.png` 图片文件,保存到合适的 `../images/` 目录下。
646-
1. 使用 `{{</* figure */>}}` 短代码从 `.md` 文件中引用该图表。
645+
3. 生成图表并将其下载为 `.svg``.png` 图片文件,保存到合适的 `../images/` 目录下。
646+
4. 使用 `{{</* figure */>}}` 短代码从 `.md` 文件中引用该图表。
647647
5. 使用 `{{</* figure */>}}` 短代码的 `caption` 参数为图表设置标题。
648648

649649
<!--
@@ -686,7 +686,7 @@ For more information on K8s and CNCF logos and images, check out
686686
关于 K8s 和 CNCF 商标与图片的详细信息,可参阅 [CNCF Artwork](https://github.com/cncf/artwork)
687687

688688
<!--
689-
The following lists advantages of the External Tool method:
689+
The following lists advantages of the External Tool method:
690690
691691
* Contributor familiarity with external tool.
692692
* Diagrams require more detail than what Mermaid can offer.
@@ -699,8 +699,8 @@ Don't forget to check that your diagram renders correctly using the
699699
* 贡献者对外部工具更为熟悉
700700
* 图表可能需要 Mermaid 所无法提供的细节
701701

702-
不要忘记使用[本地](/zh-cn/docs/contribute/new-content/open-a-pr/#preview-locally)
703-
Netlify 预览来检查你的图表可以正常渲染。
702+
不要忘记使用[本地](/zh-cn/docs/contribute/new-content/open-a-pr/#preview-locally)
703+
Netlify 预览来检查你的图表可以正常渲染。
704704

705705
<!--
706706
## Examples
@@ -866,7 +866,6 @@ K8s components to start a container.
866866

867867
{{< figure src="/zh-cn/docs/images/diagram-guide-example-3.svg" alt="K8s system flow diagram" class="diagram-large" caption="图 8. K8s 系统流程图" link="https://mermaid-js.github.io/mermaid-live-editor/edit/#eyJjb2RlIjoiJSV7aW5pdDp7XCJ0aGVtZVwiOlwibmV1dHJhbFwifX0lJVxuc2VxdWVuY2VEaWFncmFtXG4gICAgYWN0b3IgbWVcbiAgICBwYXJ0aWNpcGFudCBhcGlTcnYgYXMgY29udHJvbCBwbGFuZTxicj48YnI-YXBpLXNlcnZlclxuICAgIHBhcnRpY2lwYW50IGV0Y2QgYXMgY29udHJvbCBwbGFuZTxicj48YnI-ZXRjZCBkYXRhc3RvcmVcbiAgICBwYXJ0aWNpcGFudCBjbnRybE1nciBhcyBjb250cm9sIHBsYW5lPGJyPjxicj5jb250cm9sbGVyPGJyPm1hbmFnZXJcbiAgICBwYXJ0aWNpcGFudCBzY2hlZCBhcyBjb250cm9sIHBsYW5lPGJyPjxicj5zY2hlZHVsZXJcbiAgICBwYXJ0aWNpcGFudCBrdWJlbGV0IGFzIG5vZGU8YnI-PGJyPmt1YmVsZXRcbiAgICBwYXJ0aWNpcGFudCBjb250YWluZXIgYXMgbm9kZTxicj48YnI-Y29udGFpbmVyPGJyPnJ1bnRpbWVcbiAgICBtZS0-PmFwaVNydjogMS4ga3ViZWN0bCBjcmVhdGUgLWYgcG9kLnlhbWxcbiAgICBhcGlTcnYtLT4-ZXRjZDogMi4gc2F2ZSBuZXcgc3RhdGVcbiAgICBjbnRybE1nci0-PmFwaVNydjogMy4gY2hlY2sgZm9yIGNoYW5nZXNcbiAgICBzY2hlZC0-PmFwaVNydjogNC4gd2F0Y2ggZm9yIHVuYXNzaWduZWQgcG9kcyhzKVxuICAgIGFwaVNydi0-PnNjaGVkOiA1LiBub3RpZnkgYWJvdXQgcG9kIHcgbm9kZW5hbWU9XCIgXCJcbiAgICBzY2hlZC0-PmFwaVNydjogNi4gYXNzaWduIHBvZCB0byBub2RlXG4gICAgYXBpU3J2LS0-PmV0Y2Q6IDcuIHNhdmUgbmV3IHN0YXRlXG4gICAga3ViZWxldC0-PmFwaVNydjogOC4gbG9vayBmb3IgbmV3bHkgYXNzaWduZWQgcG9kKHMpXG4gICAgYXBpU3J2LT4-a3ViZWxldDogOS4gYmluZCBwb2QgdG8gbm9kZVxuICAgIGt1YmVsZXQtPj5jb250YWluZXI6IDEwLiBzdGFydCBjb250YWluZXJcbiAgICBrdWJlbGV0LT4-YXBpU3J2OiAxMS4gdXBkYXRlIHBvZCBzdGF0dXNcbiAgICBhcGlTcnYtLT4-ZXRjZDogMTIuIHNhdmUgbmV3IHN0YXRlIiwibWVybWFpZCI6IntcbiAgXCJ0aGVtZVwiOiBcImRlZmF1bHRcIlxufSIsInVwZGF0ZUVkaXRvciI6ZmFsc2UsImF1dG9TeW5jIjp0cnVlLCJ1cGRhdGVEaWFncmFtIjp0cnVlfQ" >}}
868868

869-
870869
<!--
871870
Code block:
872871
-->
@@ -1108,12 +1107,12 @@ The following lists several items to consider when adding diagram captions:
11081107

11091108
* 使用 `{{</* figure */>}}` 短代码来为 Mermaid+SVG 和外部工具方法制作的图表添加标题。
11101109
* 对于内嵌方法制作的图表,使用简单的 Markdown 文本来为其添加标题。
1111-
* 在你的图表标题前面添加 `图 <编号>.`. 你必须使用 `` 字样,
1110+
* 在你的图表标题前面添加 `图 <编号>.`你必须使用 `` 字样,
11121111
并且编号必须对于文档页面中所有图表而言唯一。
11131112
在编号之后添加一个英文句号。
11141113
* 将图表标题添加到 `图 <编号>.` 之后,并且在同一行。
11151114
你必须为图表标题添加英文句点作为其结束标志。尽量保持标题文字简短。
1116-
* 图表标题要放在图表 __之后__
1115+
* 图表标题要放在图表**之后**
11171116

11181117
<!--
11191118
**Diagram Referral**
@@ -1248,7 +1247,7 @@ Here is the `{{</* figure */>}}` shortcode for this diagram:
12481247

12491248
* Hugo Mermaid 短代码在在线编辑器中无法显示。
12501249

1251-
* 如果你想要在在线编辑器中更改图表,你 __必须__ 保存它以便为图表生成新的 URL。
1250+
* 如果想要在在线编辑器中更改图表,你**必须**保存它以便为图表生成新的 URL。
12521251

12531252
* 点击本节中的图表,你可以查看其源代码及其在在线编辑器中的渲染效果。
12541253
<!--
@@ -1259,13 +1258,12 @@ Here is the `{{</* figure */>}}` shortcode for this diagram:
12591258
-->
12601259
* 查看本页的源代码,`diagram-guide.md` 文件,可以将其作为示例。
12611260

1262-
* 查阅 [Mermaid docs](https://mermaid-js.github.io/mermaid/#/) 以获得更多的解释和示例。
1261+
* 查阅 [Mermaid 文档](https://mermaid-js.github.io/mermaid/#/)以获得更多的解释和示例。
12631262

12641263
<!--
12651264
Most important, __Keep Diagrams Simple__.
12661265
This will save time for you and fellow contributors, and allow for easier reading
12671266
by new and experienced users.
12681267
-->
1269-
最重要的一点,__保持图表简单__
1268+
最重要的一点,**保持图表简单**
12701269
这样做会节省你和其他贡献者的时间,同时也会方便新的以及有经验的用户阅读。
1271-

content/zh-cn/docs/contribute/style/hugo-shortcodes/index.md

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ This page explains the custom Hugo shortcodes that can be used in Kubernetes Mar
1919
<!--
2020
Read more about shortcodes in the [Hugo documentation](https://gohugo.io/content-management/shortcodes).
2121
-->
22-
关于短代码的更多信息可参见 [Hugo 文档](https://gohugo.io/content-management/shortcodes)
22+
关于短代码的更多信息可参见
23+
[Hugo 文档](https://gohugo.io/content-management/shortcodes)
2324

2425
<!-- body -->
2526

@@ -86,6 +87,37 @@ Renders to:
8687

8788
{{< feature-state for_k8s_version="v1.10" state="beta" >}}
8889

90+
<!--
91+
## Feature gate description
92+
93+
In a Markdown page (`.md` file) on this site, you can add a shortcode to
94+
display the description for a shortcode.
95+
-->
96+
## 特性门控介绍
97+
98+
在此站点上的 Markdown 页面(`.md` 文件)中,你可以添加短代码来显示短代码的描述。
99+
100+
<!--
101+
### Feature gate description demo
102+
103+
Below is a demo of the feature state snippet, which displays the feature as
104+
stable in the latest Kubernetes version.
105+
-->
106+
### 特性门控 Demo 演示
107+
108+
下面是特性状态片段的 Demo,它显示该特性在最新的 Kubernetes 版本中处于稳定状态。
109+
110+
```
111+
{{</* feature-gate-description name="DryRun" */>}}
112+
```
113+
114+
<!--
115+
Renders to:
116+
-->
117+
渲染到:
118+
119+
{{< feature-gate-description name="DryRun" >}}
120+
89121
<!--
90122
## Glossary
91123
There are two glossary shortcodes: `glossary_tooltip` and `glossary_definition`.
@@ -184,7 +216,6 @@ The content of the `page` parameter is the suffix of the URL of the API referenc
184216
-->
185217
本语句中 `page` 参数的内容是 API 参考页面的 URL 后缀。
186218

187-
188219
<!--
189220
You can link to a specific place into a page by specifying an `anchor`
190221
parameter, for example to the {{< api-reference page="workload-resources/pod-v1" anchor="PodSpec" >}}
@@ -208,15 +239,13 @@ example by linking to the
208239
{{< api-reference page="workload-resources/pod-v1" anchor="environment-variables" text="Environment Variables">}}
209240
section of the page:
210241
-->
211-
你可以通过指定 `text` 参数来更改链接的文本,例如通过链接到页面的
212-
{{< api-reference page="workload-resources/pod-v1" anchor="environment-variables" text="环境变量">}}
213-
部分:
242+
你可以通过指定 `text` 参数来更改链接的文本,
243+
例如通过链接到页面的{{< api-reference page="workload-resources/pod-v1" anchor="environment-variables" text="环境变量">}}部分:
214244

215245
```
216246
{{</* api-reference page="workload-resources/pod-v1" anchor="environment-variables" text="环境变量" */>}}
217247
```
218248

219-
220249
<!--
221250
## Table captions
222251
@@ -285,8 +314,8 @@ after the opening `<table>` element:
285314
<caption style="display: none;">Configuration parameters</caption>
286315
```
287316
-->
288-
如果你查看表格的 HTML 输出结果,你会看到 `<table>` 元素
289-
后面紧接着下面的元素
317+
如果你查看表格的 HTML 输出结果,你会看到 `<table>`
318+
元素后面紧接着下面的元素
290319

291320
```html
292321
<caption style="display: none;">配置参数</caption>
@@ -390,7 +419,7 @@ println "This is tab 2."
390419
```go-html-template
391420
{{</* tabs name="tab_with_md" >}}
392421
{{% tab name="Markdown" %}}
393-
这是 **一些 markdown。**
422+
这是**一些 markdown。**
394423
{{< note >}}
395424
它甚至可以包含短代码。
396425
{{< /note >}}
@@ -411,7 +440,7 @@ Renders to:
411440

412441
{{< tabs name="tab_with_md" >}}
413442
{{% tab name="Markdown" %}}
414-
这是 **一些 markdown。**
443+
这是**一些 markdown。**
415444
{{< note >}}
416445
它甚至可以包含短代码。
417446
{{< /note >}}
@@ -493,7 +522,7 @@ the page. In the markdown of your page, use the `code` shortcode:
493522
-->
494523
添加新的示例文件(例如 YAML 文件)时,在 `<LANG>/examples/`
495524
子目录之一中创建该文件,其中 `<LANG>` 是页面的语言。
496-
在你的页面的 markdown 文本中,使用 `code` 短代码:
525+
在你的页面的 Markdown 文本中,使用 `code` 短代码:
497526

498527
```none
499528
{{%/* code_sample file="<RELATIVE-PATH>/example-yaml>" */%}}
@@ -661,7 +690,8 @@ Renders to:
661690
-->
662691
### `{{</* latest-semver */>}}`
663692

664-
`{{</* latest-semver */>}}` 短代码可以生成站点参数 `latest` 不含前缀 `v` 的版本号取值。
693+
`{{</* latest-semver */>}}` 短代码可以生成站点参数 `latest` 不含前缀
694+
`v` 的版本号取值。
665695

666696
转换为:
667697

content/zh-cn/docs/contribute/style/write-new-topic.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ URL for the topic, for example:
8484

8585
选择一个标题,确保其中包含希望搜索引擎发现的关键字。
8686
确定文件名时请使用标题中的单词,由连字符分隔。
87-
例如,标题为[Using an HTTP Proxy to Access Kubernetes API](/zh-cn/docs/tasks/extend-kubernetes/http-proxy-access-api/)
87+
例如,标题为[使用 HTTP 代理访问 Kubernetes API](/zh-cn/docs/tasks/extend-kubernetes/http-proxy-access-api/)
8888
的主题的文件名为 `http-proxy-access-api.md`
8989
你不需要在文件名中加上 "kubernetes",因为 "kubernetes" 已经在主题的 URL 中了,
9090
例如:
@@ -186,7 +186,7 @@ following cases (not an exhaustive list):
186186
- The code is not generic enough for users to try out. As an example, you can
187187
embed the YAML
188188
file for creating a Pod which depends on a specific
189-
[FlexVolume](/docs/concepts/storage/volumes#flexvolume) implementation.
189+
[FlexVolume](/docs/concepts/storage/volumes/#flexvolume) implementation.
190190
- The code is an incomplete example because its purpose is to highlight a
191191
portion of a larger file. For example, when describing ways to
192192
customize a [RoleBinding](/docs/reference/access-authn-authz/rbac/#role-binding-examples),
@@ -199,7 +199,7 @@ following cases (not an exhaustive list):
199199

200200
- 代码显示来自命令的输出,例如 `kubectl get deploy mydeployment -o json | jq '.status'`
201201
- 代码不够通用,用户无法验证。例如,你可以嵌入 YAML 文件来创建一个依赖于特定
202-
[FlexVolume](/zh-cn/docs/concepts/storage/volumes#flexvolume) 实现的 Pod。
202+
[FlexVolume](/zh-cn/docs/concepts/storage/volumes/#flexvolume) 实现的 Pod。
203203
- 该代码是一个不完整的示例,因为其目的是突出展现某个大文件中的部分内容。
204204
例如,在描述
205205
[RoleBinding](/zh-cn/docs/reference/access-authn-authz/rbac/#role-binding-examples)

0 commit comments

Comments
 (0)