Skip to content

Commit

Permalink
docs: add markdownlint rules for mo docs (#2994)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
aylei authored Jun 14, 2022
1 parent fa18348 commit dbd7d5a
Show file tree
Hide file tree
Showing 204 changed files with 945 additions and 664 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/lint_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint Docs

on:
pull_request:
types: [ opened, synchronize, reopened ]
branches: [main]
paths:
- 'docs/cn/**'
- 'docs/en/**'
workflow_dispatch:

jobs:
lint-docs:
name: Lint Docs
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Lint docs
uses: docker://avtodev/markdown-lint:v1 # fastest way
with:
config: './.markdownlint.yaml'
args: './docs/cn ./docs/en'
56 changes: 56 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# disable all by default
default: false

# MD003
heading-style:
style: atx

# MD012
no-multiple-blanks: true

# MD018
no-missing-space-atx: true

# MD019
no-multiple-space-atx: true

# MD022
blanks-around-headings: true

# MD023
heading-start-left: true

# MD024
no-duplicate-heading:
siblings_only: true

# MD026
no-trailing-punctuation:
punctuation: '.,;:!。,;:!'

# MD027
no-multiple-space-blockquote: true

# MD030
list-marker-space: true

# MD031
blanks-around-fences: true

# MD032
blanks-around-lists: true

# MD034
no-bare-urls: true

# MD037
no-space-in-emphasis: true

# MD038
no-space-in-code: true

# MD039
no-space-in-links: true

# MD042
no-empty-links: true
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
- 如果代码并非最优,但你现在没有更好的方法
- 提醒自己或其他人代码中存在缺失的功能或即将开发的功能


以下部分也需要进行注释:

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



### 语言

- 单词
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

## 共同的承诺


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

## 行为准则
Expand All @@ -29,22 +28,19 @@

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


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

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

## 具体实施

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



## Attribution

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

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

相关问题的回答可参见:https://www.contributor-covenant.org/faq
相关问题的回答可参见:<https://www.contributor-covenant.org/faq>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

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


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

2. **Why this change was made? (必要)**
Expand Down Expand Up @@ -49,6 +48,7 @@
- 如果该改动影响了三个及以上的模块,请使用`*`,如`*:`
- 在冒号后的文本中使用小写字母。例如:"media: **update** the DM architecture image"
- 不要在最后添加句号。

- 第二行请留白
- 第三行“why”部分,如果没有特定的原因,您可以使用以下表述,如"Improve performance", "Improve test coverage."
- 其他行不超过80个字符。
Expand All @@ -72,12 +72,10 @@
- 不要使用过长的复合词
- 非必要不缩写


## **Pull Request规范**

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


```
**What type of PR is this?**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# **代码贡献**

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

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

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

## **风格规范指南** <a name="get-familiar-with-style"></a>

在对MatrixOne进行开发和完善时,应该使代码、代码注释、提交信息(Committing Message)和拉取请求(Pull Request,简称PR)保持一致的风格。当您提交PR时,我们强烈建议您确保所作出的修改符合我们的一贯风格,这不仅会提高PR的通过率,并且也能使MatrixOne易于审查、维护和进一步开发。

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

## **一般工作流程<c name="workflow"></c>**

您可以按照以下工作流程来进行开发并在Github上提交修改,如果您还需要更加详细的解释,可以查看[Make Your First Contribution](../make-your-first-contribution.md)

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

**2.** 将 Fork 的仓库克隆至本地:

```
git clone [email protected]:<yourname>/matrixone.git
```

并且把matrixone仓库添加为远程仓库:

```
git remote add upstream https://github.com/matrixorigin/matrixone.git
```

**3.** 创建一个新的分支,分支名自定义:

```
git checkout -b topic-branch
```

**4.** 在本地进行开发,完成相关修改,并完成必要的单元测试,最后进行提交。

**5.** 将修改推送至仓库的一个新分支:

```
git push origin main:NEW_BRANCH
```

**6.** 在仓库中的新分支`NEW_BRANCH`中创建 Pull Request,并添加相应标签、[建立与相关issue的关联](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
**7.** PR通过后,覆盖本地提交历史:

```
git pull --force upstream main:main
```

**8.** 更新您的仓库的`main` 分支:

```
git push --force origin main:main
```

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

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

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

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



## **文档管理逻辑**

MatrixOne文档通过三个仓库来协调管理:

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

`matrixorigin.io`仓库中有一个子模块`submodule`,其引用了`matrixone`仓库中的文档内容,当`matrixone`仓库的内容更新时,`submodule`也会同步更新;而图像等非结构化文件则直接引用`artwork`仓库的网站链接,如:

```
https://github.com/matrixorigin/artwork/blob/main/docs/overview/overall-architecture.png?raw=true
```

`matrixorigin.io`部署了一个CI程序,当有新的代码被合并时将自动触发,将文档发布到我们的[官方文档网站](https://docs.matrixorigin.io/)
我们的文档是基于 [mkdocs-material](https://github.com/squidfunk/mkdocs-material)组件进行开发的,您可以在此链接中了解更多信息。

## **文档内容架构**

MatrixOne文档内容可以分为如下几个模块:

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

## **一般工作流程**

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

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

**3.** 克隆[matrixorigin.io](https://github.com/matrixorigin/matrixorigin.io)仓库,使用`--repository`来引用`matrixone`中的内容。

```
$ git clone --recursive [email protected]:yourusername/matrixorigin.io.git
```

克隆[matrixone](https://github.com/matrixorigin/matrixorigin.io)仓库。

```
$ git clone [email protected]:yourusername/matrixone.git
```

**4.** 在您的本地matrixone文件夹中将`matrixone`仓库添加为远程仓库。

```
git remote add upstream https://github.com/matrixorigin/matrixone.git
```

在您的本地matrixorigin.io文件夹中将`matrixorigin.io`仓库添加为远程仓库。

```
git remote add upstream https://github.com/matrixorigin/matrixorigin.io.git
```

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

```
$ mkdocs serve
```
Expand All @@ -81,6 +91,7 @@ $ mkdocs serve

**7.** 确认修改无误后,使用`git add``git commit`命令在本地提交修改,并推送至您Fork的远程仓库`matrixorigin.io``matrixone`
我们建议您推送至远程仓库的新分支:

```
git push origin main:NEW_BRANCH
```
Expand All @@ -92,18 +103,20 @@ git push origin main:NEW_BRANCH
**10.** 最后,还有一些操作可以帮助保持MatrixOne远端仓库,您的远端仓库和本地仓库均保持一致。

覆盖本地提交历史:

```
git pull --force upstream main:main
```

更新Github上的`main`分支:

```
git push --force origin main:main
```

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


## **写一篇博文**

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

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

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


## **一般流程**

通常,从头到尾地完成一项技术设计需要以下步骤:

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

0 comments on commit dbd7d5a

Please sign in to comment.