Kaynağa Gözat

Merge branch 'master' into dev/1.1.2

p
ngjaying 4 yıl önce
ebeveyn
işleme
85708dc8ac

+ 25 - 0
.github/workflows/check_markdown.yaml

@@ -0,0 +1,25 @@
+name: Check markdown
+
+on: [push, pull_request]
+
+jobs:
+  Markdown_Checker:
+    runs-on: ubuntu-latest
+    steps:
+    - name: Check out code
+      uses: actions/checkout@main
+  
+    - name: Install markdownlint
+      run: sudo npm install -g markdownlint-cli
+
+    - name: Check markdown
+      run: markdownlint -c .github/workflows/markdown_config.json ./docs/
+
+  Directory_Checker:
+    runs-on: ubuntu-latest
+    steps:
+    - name: Check out code
+      uses: actions/checkout@main
+  
+    - name: Check directory config
+      run: python3 .github/workflows/directory_check.py $(pwd)/docs/

+ 59 - 0
.github/workflows/directory_check.py

@@ -0,0 +1,59 @@
+import os
+import sys
+import json
+import re
+
+docs_path = sys.argv[1]
+success = True
+
+def check_path(path_list, folder):
+    global success
+    for i in path_list:
+        md_path = i.get('path')
+        md_children = i.get('children')
+        if md_path and md_children:
+            print(f'{i.get("title")} has path and children')
+            success = False
+        if md_children:
+            check_path(md_children, folder)
+        else:
+            if md_path.startswith(('http://', 'https://')) or md_path == './':
+                continue
+            file_path = f'{docs_path}/{folder}/{md_path}.md'
+
+            if not os.path.exists(file_path):
+                print(f'{folder}/{md_path}.md not exists')
+                success = False
+                continue
+
+            md_content = open(file_path, 'r').read()
+            image_list = re.findall('(.*?)!\[(.*?)\]\((.*?)\)', md_content)
+            for image in image_list:
+                if image[0].startswith('<!--'):
+                    continue
+                if image[2].startswith(('http://', 'https://', '<')):
+                    continue
+                image_path = os.path.join(f'{"/".join(file_path.split("/")[:-1])}/', image[2])
+
+                if not os.path.exists(image_path):
+                    print(f'In {folder}/{md_path}.md:', end='')
+                    print(image[2], 'does not exist')
+                    success = False
+
+
+if __name__ == '__main__':
+    file_list = []
+    if os.path.exists(f'{docs_path}/directory.json'):
+        file_list.append('directory.json')
+
+    for file in file_list:
+        with open(f'{docs_path}/{file}') as f:
+            print(f'Check {file}...')
+            config_dict = json.load(f)
+            check_path(config_dict['cn'], 'zh_CN')
+            check_path(config_dict['en'], 'en_US')
+
+    if not success:
+        sys.exit('No pass!')
+    else:
+        print('Check completed!')

+ 13 - 0
.github/workflows/markdown_config.json

@@ -0,0 +1,13 @@
+{
+    "default": false,
+    "MD001": true,
+    "MD003": {"style": "atx"},
+    "MD011": true,
+    "MD018": true,
+    "MD019": true,
+    "MD023": true,
+    "MD025": {"level": 1, "front_matter_title": ""},
+    "MD042": true,
+    "MD046": {"style": "fenced"},
+    "MD048": {"style": "backtick"}
+  }

+ 283 - 5
docs/directory.json

