Skip to content

Commit

Permalink
[Doc] Modify doc i18n and Added some docs (#2864)
Browse files Browse the repository at this point in the history
* Spotless Apply

* modify doc label to i18n and added some docs and faq

* modify faq position

* change repo url

* fix jump url

* fix

* fix

* fix

---------

Co-authored-by: Zzm0809 <[email protected]>
  • Loading branch information
Zzm0809 and Zzm0809 authored Dec 31, 2023
1 parent f5ce9bb commit 962fe4f
Show file tree
Hide file tree
Showing 47 changed files with 426 additions and 379 deletions.
2 changes: 1 addition & 1 deletion docs/docs/deploy_guide/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "安装部署",
"label": "deploy_guide",
"position": 2
}
2 changes: 1 addition & 1 deletion docs/docs/developer_guide/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "开发者指南",
"label": "developer_guide",
"position": 12
}
2 changes: 1 addition & 1 deletion docs/docs/developer_guide/contribution/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "参与贡献",
"label": "contribution",
"position": 1
}
53 changes: 53 additions & 0 deletions docs/docs/developer_guide/contribution/code_format.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
sidebar_position: 7
position: 7
id: code_format
title: 代码格式化
---

:::info 简介

如果你在 Dinky 基础上进行了二次开发/bugfix/实现了新功能,并打算贡献到社区,基于代码格式化要求,你必须执行格式化代码,满足规范后方可被合并.

但是在 Dinky 1.0.0 之后,格式化插件升级后要求 JDK 环境为 JDK 11,如果你的 JDK 环境为 JDK 8,那么则需要升级 JDK 环境/配置服务端格式化,否则无法使用格式化插件.你的 Pull Request 的代码检查结果将会失败,从而无法被合并

基于上述说明,下面介绍多种方式,如何执行格式化并满足格式化要求.
:::

## 升级 JDK 环境

> 此为单个 JDK 环境的升级
Dinky 1.0.0 之后,全面支持 JDK 11,如果你的 JDK 环境为 JDK 8,那么可以选择升级 JDK 环境,具体 JDK11 的安装方式自行搜索即可.

## JDK 环境并存

如果你需要有多个 JDK 环境,那么你可以通过以下方式来实现 JDK 环境并存:

1. 下载 JDK 11 并安装.不需要配置环境变量,只需要在 IDEA 中配置即可.前提是你所需的 JDK 主版本非 JDK11, 如果你想要设置 JDK 11 为默认,那么可以自行配置环境变量.
2. 在 IDEA 打开的 Dinky 工程中配置 JDK 11,并勾选 Maven Profile 中的 `jdk11`,并刷新 Maven Profile,使其重新加载.
3. 找到 Maven => Dinky 根下的 插件 => 展开 spotless, 双击 spotless:apply ,等待格式化完成.

## 无需多 JDK 环境

如果你只需要单个 JDK 环境,并且本地的 JDK 环境版本为 JDK 8, 不想升级 JDK 环境,那么你可以通过以下方式来实现:

