Skip to content

Commit dbd7d5a

Browse files
authored
docs: add markdownlint rules for mo docs (#2994)
* docs: add markdownlint rules for mo docs Signed-off-by: Aylei <[email protected]> * docs: add lint docs github action Signed-off-by: Aylei <[email protected]> * docs: better check name Signed-off-by: Aylei <[email protected]> * docs: fix docs automatically using markdown-lint Signed-off-by: Aylei <[email protected]> * fix markdown lint rule file path Signed-off-by: Aylei <[email protected]> * docs: fix link of cube auto-rebalance Signed-off-by: Aylei <[email protected]>
1 parent fa18348 commit dbd7d5a

File tree

204 files changed

+945
-664
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+945
-664
lines changed

Diff for: .github/workflows/lint_docs.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Lint Docs
2+
3+
on:
4+
pull_request:
5+
types: [ opened, synchronize, reopened ]
6+
branches: [main]
7+
paths:
8+
- 'docs/cn/**'
9+
- 'docs/en/**'
10+
workflow_dispatch:
11+
12+
jobs:
13+
lint-docs:
14+
name: Lint Docs
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Check out code
18+
uses: actions/checkout@v2
19+
20+
- name: Lint docs
21+
uses: docker://avtodev/markdown-lint:v1 # fastest way
22+
with:
23+
config: './.markdownlint.yaml'
24+
args: './docs/cn ./docs/en'

Diff for: .markdownlint.yaml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# disable all by default
2+
default: false
3+
4+
# MD003
5+
heading-style:
6+
style: atx
7+
8+
# MD012
9+
no-multiple-blanks: true
10+
11+
# MD018
12+
no-missing-space-atx: true
13+
14+
# MD019
15+
no-multiple-space-atx: true
16+
17+
# MD022
18+
blanks-around-headings: true
19+
20+
# MD023
21+
heading-start-left: true
22+
23+
# MD024
24+
no-duplicate-heading:
25+
siblings_only: true
26+
27+
# MD026
28+
no-trailing-punctuation:
29+
punctuation: '.,;:!。,;:!'
30+
31+
# MD027
32+
no-multiple-space-blockquote: true
33+
34+
# MD030
35+
list-marker-space: true
36+
37+
# MD031
38+
blanks-around-fences: true
39+
40+
# MD032
41+
blanks-around-lists: true
42+
43+
# MD034
44+
no-bare-urls: true
45+
46+
# MD037
47+
no-space-in-emphasis: true
48+
49+
# MD038
50+
no-space-in-code: true
51+
52+
# MD039
53+
no-space-in-links: true
54+
55+
# MD042
56+
no-empty-links: true

Diff for: docs/cn/MatrixOne/Contribution-Guide/Code-Style/code-comment-style.md

-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
- 如果代码并非最优,但你现在没有更好的方法
2121
- 提醒自己或其他人代码中存在缺失的功能或即将开发的功能
2222

23-
2423
以下部分也需要进行注释:
2524

2625
- Package (Go)
@@ -53,8 +52,6 @@
5352
- 如果文本链接到同一个GitHub存储库中的文件,则使用 **relative URL**
5453
- 如果带有此注释的代码是从另一个存储库复制来的,则使用 **absolute URL**
5554

56-
57-
5855
### 语言
5956

6057
- 单词

Diff for: docs/cn/MatrixOne/Contribution-Guide/Code-Style/code-of-conduct.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
## 共同的承诺
44

5-
65
我们作为项目与社区的贡献者和维护者,承诺在参与项目以及社区的过程中,致力于彼此帮助、共同成长,维护开源开放、和谐友善的氛围,无论年龄、体型、种族、性别、性取向、表达、经验、教育、社会经济地位、国籍、个人外貌、国家、宗教。
76

87
## 行为准则
@@ -29,22 +28,19 @@
2928

3029
项目维护人员有权利也有责任删除、编辑或拒绝不符合上述行为准则的评论、提交、代码、wiki编辑和issue,并暂时或永久封禁发表不当言论或做出不当行为的贡献者。
3130

32-
3331
## 适用范围
34-
本行为守则适用于所有项目空间,以及任何代表项目、社区的公开发言。比如:使用官方的项目电子邮件地址,通过官方社交媒体账户发布信息,或作为指定代表参加线上线下活动。具体条件由项目管理者进一步明确。
3532

33+
本行为守则适用于所有项目空间,以及任何代表项目、社区的公开发言。比如:使用官方的项目电子邮件地址,通过官方社交媒体账户发布信息,或作为指定代表参加线上线下活动。具体条件由项目管理者进一步明确。
3634

3735
## 具体实施
3836

3937
若您发现任何侮辱、骚扰或其他不合规定的行为都可以报告给项目团队:`[email protected]`。我们将深入审核、调查所有的投诉并且做出及时、合理的反馈。此外,项目团队有义务保护举报人的隐私安全。
4038
更加具体的执行政策将另行公布。
4139

42-
43-
4440
## Attribution
4541

46-
本篇行为守则改编自[贡献者公约][homepage],version 1.4,也可参见 https://www.contributor-covenant.org/version/1/4/code-of-conduct.html。
42+
本篇行为守则改编自[贡献者公约][homepage],version 1.4,也可参见 <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>
4743

4844
[homepage]: https://www.contributor-covenant.org
4945

50-
相关问题的回答可参见:https://www.contributor-covenant.org/faq
46+
相关问题的回答可参见:<https://www.contributor-covenant.org/faq>

Diff for: docs/cn/MatrixOne/Contribution-Guide/Code-Style/commit-pr-style.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
1. **What is your change? (必要)**
1818

19-
2019
它可能修复了一个特定的bug,添加了一个feature,提高了性能、可靠性或稳定性,或者只是保障安全性而进行的更改。
2120

2221
2. **Why this change was made? (必要)**
@@ -49,6 +48,7 @@
4948
- 如果该改动影响了三个及以上的模块,请使用`*`,如`*:`
5049
- 在冒号后的文本中使用小写字母。例如:"media: **update** the DM architecture image"
5150
- 不要在最后添加句号。
51+
5252
- 第二行请留白
5353
- 第三行“why”部分,如果没有特定的原因,您可以使用以下表述,如"Improve performance", "Improve test coverage."
5454
- 其他行不超过80个字符。
@@ -72,12 +72,10 @@
7272
- 不要使用过长的复合词
7373
- 非必要不缩写
7474

75-
7675
## **Pull Request规范**
7776

7877
关于Pull Request中的描述,请参考下面的Pull Request模板,涵盖必要信息:
7978

80-
8179
```
8280
**What type of PR is this?**
8381

Diff for: docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/contribute-code.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# **代码贡献**
2+
23
MatrixOne是一个由项目管理者、社区开发者共同维护、改进和扩展的开源项目。
34
本文档主要描述了开发的准则与一般流程,并提供了在编写代码、提交PR过程中需要使用的样式和模板。如果您在参与MatrixOne的贡献过程中遇到任何问题或发现一些错误,请在Github上提出[issue](https://github.com/matrixorigin/matrixone/issues) 或通其他平台联系我们。
45

56
## **前置准备**
6-
在正式开发之前,请确保您已经阅读了[准备工作](preparation.md), 已经对MatrixOne的核心理念、基础架构有一定了解,并准备好了开发所需要的相应环境、语言、工具等。
77

8+
在正式开发之前,请确保您已经阅读了[准备工作](preparation.md), 已经对MatrixOne的核心理念、基础架构有一定了解,并准备好了开发所需要的相应环境、语言、工具等。
89

910
## **风格规范指南** <a name="get-familiar-with-style"></a>
11+
1012
在对MatrixOne进行开发和完善时,应该使代码、代码注释、提交信息(Committing Message)和拉取请求(Pull Request,简称PR)保持一致的风格。当您提交PR时,我们强烈建议您确保所作出的修改符合我们的一贯风格,这不仅会提高PR的通过率,并且也能使MatrixOne易于审查、维护和进一步开发。
1113

1214
* **代码规范**
@@ -19,41 +21,53 @@ MatrixOne采用了Golang社区建议的编码规范,详情请见 [Effective Go
1921
可参考[Commit&PR规范](../Code-Style/code-comment-style.md)
2022

2123
## **一般工作流程<c name="workflow"></c>**
24+
2225
您可以按照以下工作流程来进行开发并在Github上提交修改,如果您还需要更加详细的解释,可以查看[Make Your First Contribution](../make-your-first-contribution.md)
2326

2427
**1.** 在Github上 Fork [matrixorigin/matrixone仓库](https://github.com/matrixorigin/matrixone).
2528

2629
**2.** 将 Fork 的仓库克隆至本地:
30+
2731
```
2832
git clone [email protected]:<yourname>/matrixone.git
2933
```
34+
3035
并且把matrixone仓库添加为远程仓库:
36+
3137
```
3238
git remote add upstream https://github.com/matrixorigin/matrixone.git
3339
```
40+
3441
**3.** 创建一个新的分支,分支名自定义:
42+
3543
```
3644
git checkout -b topic-branch
3745
```
46+
3847
**4.** 在本地进行开发,完成相关修改,并完成必要的单元测试,最后进行提交。
3948

4049
**5.** 将修改推送至仓库的一个新分支:
50+
4151
```
4252
git push origin main:NEW_BRANCH
4353
```
54+
4455
**6.** 在仓库中的新分支`NEW_BRANCH`中创建 Pull Request,并添加相应标签、[建立与相关issue的关联](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
4556
4657
**7.** PR通过后,覆盖本地提交历史:
58+
4759
```
4860
git pull --force upstream main:main
4961
```
62+
5063
**8.** 更新您的仓库的`main` 分支:
64+
5165
```
5266
git push --force origin main:main
5367
```
5468

5569
如果您仍然有一些困惑,可以参考 [GitHub官方文档](https://docs.github.com/en) 寻求帮助;若您发现我们提供的工作流程有错误或想要提出改善的方法,欢迎您[提出建议](https://github.com/matrixorigin/matrixone/issues/new/choose)
5670

5771
## **代码审阅**
58-
当您创建PR请求时,您可以指定一些审阅者,或者留空。并且您可以添加一些相关的标签,这样更容易识别PR的类型、优先级等。在代码审阅期间,审阅者会对您的代码片段给出意见,您可以相应地在本地修改您的分支上的代码,提交更改,然后推送到GitHub,新的提交会自动附加到PR上。
5972

73+
当您创建PR请求时,您可以指定一些审阅者,或者留空。并且您可以添加一些相关的标签,这样更容易识别PR的类型、优先级等。在代码审阅期间,审阅者会对您的代码片段给出意见,您可以相应地在本地修改您的分支上的代码,提交更改,然后推送到GitHub,新的提交会自动附加到PR上。

Diff for: docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/contribute-documentation.md

+16-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66

77
开始之前请尽量熟悉基本的[Markdown](https://www.markdownguide.org/basic-syntax/)语法并阅读[行为守则](../Code-Style/code-of-conduct.md)[谷歌开发者文档风格指南](https://developers.google.com/style/),以便您写出更高质量的文档。
88

9-
10-
119
## **文档管理逻辑**
10+
1211
MatrixOne文档通过三个仓库来协调管理:
1312

1413
* [matrixorigin.io](https://github.com/matrixorigin/matrixorigin.io)仓库包含文档框架(配置文件)和CI设置
@@ -18,13 +17,16 @@ MatrixOne文档通过三个仓库来协调管理:
1817
* [artwork](https://github.com/matrixorigin/artwork) 仓库包含了文档所用到的图像等非结构性文件
1918

2019
`matrixorigin.io`仓库中有一个子模块`submodule`,其引用了`matrixone`仓库中的文档内容,当`matrixone`仓库的内容更新时,`submodule`也会同步更新;而图像等非结构化文件则直接引用`artwork`仓库的网站链接,如:
20+
2121
```
2222
https://github.com/matrixorigin/artwork/blob/main/docs/overview/overall-architecture.png?raw=true
2323
```
24+
2425
`matrixorigin.io`部署了一个CI程序,当有新的代码被合并时将自动触发,将文档发布到我们的[官方文档网站](https://docs.matrixorigin.io/)
2526
我们的文档是基于 [mkdocs-material](https://github.com/squidfunk/mkdocs-material)组件进行开发的,您可以在此链接中了解更多信息。
2627

2728
## **文档内容架构**
29+
2830
MatrixOne文档内容可以分为如下几个模块:
2931

3032
* **Overview**: MatrixOne的简介,包含了项目特点、架构、设计思路和技术细节。
@@ -46,6 +48,7 @@ MatrixOne文档内容可以分为如下几个模块:
4648
如果您发现了错别字或语法错误,可以点击本页面的`Edit this Page`按键直接进行修改。
4749

4850
## **一般工作流程**
51+
4952
当您需要更改文档的具体内容但不涉及章节顺序、架构组织的调整时,只需要对`matrixone`进行操作;反之,若您需要调整文档框架,改动`mkdocs.yml`文件时,则需要对`matrixorigin.io`库进行修改。
5053
以下流程演示的是对二者均做修改的情况,实际情况可以根据您的需求进行简化。
5154

@@ -54,24 +57,31 @@ MatrixOne文档内容可以分为如下几个模块:
5457
**2.** Fork [matrixorigin.io](https://github.com/matrixorigin/matrixorigin.io)[matrixone](https://github.com/matrixorigin/matrixone) 仓库.
5558

5659
**3.** 克隆[matrixorigin.io](https://github.com/matrixorigin/matrixorigin.io)仓库,使用`--repository`来引用`matrixone`中的内容。
60+
5761
```
5862
$ git clone --recursive [email protected]:yourusername/matrixorigin.io.git
5963
```
64+
6065
克隆[matrixone](https://github.com/matrixorigin/matrixorigin.io)仓库。
66+
6167
```
6268
$ git clone [email protected]:yourusername/matrixone.git
6369
```
6470

6571
**4.** 在您的本地matrixone文件夹中将`matrixone`仓库添加为远程仓库。
72+
6673
```
6774
git remote add upstream https://github.com/matrixorigin/matrixone.git
6875
```
76+
6977
在您的本地matrixorigin.io文件夹中将`matrixorigin.io`仓库添加为远程仓库。
78+
7079
```
7180
git remote add upstream https://github.com/matrixorigin/matrixorigin.io.git
7281
```
7382

7483
**5.** 本地的matrixorigin.io文件夹中将包含文档所需要的全部文件,因此您可以运行 `mkdocs serve` 命令, 然后在`http://localhost:8000`网址中预览文档,检查整个项目文件是否可以正常运行,并且后续也可以检查您所做的修改是否正确。
84+
7585
```
7686
$ mkdocs serve
7787
```
@@ -81,6 +91,7 @@ $ mkdocs serve
8191

8292
**7.** 确认修改无误后,使用`git add``git commit`命令在本地提交修改,并推送至您Fork的远程仓库`matrixorigin.io``matrixone`
8393
我们建议您推送至远程仓库的新分支:
94+
8495
```
8596
git push origin main:NEW_BRANCH
8697
```
@@ -92,18 +103,20 @@ git push origin main:NEW_BRANCH
92103
**10.** 最后,还有一些操作可以帮助保持MatrixOne远端仓库,您的远端仓库和本地仓库均保持一致。
93104

94105
覆盖本地提交历史:
106+
95107
```
96108
git pull --force upstream main:main
97109
```
110+
98111
更新Github上的`main`分支:
112+
99113
```
100114
git push --force origin main:main
101115
```
102116

103117
!!! info 注意
104118
若您在两个仓库都做了修改,那么以上大部分操作都需要分别针对两个仓库都执行一遍。
105119

106-
107120
## **写一篇博文**
108121

109122
如果您有意写一篇关于MatrixOne的博文,请在GitHub上提出[issue](https://github.com/matrixorigin/matrixone/issues/new/choose) ,或者将您的想法发送到[[email protected]](mailto:[email protected]),无论是简单的idea还是完整的草案,我们统统接受。我们会尽快审查所有内容,如果您的文章或想法很契合我们的博客,我们会直接联系您。

Diff for: docs/cn/MatrixOne/Contribution-Guide/How-to-Contribute/make-a-design.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# **提交设计方案**
2+
23
前面章节提到了很多种类的修改,比如bug修复、文档完善,这些都可以通过GitHub的PR工作流程来实现;但与此不同的是,如果您想要在MatrixOne中实现新的功能或增添新的组件,都不仅仅是一个idea这么简单,我们鼓励您提出想法的同时还制定相应的设计方案,将其表达为技术设计文档。
34
因此,本节的目的正是引导您撰写一份技术设计文档,以期可以为这个新功能提供一个更加权威的、大众化的解释,各方人员可以更深入地了解这个模块的核心理念与发展方向。
45

@@ -8,8 +9,8 @@
89
我们鼓励您向有经验的开发人员寻求帮助,通过他们的建议您可以修正设计架构并完善技术细节。
910
您可以在前往Github,提交一个`Feature Request``Refactoring Request`来向大家展示您的想法。
1011

11-
1212
## **一般流程**
13+
1314
通常,从头到尾地完成一项技术设计需要以下步骤:
1415

1516
* 在GitHub上提出issue,描述该功能想要解决的问题、目标、大致解决方案。

0 commit comments

Comments
 (0)