@@ -21,11 +21,68 @@
 		},
 		{
 			"title": "规则",
-			"path": "rules/overview"
+			"children": [{
+					"title": "规则管理",
+					"path": "rules/overview"
+				},
+				{
+					"title": "Sinks",
+					"children": [{
+							"title": "EdgeX 消息总线目标",
+							"path": "rules/sinks/edgex"
+						},
+						{
+							"title": "MQTT 动作",
+							"path": "rules/sinks/mqtt"
+						},
+						{
+							"title": "Nop action",
+							"path": "rules/sinks/nop"
+						},
+						{
+							"title": "REST动作",
+							"path": "rules/sinks/rest"
+						},
+						{
+							"title": "日志操作",
+							"path": "rules/sinks/logs"
+						}
+					]
+				},
+				{
+					"title": "Sources",
+					"children": [{
+							"title": "EdgeX 源",
+							"path": "rules/sources/edgex"
+						},
+						{
+							"title": "HTTP 提取源",
+							"path": "rules/sources/http_pull"
+						},
+						{
+							"title": "MQTT源",
+							"path": "rules/sources/mqtt"
+						}
+					]
+				},
+				{
+					"title": "Golang 模版",
+					"path": "rules/data_template"
+				},
+				{
+					"title": "状态和容错",
+					"path": "rules/state_and_fault_tolerance"
+				}
+
+			]
 		},
 		{
 			"title": "命令行工具",
 			"children": [{
+					"title": "摘要",
+					"path": "cli/overview"
+				},
+				{
 					"title": "流管理",
 					"path": "cli/streams"
 				},
@@ -40,8 +97,24 @@
 			]
 		},
 		{
+			"title": "管理控制台",
+			"children": [{
+					"title": "控制台使用",
+					"path": "manager-ui/overview"
+				},
+				{
+					"title": "如何将自定义的插件展示在管理控制台的安装列表",
+					"path": "manager-ui/plugins_in_manager"
+				}
+			]
+		},
+		{
 			"title": "Rest API 接口",
 			"children": [{
+					"title": "接口介绍",
+					"path": "restapi/overview"
+				},
+				{
 					"title": "流管理",
 					"path": "restapi/streams"
 				},
@@ -58,6 +131,10 @@
 		{
 			"title": "Kuiper SQL 参考",
 			"children": [{
+					"title": "Kuiper SQL 介绍",
+					"path": "sqls/overview"
+				},
+				{
 					"title": "流规格",
 					"path": "sqls/streams"
 				},
@@ -72,12 +149,36 @@
 				{
 					"title": "函数",
 					"path": "sqls/built-in_functions"
+				},
+				{
+					"title": "Kuiper 词汇元素",
+					"path": "sqls/lexical_elements"
+				},
+				{
+					"title": "JSON 表达式",
+					"path": "sqls/json_expr"
 				}
 			]
 		},
 		{
 			"title": "扩展 Kuiper",
-			"path": "extension/overview"
+			"children": [{
+					"title": "Introduction",
+					"path": "extension/overview"
+				},
+				{
+					"title": "函数扩展",
+					"path": "extension/function"
+				},
+				{
+					"title": "Sink/Action 扩展",
+					"path": "extension/sink"
+				},
+				{
+					"title": "源扩展",
+					"path": "extension/source"
+				}
+			]
 		},
 		{
 			"title": "插件",
@@ -88,6 +189,46 @@
 				{
 					"title": "插件开发教程",
 					"path": "plugins/plugins_tutorial"
+				},
+				{
+					"title": "Sinks",
+					"children": [{
+							"title": "文件目标(Sink)",
+							"path": "plugins/sinks/file"
+						},
+						{
+							"title": "图像目标(Sink)",
+							"path": "plugins/sinks/image"
+						},
+						{
+							"title": "InfluxDB 目标(Sink)",
+							"path": "plugins/sinks/influx"
+						},
+						{
+							"title": "TDengine Sink",
+							"path": "plugins/sinks/tdengine"
+						},
+						{
+							"title": "Zmq Sink",
+							"path": "plugins/sinks/zmq"
+						}
+					]
+				},
+				{
+					"title": "Sources",
+					"children": [{
+							"title": "Random Source",
+							"path": "plugins/sources/random"
+						},
+						{
+							"title": "Zmq Source",
+							"path": "plugins/sources/zmq"
+						}
+					]
+				},
+				{
+					"title": "Custom function",
+					"path": "plugins/functions/functions"
 				}
 			]
 		}
@@ -114,11 +255,68 @@
 		},
 		{
 			"title": "Rules",
-			"path": "rules/overview"
+			"children": [{
+					"title": "Introduction",
+					"path": "rules/overview"
+				},
+				{
+					"title": "Sinks",
+					"children": [{
+							"title": "EdgeX Message Bus action",
+							"path": "rules/sinks/edgex"
+						},
+						{
+							"title": "MQTT action",
+							"path": "rules/sinks/mqtt"
+						},
+						{
+							"title": "Nop action",
+							"path": "rules/sinks/nop"
+						},
+						{
+							"title": "REST action",
+							"path": "rules/sinks/rest"
+						},
+						{
+							"title": "Log action",
+							"path": "rules/sinks/logs"
+						}
+					]
+				},
+				{
+					"title": "Sources",
+					"children": [{
+							"title": "EdgeX Source",
+							"path": "rules/sources/edgex"
+						},
+						{
+							"title": "HTTP pull source",
+							"path": "rules/sources/http_pull"
+						},
+						{
+							"title": "MQTT source",
+							"path": "rules/sources/mqtt"
+						}
+					]
+				},
+				{
+					"title": "Golang template",
+					"path": "rules/data_template"
+				},
+				{
+					"title": "State and Fault Tolerance",
+					"path": "rules/state_and_fault_tolerance"
+				}
+
+			]
 		},
 		{
 			"title": "Command line tool",
 			"children": [{
+					"title": "Introduction",
+					"path": "cli/overview"
+				},
+				{
 					"title": "Streams",
 					"path": "cli/streams"
 				},
@@ -133,6 +331,18 @@
 			]
 		},
 		{
+			"title": "Kuiper management console",
+			"children": [{
+					"title": "Introduction",
+					"path": "manager-ui/overview"
+				},
+				{
+					"title": "How to display custom plugins in the installation list of the management console",
+					"path": "manager-ui/plugins_in_manager"
+				}
+			]
+		},
+		{
 			"title": "Rest API",
 			"children": [{
 					"title": "Streams",
@@ -151,6 +361,10 @@
 		{
 			"title": "Kuiper SQL",
 			"children": [{
+					"title": "Introduction",
+					"path": "sqls/overview"
+				},
+				{
 					"title": "Streams",
 					"path": "sqls/streams"
 				},
@@ -165,12 +379,36 @@
 				{
 					"title": "Functions",
 					"path": "sqls/built-in_functions"
+				},
+				{
+					"title": "Kuiper lexical elements",
+					"path": "sqls/lexical_elements"
+				},
+				{
+					"title": "JSON Expressions",
+					"path": "sqls/json_expr"
 				}
 			]
 		},
 		{
 			"title": "Extend Kuiper",
-			"path": "extension/overview"
+			"children": [{
+					"title": "Introduction",
+					"path": "extension/overview"
+				},
+				{
+					"title": "Function Extension",
+					"path": "extension/function"
+				},
+				{
+					"title": "Sink Extension",
+					"path": "extension/sink"
+				},
+				{
+					"title": "Source Extension",
+					"path": "extension/source"
+				}
+			]
 		},
 		{
 			"title": "Plugins",
@@ -181,8 +419,48 @@
 				{
 					"title": "Development tutorial",
 					"path": "plugins/plugins_tutorial"
+				},
+				{
+					"title": "Sinks",
+					"children": [{
+							"title": "File Sink",
+							"path": "plugins/sinks/file"
+						},
+						{
+							"title": "Image Sink",
+							"path": "plugins/sinks/image"
+						},
+						{
+							"title": "InfluxDB Sink",
+							"path": "plugins/sinks/influx"
+						},
+						{
+							"title": "TDengine Sink",
+							"path": "plugins/sinks/tdengine"
+						},
+						{
+							"title": "Zmq Sink",
+							"path": "plugins/sinks/zmq"
+						}
+					]
+				},
+				{
+					"title": "Sources",
+					"children": [{
+							"title": "Random Source",
+							"path": "plugins/sources/random"
+						},
+						{
+							"title": "Zmq Source",
+							"path": "plugins/sources/zmq"
+						}
+					]
+				},
+				{
+					"title": "Custom function",
+					"path": "plugins/functions/functions"
 				}
 			]
 		}
 	]
-}
+}