> 注意: 此操作需要在你提交本地代码到你的仓库前进行.
1. 登录你的 GitHub 账号,转到 https://github.com/settings/tokens
2. 点击下图路径, 创建 token,并指定名称为 `FORMAT`,请注意大小写,创建完成之后请牢记该 Token 值, 后续将会用到
![create_token](http://pic.dinky.org.cn/dinky/docs/zh-CN/developer_guide/contribution/code_format/create_token.png)
3. 打开你的 GitHub 中 Fork 的 Dinky 仓库 -> Settings -> Secrets and variables -> Actions
![secrets_url](http://pic.dinky.org.cn/dinky/docs/zh-CN/developer_guide/contribution/code_format/secrets_url.png)
4. 点击 Secrets Tag -> New repository secret -> 名称指定为 `TOKEN` , 粘贴你在第一步中创建的 token 值, 点击 Add secret
5. 点击 Variables -> New repository variable -> 名称指定为 `FORMAT` , 值为`true`, 点击 Add variable
![variables_url](http://pic.dinky.org.cn/dinky/docs/zh-CN/developer_guide/contribution/code_format/variables_url.png)

6. 基于此方式,可以一劳永逸,无需在 IDEA 中手动执行格式化,并无需安装 JDK 11 环境. 只需要正常修改/新增代码 -> 提交到你的 Dinky 仓库即可,服务端会自动执行格式化,并将结果反馈在 下图所示的 Actions 界面中.
![show_actions](http://pic.dinky.org.cn/dinky/docs/zh-CN/developer_guide/contribution/code_format/show_actions.png)

:::tip 提示

以上为几种如何实现格式化的方案, 请根据你的实际情况选择合适的方式.推荐使用 [无需多 JDK 环境](#无需多-jdk-环境) 的方式,因为它更加方便,而且不会影响你的本地环境.

:::
6 changes: 3 additions & 3 deletions docs/docs/developer_guide/contribution/commit_code.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: 提交代码须知

# 提交代码

* 首先从远端仓库 *https://github.com/DataLinkDC/dlink.git* fork 一份代码到自己的仓库中
* 首先从远端仓库 *https://github.com/DataLinkDC/dinky.git* fork 一份代码到自己的仓库中

* 远端仓库中分支:
* dev 日常开发分支: 日常 dev 开发分支,新提交的代码都可以 pull request 到这个分支上。
Expand All @@ -19,13 +19,13 @@ title: 提交代码须知
* 把自己仓库 clone 到本地

```sh
git clone https://github.com/DataLinkDC/dlink.git
git clone https://github.com/DataLinkDC/dinky.git
```

* 添加远端仓库地址,命名为 upstream

```sh
git remote add upstream https://github.com/DataLinkDC/dlink.git
git remote add upstream https://github.com/DataLinkDC/dinky.git
```


Expand Down
4 changes: 2 additions & 2 deletions docs/docs/developer_guide/contribution/commit_message.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
sidebar_position: 3
position: 3
sidebar_position: 4
position: 4
id: commit_message
title: Commit Message 须知
---
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/developer_guide/contribution/how_contribute.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
sidebar_position: 4
position: 4
sidebar_position: 6
position: 6
id: how_contribute
title: 如何贡献
---
Expand All @@ -13,8 +13,8 @@ title: 如何贡献

我们鼓励任何形式的参与社区,如:

- 将遇到的问题通过 github 上 [issue](https://github.com/DataLinkDC/dlink/issues) 的形式反馈出来
- 回答别人遇到的 [issue](https://github.com/DataLinkDC/dlink/issues) 问题
- 将遇到的问题通过 github 上 [issue](https://github.com/DataLinkDC/dinky/issues) 的形式反馈出来
- 回答别人遇到的 [issue](https://github.com/DataLinkDC/dinky/issues) 问题
- 讨论新 Feature 的实现方案
- 帮助完善文档及官网
- 帮助项目增加测试用例
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/developer_guide/contribution/issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Issue 是引出一个 Feature 或 Bug 等的重要步骤,在单个 Issue 中

### Issue 内容模板

[Issue 模板](https://github.com/DataLinkDC/dlink/tree/dev/.github/ISSUE_TEMPLATE)
[Issue 模板](https://github.com/DataLinkDC/dinky/tree/dev/.github/ISSUE_TEMPLATE)

### Bug 类 Issue

Expand Down
12 changes: 8 additions & 4 deletions docs/docs/developer_guide/local_debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ title: 本地调试
```shell
mkdir workspace
cd workspace
git clone https://github.com/DataLinkDC/dlink.git
git clone https://github.com/DataLinkDC/dinky.git
#或者
git clone git://github.com/DataLinkDC/dlink.git
```

### 导入 Dinky

1. 启动 IDEA 并选择 Open。
2. 选择已克隆的 Dlink 存储库的根文件夹。
2. 选择已克隆的 Dinky 存储库的根文件夹。
3. 等待项目加载完成。
4. 设置 JDK 1.8 和 Maven 3.6.0。

Expand Down Expand Up @@ -90,7 +90,7 @@ npm run dev

由于目前 Dinky 各个模块未发布到 Maven 中央仓库,所以需要先进行 Install 编译。从而在本地仓库中生成相应的依赖。

如果你是第一次编译 Dinky,那么请勾选以下 Maven Profile,然后双击下图中的`生命周期 -> Install`进行编译。
如果你是第一次编译 Dinky,那么请勾选以下 Maven Profile,然后双击下图中的`生命周期 -> Install`进行编译。如果在 Install/Package 过程中报错代码格式化问题,请参考 [代码格式化](contribution/code_format)章节
:::

![localdebug_profile](http://pic.dinky.org.cn/dinky/docs/zh-CN/developer_guide/local_debug/localdebug_profile.png)
Expand Down Expand Up @@ -129,7 +129,7 @@ npm run dev
Dinky开发环境配置有两种模式,分别是 provided 环境和 compile 环境

- provided:即上述 Profile 中的 `prod` ,此环境适合打包部署,或者二次开发后打包部署
- compile: 即上述 Profile 中的 `dev`,此环境适合二次开发或者熟悉源码,此模式不需要额外安装Flink,通过Flink自带的local模式变可调试开发
- compile: 即上述 Profile 中的 `dev`,此环境适合二次开发或者熟悉源码,此模式不需要额外安装Flink,通过Flink自带的local模式便可调试开发

### 本地调试 Profile

Expand Down Expand Up @@ -220,3 +220,7 @@ spring:

如果你在 Dinky 的基础上进行了二次开发,并有意向将代码贡献给 Dinky,请参考 [代码贡献](./contribution/how_contribute) 文档。
:::

## 常见问题

请参考 [本地调试 FAQ](../faq#本地调试FAQ) 文档。
2 changes: 1 addition & 1 deletion docs/docs/extend/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "扩展",
"label": "extend",
"position": 13
}
2 changes: 1 addition & 1 deletion docs/docs/extend/expand_statements/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "扩展语法",
"label": "extended_grammar",
"position": 2
}
2 changes: 1 addition & 1 deletion docs/docs/extend/function_expansion/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "功能扩展",
"label": "function_extension",
"position": 2
}
42 changes: 40 additions & 2 deletions docs/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Caused by: java.lang.IllegalArgumentException: java.net.UnknownHostException: na
```

提供 3 种方式解决这个问题:
- 升级 Dinky 至 0.6.2 及后续版本。详见:[https://github.com/DataLinkDC/dlink/issues/310](https://github.com/DataLinkDC/dlink/issues/310)
- 升级 Dinky 至 0.6.2 及后续版本。详见:[https://github.com/DataLinkDC/dinky/issues/310](https://github.com/DataLinkDC/dinky/issues/310)

- 修改 `/etc/profile`,添加 HADOOP_HOME 环境变量
```shell
Expand Down Expand Up @@ -175,4 +175,42 @@ Cannot map checkpoint/savepoint state for operator xxx to the new program, becau
If you want to allow to skip this, you can set the --allowNonRestoredState option on the CLI.
```
添加参数 execution.savepoint.ignore-unclaimed-state:true,跳过无法还原的算子
添加参数 execution.savepoint.ignore-unclaimed-state:true,跳过无法还原的算子
## 本地调试FAQ
Q1: 为什么不支持除了 Java8 和 Java11 以外的其他版本呢?
> A1: 因为 Flink 目前仅支持 Java8 和 Java11。
---
Q2: 为什么 Maven Profile 切换了不生效呢?? 提交任务时还是报各种依赖问题,Profile 像是不生效呢?????
> A2-1: 因为你没刷新 Maven Profile,导致不生效
> A2-2: 因为虽然你刷新了 Maven Profile, 没重启 Dinky 服务(不要问为什么需要重启,这是一个开发人员的基本认知),导致依赖没包含在当前已启动的服务中.
> A2-3: Profile 切的不对,注意灰色的 Profile 选项.请仔细仔细仔细仔细的看看.
> A2-4: 查看你的 IDEA 的版本,不要太旧,尽量保持在 2022.x 以上(别问为什么,上边已经说了)
> A2-5: Profile 切换加载,基于依赖的 `<scope></scope>`标签属性声明 ,如果不懂,自行百度/谷歌/CSDN/StackOverFlow/ChatGPT
---
Q3: 我在 IDEA 中启动 Dinky 后, 前端页面访问不了, 报错找不到页面??????
> A3-1: 可以在执行 Install 阶段勾选 `web` Profile,不然 dinky-admin/src/main/resources/ 下没有静态资源文件目录 `static`.
> A3-2: 可以单独启动前端,参考 [本地调试-启动前端](developer_guide/local_debug#启动前端) 部分
---
Q4: 为什么在 IDEA 中启动 Dinky 后,Profile 也加载了,我用到了一个 connector 仍然报错找不到类?????
> A4-1: Dinky 只加载了 Dinky 在开发中过程中用到的相关 Flink 依赖以及 Flink 的基本环境依赖.如报此类错误,请检查你的 pom.xml 文件,是否包含了 connector 所依赖的 jar 包
> A4-2: 如上述问题未解决,请检查你的 `dinky-flink` 模块下的与你Flink 版本一致的 `pom.xml` 文件,是否包含了 connector 所依赖的 jar 包
2 changes: 1 addition & 1 deletion docs/docs/get_started/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "快速开始",
"label": "get_started",
"position": 1
}
2 changes: 1 addition & 1 deletion docs/docs/get_started/quick_start/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "SQL 快速入门",
"label": "quick_start",
"position": 3
}
2 changes: 1 addition & 1 deletion docs/docs/platform_intro/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "Dinky 介绍",
"label": "platform_intro",
"position": 0
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "集成实践",
"label": "Integration_practice",
"position": 4
}
2 changes: 1 addition & 1 deletion docs/docs/practical_guide/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "实践指南",
"label": "practical_guide",
"position": 9
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "整库同步实践",
"label": "cdcsource_practice",
"position": 1
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "Flink模式提交实践",
"label": "run_mode_practice",
"position": 2
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "场景实践",
"label": "scenario_practice",
"position": 3
}
4 changes: 2 additions & 2 deletions docs/docs/thanks.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ title: 致谢
- Sa-Token 是一款简单易用、功能强大的Java权限认证框架。它提供了一套简单、灵活、高效的权限认证方案,帮助开发者更方便地进行权限认证。Dinky 项目的登录认证功能/权限控制基于 Sa-Token 实现。


[![JetBrains](http://pic.dinky.org.cn/dinky/docs/zh-CN/thanks/jetbrains.svg)](https://www.jetbrains.com/?from=dlink)
此外,特别感谢 [JetBrains](https://www.jetbrains.com/?from=dlink) 提供的免费开源 License 赞助,JetBrains是一家软件开发工具提供商,提供了许多受欢迎的集成开发环境,如 IntelliJ IDEA。他们支持开源社区,为一些开源项目提供免费的开源许可证,以促进软件开发的进步
[![JetBrains](http://pic.dinky.org.cn/dinky/docs/zh-CN/thanks/jetbrains.svg)](https://www.jetbrains.com/?from=dinky)
此外,特别感谢 [JetBrains](https://www.jetbrains.com/?from=dinky) 提供的免费开源 License 赞助,JetBrains是一家软件开发工具提供商,提供了许多受欢迎的集成开发环境,如 IntelliJ IDEA。他们支持开源社区,为一些开源项目提供免费的开源许可证,以促进软件开发的进步

### 贡献者

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/user_guide/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "使用手册",
"label": "user_guide",
"position": 10
}
2 changes: 1 addition & 1 deletion docs/docs/user_guide/auth_center/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "认证中心",
"label": "auth_center",
"position": 4
}
2 changes: 1 addition & 1 deletion docs/docs/user_guide/devops_center/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "运维中心",
"label": "devops_center",
"position": 2
}
2 changes: 1 addition & 1 deletion docs/docs/user_guide/register_center/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "注册中心",
"label": "register_center",
"position": 3
}
2 changes: 1 addition & 1 deletion docs/docs/user_guide/register_center/alert/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "告警",
"label": "alert",
"position": 3
}
2 changes: 1 addition & 1 deletion docs/docs/user_guide/studio/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "数据开发",
"label": "studio",
"position": 1
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "基本介绍",
"label": "development_control",
"position": 1
}
2 changes: 1 addition & 1 deletion docs/docs/user_guide/system_setting/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "配置中心",
"label": "system_setting",
"position": 5
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "全局配置",
"label": "global_settings",
"position": 1
}
2 changes: 1 addition & 1 deletion docs/docs/user_guide/udf_develop/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "函数开发",
"label": "udf_develop",
"position": 10
}
Loading

0 comments on commit 962fe4f

Please sign in to comment.