Skip to content

Commit 0823a19

Browse files
authored
[zh] Add anchors and tweak lines in style-guide.md (#5430)
Signed-off-by: windsonsea <[email protected]>
1 parent 418b15e commit 0823a19

File tree

2 files changed

+36
-24
lines changed

2 files changed

+36
-24
lines changed

.htmltest.yml

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ CheckMailto: false
88
TestFilesConcurrently: true
99
IgnoreDirs:
1010
- ^blog/(\d+/)?page/\d+
11-
# TODO drop after https://github.com/open-telemetry/opentelemetry.io/issues/5267 is fixed:
12-
- zh/docs/contributing/pr-checks
1311
# TODO drop after https://github.com/open-telemetry/opentelemetry.io/issues/5423 is fixed:
1412
- (ja|pt)/docs/concepts/instrumentation/libraries/
1513
IgnoreInternalURLs: # list of paths

content/zh/docs/contributing/style-guide.md

+36-22
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: 编写 OpenTelemetry 文档时的术语和风格指南。
44
linkTitle: 风格指南
55
weight: 20
66
cSpell:ignore: open-telemetry postgre style-guide textlintrc
7-
default_lang_commit: d78e63a
7+
default_lang_commit: 2394fa1f1c693e547093e46e83a6819d3c26e9d5
88
---
99

1010
OpenTelemetry 还没有官方的风格指南,当前版本的 OpenTelemetry 文档风格受到以下风格指南的启发:
@@ -23,42 +23,52 @@ OpenTelemetry 还没有官方的风格指南,当前版本的 OpenTelemetry 文
2323

2424
{{% /alert %}}
2525

26-
## OpenTelemetry.io 单词列表
26+
## OpenTelemetry.io 单词列表 {#opentelemetryio-word-list}
2727

2828
请在整个网站上统一使用以下 OpenTelemetry 特定术语和词语列表。
2929

3030
<!-- prettier-ignore-start -->
3131

32-
| Term | Usage |
33-
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
34-
| OpenTelemetry | OpenTelemetry 应始终大写。请勿使用 Open-Telemetry。 |
35-
| OTel | OTel 是 OpenTelemetry 的公认缩写形式。请勿使用 OTEL。 |
36-
| Collector | 当引用 OpenTelemetry Collector 时,请始终将 Collector 大写。在句子开头请使用 `The Collector``The Opentelemetry Collector`, 在句中或句尾则使用 `the Collector``the OpenTelemetry Collector`。如果您要将 Collector 用作形容词(例如, `Collector 配置` ),请只使用 `Collector`|
37-
| OTEP | OpenTelemetry 增强提案(OpenTelemetry Enhancement Proposal)。复数形式请写作 `OTEPs` 。请不要写成 `OTep``otep` |
38-
| OpAMP | 开放代理管理协议(Open Agent Management Protocol)。请勿在描述或说明中写成 `OPAMP``opamp` |
39-
| <!-- prettier-ignore-end --> | |
32+
| 术语 | 用法 |
33+
| ---- | ----- |
34+
| OpenTelemetry | OpenTelemetry 应始终大写。请勿使用 Open-Telemetry。|
35+
| OTel | OTel 是 OpenTelemetry 的公认缩写形式。请勿使用 OTEL。|
36+
| Collector | 当引用 OpenTelemetry Collector 时,请始终将 Collector 大写。在句子开头请使用 `The Collector``The Opentelemetry Collector`, 在句中或句尾则使用 `the Collector``the OpenTelemetry Collector`。如果您要将 Collector 用作形容词(例如, `Collector 配置` ),请只使用 `Collector`|
37+
| OTEP | OpenTelemetry 增强提案(OpenTelemetry Enhancement Proposal)。复数形式请写作 `OTEPs` 。请不要写成 `OTep``otep`|
38+
| OpAMP | 开放代理管理协议(Open Agent Management Protocol)。请勿在描述或说明中写成 `OPAMP``opamp`|
39+
<!-- prettier-ignore-end -->
4040

41-
确保正确书写专有名词(例如其他 CNCF 项目或第三方工具)并使用原始大写字母。例如,书写 `PostgreSQL` 而不是 `postgre`。有关完整列表,请查看 [`.textlintrc.yml`](https://github.com/open-telemetry/opentelemetry.io/blob/main/.textlintrc.yml) 文件。
41+
确保正确书写专有名词(例如其他 CNCF 项目或第三方工具)并使用原始大写字母。例如,
42+
书写 `PostgreSQL` 而不是 `postgre`。有关完整列表,请查看
43+
[`.textlintrc.yml`](https://github.com/open-telemetry/opentelemetry.io/blob/main/.textlintrc.yml) 文件。
4244

4345
另请参阅 [词汇表](/docs/concepts/glossary/) 以获取 OpenTelemetry术语及其定义的列表。
4446

4547
运行 `npm run check:text` 命令以验证所有术语和单词是否书写正确。
4648

4749
运行 `npm run check:text -- --fix` 命令以修复书写不正确的术语和单词。
4850

49-
## Markdown 标准
51+
## Markdown 标准 {#markdown-standards}
5052

51-
为了增强 Markdown 文件的标准性和一致性,所有文件都应遵循 [markdownlint](https://github.com/DavidAnson/markdownlint) 确定的相关规则。有关完整列表,请查看 [`.markdownlint.json`](https://github.com/open-telemetry/opentelemetry.io/blob/main/.markdownlint.json) 文件。
53+
为了增强 Markdown 文件的标准性和一致性,所有文件都应遵循
54+
[markdownlint](https://github.com/DavidAnson/markdownlint)
55+
确定的相关规则。有关完整列表,请查看
56+
[`.markdownlint.json`](https://github.com/open-telemetry/opentelemetry.io/blob/main/.markdownlint.json)
57+
文件。
5258

5359
运行 `npm run check:markdown` 命令以验证所有文件是否遵循标准。
5460

5561
运行 `npm run fix:markdown` 命令以修复与 Markdown 相关的格式问题。
5662

57-
## 拼写检查
63+
## 拼写检查 {#spell-checking}
5864

59-
使用 [CSpell](https://github.com/streetsidesoftware/cspell) 确保所有文本拼写正确。有关 OpenTelemetry 网站特定单词的列表,请参阅 [`.cspell.yml`](https://github.com/open-telemetry/opentelemetry.io/blob/main/.cspell.yml) 文件。
65+
使用 [CSpell](https://github.com/streetsidesoftware/cspell) 确保所有文本拼写正确。
66+
有关 OpenTelemetry 网站特定单词的列表,请参阅
67+
[`.cspell.yml`](https://github.com/open-telemetry/opentelemetry.io/blob/main/.cspell.yml) 文件。
6068

61-
运行 `npm run check:spelling` 命令以验证所有单词拼写是否正确。如果 `cspell` 指示 `Unknown word` 错误,请验证您是否正确编写了该单词。如果正确,请将此单词添加到文件顶部的 `cSpell:ignore` 部分。如果不存在这样的部分,您可以将其添加到 Markdown 文件的元数据中:
69+
运行 `npm run check:spelling` 命令以验证所有单词拼写是否正确。如果 `cspell` 指示
70+
`Unknown word` 错误,请验证您是否正确编写了该单词。如果正确,请将此单词添加到文件顶部的
71+
`cSpell:ignore` 部分。如果不存在这样的部分,您可以将其添加到 Markdown 文件的元数据中:
6272

6373
```markdown
6474
---
@@ -67,19 +77,23 @@ cSpell:ignore: <word>
6777
---
6878
```
6979

70-
对于任何其他文件,请在适合文件上下文的注释行中添加 `cSpell:ignore <word>`。对于 [registry](/ecosystem/registry/) 条目 YAML 文件,它可能看起来像这样:
80+
对于任何其他文件,请在适合文件上下文的注释行中添加 `cSpell:ignore <word>`
81+
对于 [registry](/ecosystem/registry/) 条目 YAML 文件,它可能看起来像这样:
7182

7283
```yaml
7384
# cSpell:ignore <word>
7485
title: registryEntryTitle
7586
```
7687
77-
网站工具通过移除重复单词、删除全局单词列表中的单词以及对单词进行排序来规范特定于页面的词典(即 `cSpell:ignore` 单词列表)。要规范特定于页面的词典,请运行 `npm run fix:dict`。
88+
网站工具通过移除重复单词、删除全局单词列表中的单词以及对单词进行排序来规范特定于页面的词典(即
89+
`cSpell:ignore` 单词列表)。要规范特定于页面的词典,请运行 `npm run fix:dict`。
7890

79-
## 文件格式
91+
## 文件格式 {#file-format}
8092

81-
为了执行关于文件结构的特定标准,所有文件都应使用 [prettier](https://prettier.io) 进行格式化。在提交 PR 之前运行 `npm run fix:format`,或者在提交 PR 之后运行它并推送额外的提交。
93+
为了执行关于文件结构的特定标准,所有文件都应使用 [prettier](https://prettier.io)
94+
进行格式化。在提交 PR 之前运行 `npm run fix:format`,或者在提交 PR 之后运行它并推送额外的提交。
8295

83-
## 文件名
96+
## 文件名 {#file-names}
8497

85-
所有文件名都应采用[短横线命名](https://en.wikipedia.org/wiki/Letter_case#Kebab_case)。运行 `npm run fix:filenames` 以自动重命名文件。
98+
所有文件名都应采用[短横线命名](https://en.wikipedia.org/wiki/Letter_case#Kebab_case)。
99+
运行 `npm run fix:filenames` 以自动重命名文件。

0 commit comments

Comments
 (0)