+ 16 - 6
docs/en_US/README.md

@@ -110,8 +110,8 @@ Join our [Slack](https://join.slack.com/t/emqx/shared_invite/zt-7xrracuf-GGdbNB1
 
 - [Getting started](./getting_started.md) 
 
-- [Reference guide](./reference.md)
-  - [Install and operation](./operation/overview.md)
+- Reference guide
+  - [Install and operation](./getting_started.md)
   - [Command line interface tools - CLI](./cli/overview.md)
   - [Kuiper SQL reference](./sqls/overview.md)
   - [Rules](./rules/overview.md)
@@ -120,11 +120,11 @@ Join our [Slack](https://join.slack.com/t/emqx/shared_invite/zt-7xrracuf-GGdbNB1
 
 ## Build from source
 
-#### Preparation
+### Preparation
 
 - Go version >= 1.13
 
-#### Compile
+### Compile
 
 + Binary: 
 
@@ -142,8 +142,18 @@ Join our [Slack](https://join.slack.com/t/emqx/shared_invite/zt-7xrracuf-GGdbNB1
 
   > Docker images support EdgeX by default
 
-To using cross-compilation, refer to [this doc](./cross-compile.md).
+## Cross-compile binaries
+
+:::tip Tip
+Kuiper plugins bases on Golang, and due to Golang restrictions, ``CGO_ENABLED``  flag must be set to 0 to use the Golang cross-compile. But with this flag mode, the Golang plugins will not work. So if you want to use plugins in Kuiper, you can NOT use cross-compile to produce the binary packages.
+:::
+
+- Preparation
+  - docker version >= 19.03
+  - Enable Docker CLI  experimental mode
+- Cross-compile binary files: ``$ make cross_build``
+- Cross-compile images for all platforms and push to registry:``$ make cross_docker``
 
 ## Open source license
 
-[Apache 2.0](LICENSE)
+[Apache 2.0](https://github.com/emqx/kuiper/blob/master/LICENSE)

+ 1 - 1
docs/en_US/edgex/edgex_rule_engine_tutorial.md

@@ -158,7 +158,7 @@ curl -X POST \
       "log":{}
     }
   ]
-}
+}'
 ```
 
 #### Option 2: Use Kuiper CLI

Dosya farkı çok büyük olduğundan ihmal edildi
+ 14 - 16
docs/en_US/manager-ui/overview.md


+ 2 - 2
docs/en_US/operation/configuration_file.md

@@ -39,10 +39,10 @@ basic:
     keyfile: /var/https-server.key
 ```
 
-#### restPort
+### restPort
 The port for the rest api http server to listen to.
 
-#### restTls
+### restTls
 The tls cert file path and key file path setting. If restTls is not set, the rest api server will listen on http. Otherwise, it will listen on https.
 
 ## Prometheus Configuration

+ 4 - 4
docs/en_US/plugins/functions/functions.md

@@ -2,7 +2,7 @@
 
 Kuiper can customize functions. For the development, compilation and use of functions, please [see here](../../extension/function.md).
 
-### echo plugin
+## echo plugin
 
 | Function | Example   | Description                     |
 | -------- | --------- | ------------------------------- |
@@ -16,7 +16,7 @@ echo(avg) example
   SELECT echo(avg) as r1 FROM test;
   ```
 
-### countPlusOne plugin
+## countPlusOne plugin
 
 | Function     | Example           | Description                                       |
 | ------------ | ----------------- | ------------------------------------------------- |
@@ -30,7 +30,7 @@ countPlusOne(avg) example
   SELECT countPlusOne(avg) as r1 FROM test;
   ```
 
-### accumulateWordCount plugin
+## accumulateWordCount plugin
 
 | Function            | Example                      | Description                                  |
 | ------------------- | ---------------------------- | -------------------------------------------- |
@@ -44,7 +44,7 @@ accumulateWordCount(avg,sep) example
   SELECT accumulateWordCount(avg,sep) as r1 FROM test;
   ```
 
-### Image processing plugin
+## Image processing plugin
 
 Image processing currently only supports the formats of `png` and `jpeg` 
 

+ 3 - 3
docs/en_US/plugins/sinks/influx.md

@@ -36,7 +36,7 @@ Restart the Kuiper server to activate the plugin.
 
 Below is a sample for selecting temperature great than 50 degree, and some profiles only for your reference.
 
-#### /tmp/influxRule.txt
+### /tmp/influxRule.txt
 ```json
 {
   "id": "influx",
@@ -58,13 +58,13 @@ Below is a sample for selecting temperature great than 50 degree, and some profi
   ]
 }
 ```
-#### /tmp/influxPlugin.txt
+### /tmp/influxPlugin.txt
 ```json
 {
    "file":"http://localhost:8080/influx.zip"
  }
 ```
-#### plugins/go.mod
+### plugins/go.mod
 ```
 module plugins
 

+ 1 - 1
docs/en_US/rules/overview.md

@@ -67,7 +67,7 @@ The rule options can be defined globally in ``etc/kuiper.yaml`` under the ``rule
 - See [SQL](../sqls/overview.md) for more info of Kuiper SQL.
 - Sources can be customized, see [extension](../extension/overview.md) for more detailed info.
 
-## sinks/actions
+### sinks/actions
 
 Currently, below kinds of sinks/actions are supported:
 

+ 2 - 2
docs/en_US/sqls/windows.md

@@ -125,7 +125,7 @@ In some cases, not all the inputs are needed for the window. Filter clause is pr
 
 The filter clause must follow the window function. The filter clause must be like `FILTER(WHERE expr)`. Example:
 ```sql
-SELECT * FROM demo GROUP BY COUNTWINDOW(3,1) FITLER(where revenue > 100)
+SELECT * FROM demo GROUP BY COUNTWINDOW(3,1) FILTER(where revenue > 100)
 ```
 
 ## Timestamp Management
@@ -143,4 +143,4 @@ CREATE STREAM demo (
 In event time mode, the watermark algorithm is used to calculate a window.
 
 ## Runtime error in window
-If the window receive an error (for example, the data type does not comply to the stream definition) from upstream, the error event will be forwarded immediately to the sink. The current window calculation will ignore the error event.
+If the window receive an error (for example, the data type does not comply to the stream definition) from upstream, the error event will be forwarded immediately to the sink. The current window calculation will ignore the error event.

+ 13 - 13
docs/en_US/streams.md

@@ -1,7 +1,7 @@
-## Stream specs 
+# Stream specs 
 
 
-### Data types
+## Data types
 
 Refer to [Azure IoT](https://docs.microsoft.com/en-us/stream-analytics-query/data-types-azure-stream-analytics), boolean type is cast to int.
 
@@ -17,9 +17,9 @@ Refer to [Azure IoT](https://docs.microsoft.com/en-us/stream-analytics-query/dat
 
 
 
-### Language definitions
+## Language definitions
 
-#### CREATE STREAM
+### CREATE STREAM
 
 ```sql
 CREATE STREAM   
@@ -102,7 +102,7 @@ demo: #Conf_key
 
 ```
 
-#### DROP STREAM
+### DROP STREAM
 
 DROP the stream.
 
@@ -110,7 +110,7 @@ DROP the stream.
 DROP STREAM my_stream
 ```
 
-#### DESCRIBE STREAM
+### DESCRIBE STREAM
 
 Print the stream definition.
 
@@ -128,7 +128,7 @@ Format: json
 Key: id
 ```
 
-#### EXPLAIN STREAM
+### EXPLAIN STREAM
 
 Print the detailed runtime infomation of the stream.
 
@@ -136,7 +136,7 @@ Print the detailed runtime infomation of the stream.
 EXPLAIN STREAM my_stream
 ```
 
-#### SHOW STREAMS
+### SHOW STREAMS
 
 Print all defined streams in system.
 
@@ -148,11 +148,11 @@ my_stream, iot_stream
 
 
 
-### A simple CLI
+## A simple CLI
 
 A simple command line tool is implemented in ``stream/cli/main.go``. 
 
-#### Run sql to manage streams
+### Run sql to manage streams
 
 Run `kuiper stream` command, after `kuiper >` prompt shown, enter stream related sql statements such as create, drop, describe, explain and show stream statements to execute.
 
@@ -164,7 +164,7 @@ kuiper > DESCRIBE STREAM sname
 ```
 
 
-#### Run query
+### Run query
 
 ```bash
 cli query
@@ -174,9 +174,9 @@ kuiper > select USERID from demo;
 
 
 
-### Implementation
+## Implementation
 
-##### How to save the stream definitions?
+### How to save the stream definitions?
 
 Refer to below, a storage is required for saving the stream definitions.
 

+ 16 - 6
docs/zh_CN/README.md

@@ -110,8 +110,8 @@ Kuiper 可以运行在各类物联网的边缘使用场景中,比如工业物
 
 - [开始使用](./getting_started.md) 
 
-- [参考指南](./reference.md)
-  - [安装与操作](./operation/overview.md)
+- 参考指南
+  - [安装与操作](./getting_started.md)
   - [命令行界面工具-CLI](./cli/overview.md)
   - [Kuiper SQL参考](./sqls/overview.md)
   - [规则](./rules/overview.md)
@@ -120,11 +120,11 @@ Kuiper 可以运行在各类物联网的边缘使用场景中,比如工业物
 
 ## 从源码编译
 
-#### 准备
+### 准备
 
 + Go version >= 1.13
 
-#### 编译
+### 编译
 
 + 编译二进制:
 
@@ -143,8 +143,18 @@ Kuiper 可以运行在各类物联网的边缘使用场景中,比如工业物
   > Docker 镜像默认支持 EdgeX
 
 
-如果您要实现交叉编译,请参考[此文档](./cross-compile.md)。
+## 交叉编译二进制文件
+
+:::tip Tip
+Kuiper 插件基于 Golang 的方式实现,由于 Golang 本身的限制,使用了交叉编译的方式必须将编译参数 ``CGO_ENABLED`` 设置为0,而在该模式下,<u>插件将不可工作</u>。所以如果使用了 Kuiper 的插件的话,<u>不能以交叉编译的方式来生成二进制包。</u>
+:::
+
+- 准备
+  - docker version >= 19.03
+  - 启用 Docker CLI 的 experimental 模式(experimental mode)
+- 交叉编译二进制文件:``$ make cross_build``
+- 交叉编译跨平台镜像,并推到库中:``$ make cross_docker``
 
 ## 开源版权
 
-[Apache 2.0](LICENSE)
+[Apache 2.0](https://github.com/emqx/kuiper/blob/master/LICENSE)

Dosya farkı çok büyük olduğundan ihmal edildi
+ 11 - 11
docs/zh_CN/edgex/edgex_rule_engine_tutorial.md


+ 7 - 7
docs/zh_CN/extension/overview.md

@@ -1,9 +1,3 @@
-## 命名
-
-建议插件名使用 camel case 形式。插件命名有一些限制:
-1. 插件输出变量必须为**插件名的首字母大写形式**。 例如,插件名为 _file_ ,则其输出变量名必须为 _File_。
-2. _.so_ 文件的名字必须与输出变量名或者插件名相同。例如, _MySource.so_ 或 _mySink.so_。
-
 # 扩展
 
 Kuiper 允许用户自定义不同类型的扩展。 
@@ -18,7 +12,13 @@ Kuiper 允许用户自定义不同类型的扩展。
 - [Sink/Action 扩展](./sink.md)
 - [函数扩展](./function.md)
 
-### 状态存储
+## 命名
+
+建议插件名使用 camel case 形式。插件命名有一些限制:
+1. 插件输出变量必须为**插件名的首字母大写形式**。 例如,插件名为 _file_ ,则其输出变量名必须为 _File_。
+2. _.so_ 文件的名字必须与输出变量名或者插件名相同。例如, _MySource.so_ 或 _mySink.so_。
+
+## 状态存储
 
 Kuiper 扩展通过 context 参数暴露了一个基于键值对的状态存储接口,可用于所有类型的扩展,包括 Source,Sink 和 Function 扩展.
 

Dosya farkı çok büyük olduğundan ihmal edildi
+ 14 - 18
docs/zh_CN/manager-ui/overview.md


+ 8 - 8
docs/zh_CN/manager-ui/plugins_in_manager.md

@@ -1,14 +1,14 @@
-## 如何将自定义的插件展示在管理控制台的安装列表
+# 如何将自定义的插件展示在管理控制台的安装列表
 
-### 概览
+## 概览
 
 Kuiper 提供了插件的扩展机制,用户可以基于扩展接口来实现自定义的插件。在管理控制台上,用户可以直接通过界面进行插件的安装。如果读者有自定义的插件,也想出现在管理控制台的安装列表中,该文章可以给读者一些参考。
 
-### 插件元数据
+## 插件元数据
 
 插件元数据是一个 json 格式文件,用于描述插件的信息。这些信息会展示在管理控制台上,同时用于管理控制台生成插件配置页面。
 
-#### 元数据格式
+### 元数据格式
 
 插件元数据为 json 格式文件,不同的插件类型支持不同的属性。
 
@@ -101,14 +101,14 @@ Function 元数据详细配置请参考 [sink 元数据配置](../plugins/overvi
 
 ![function about](./resources/function_about.png)
 
-### 插件编译打包格式
+## 插件编译打包格式
 
 插件的开发,编译和打包请参考[插件开发教程](../plugins/plugins_tutorial.md)。自定义插件要展示在管理控制台,需要遵循如下原则:
 
 1. 插件元数据文件名应当与插件名字相同,且为 json 文件,例如`mySource.json`。
 2. 插件元数据文件应当放在打包的 zip 文件的跟目录下。
 
-### 发布至 Web 服务器
+## 发布至 Web 服务器
 
 在 `etc/kuiper.yaml` 中,有一个 `pluginHosts` 配置项,用户可以在这里配置服务器列表。除了官方的插件发布地址之外,用户可以在这里加入自己本地的插件发布地址。但是插件发布时候对目录的结构和内容有要求。部署服务应为
 
@@ -125,13 +125,13 @@ https://$host/$folder/$version/$os/$type/$plugin.zip
 3. $type: 插件类型,可为`sources`, `sinks`, `functions`.
 
 
-### 限制
+## 限制
 
 由于`Go`语言插件机制的限制,插件的编译环境必须与`Kuiper`环境相同。因此,建议插件在`Kuiper`相同版本的`Docker` 容器中进行编译。同时,由于`alpine` 环境部分库缺失,不建议在上面运行插件。因此,若需要插件安装运行,建议使用如下容器:
 
 - Kuiper: 使用 slim 镜像,例如 `0.9.1-slim`
 - 插件:使用对应版本默认镜像进行编译,例如 `0.9.1`
 
-### 总结
+## 总结
 
 Kuiper 控制台提供了自定义插件的展示机制。用户只需要在自定义插件包中添加插件元数据文件即可。同时,用户可以自定义插件仓库,从而方便地从控制台进行插件的安装和使用。

+ 2 - 2
docs/zh_CN/operation/configuration_file.md

@@ -39,10 +39,10 @@ basic:
     keyfile: /var/https-server.key
 ```
 
-#### restPort
+### restPort
 REST http 服务器监听端口
 
-#### restTls
+### restTls
 TLS 证书 cert 文件和 key 文件位置。如果 restTls 选项未配置,则 REST 服务器将启动为 http 服务器,否则启动为 https 服务器。
 
 ## Prometheus 配置

+ 4 - 4
docs/zh_CN/plugins/functions/functions.md

@@ -2,7 +2,7 @@
 
 Kuiper 可以定制函数,函数的开发、编译及使用请[参见这里](../../extension/function.md)。
 
-### echo 插件
+## echo 插件
 
 | 函数 | 示例      | 说明           |
 | ---- | --------- | -------------- |
@@ -16,7 +16,7 @@ echo(avg) 示例
   SELECT echo(avg) as r1 FROM test;
   ```
 
-### countPlusOne 插件
+## countPlusOne 插件
 
 | 函数         | 示例              | 说明                 |
 | ------------ | ----------------- | -------------------- |
@@ -30,7 +30,7 @@ countPlusOne(avg) 示例
   SELECT countPlusOne(avg) as r1 FROM test;
   ```
 
-### accumulateWordCount 插件
+## accumulateWordCount 插件
 
 | 函数                | 示例                         | 说明                     |
 | ------------------- | ---------------------------- | ------------------------ |
@@ -44,7 +44,7 @@ accumulateWordCount(avg,sep) 示例
   SELECT accumulateWordCount(avg,sep) as r1 FROM test;
   ```
 
-### 图像处理插件
+## 图像处理插件
 
 图像处理目前暂时只支持`png`和`jpeg`格式
 

+ 3 - 3
docs/zh_CN/plugins/sinks/influx.md

@@ -35,7 +35,7 @@
 
 下面是选择温度大于50度的样本规则,和一些配置文件仅供参考。
 
-#### ####/tmp/influxRule.txt
+### ####/tmp/influxRule.txt
 ```json
 {
   "id": "influx",
@@ -57,13 +57,13 @@
   ]
 }
 ```
-#### ####/tmp/influxPlugin.txt
+### ####/tmp/influxPlugin.txt
 ```json
 {
   "file":"http://localhost:8080/influx.zip"
 }
 ```
-#### plugins/go.mod
+### plugins/go.mod
 ```
 module plugins
 

+ 1 - 0
docs/zh_CN/rules/state_and_fault_tolerance.md

@@ -1,3 +1,4 @@
+# 状态和容错
 ## 状态
 
 Kuiper 支持有状态的规则流。Kuiper 中有两种状态:

+ 13 - 13
docs/zh_CN/streams.md

@@ -1,7 +1,7 @@
-## 流规格 
+# 流规格 
 
 
-### 数据类型
+## 数据类型
 
 参考 [Azure IoT](https://docs.microsoft.com/en-us/stream-analytics-query/data-types-azure-stream-analytics), 将布尔类型强制转换为 int。
 
@@ -17,9 +17,9 @@
 
 
 
-### 语言定义
+## 语言定义
 
-#### 创建流
+### 创建流
 
 ```sql
 CREATE STREAM   
@@ -102,7 +102,7 @@ demo: #Conf_key
 
 ```
 
-#### 删除流
+### 删除流
 
 删除流。
 
@@ -110,7 +110,7 @@ demo: #Conf_key
 DROP STREAM my_stream
 ```
 
-#### 描述流
+### 描述流
 
 打印流定义。
 
@@ -128,7 +128,7 @@ Format: json
 Key: id
 ```
 
-#### 解释流
+### 解释流
 
 打印流的详细运行时信息。
 
@@ -136,7 +136,7 @@ Key: id
 EXPLAIN STREAM my_stream
 ```
 
-#### 显示流
+### 显示流
 
 打印系统中所有已定义的流。
 
@@ -148,11 +148,11 @@ my_stream, iot_stream
 
 
 
-### 一个简单的 CLI
+## 一个简单的 CLI
 
 一个简单的命令行工具在 `stream/cli/main.go` 中实现。
 
-#### 运行 SQL 来管理流
+### 运行 SQL 来管理流
 
 运行 `kuiper stream` 命令,在显示 `kuiper>` 提示后,输入与流相关的 sql 语句,例如create,drop,description,explain和show stream语句以执行操作。
 
@@ -164,7 +164,7 @@ kuiper > DESCRIBE STREAM sname
 ```
 
 
-#### 查询
+### 查询
 
 ```bash
 cli query
@@ -174,9 +174,9 @@ kuiper > select USERID from demo;
 
 
 
-### 实现
+## 实现
 
-##### 如何保存流定义?
+### 如何保存流定义?
 
 请参阅下面的内容,需要使用存储器来保存流定义。