Skip to content

Commit a39acd1

Browse files
committed
docs: refactor the docs of the project
1 parent 4976884 commit a39acd1

Some content is hidden

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

86 files changed

+1367
-1173
lines changed

.gitignore

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1+
.DS_Store
2+
3+
/node_modules
4+
15
/dist
26
/lib
37
/es
48

5-
/examples/dist
6-
/node_modules
9+
.umi
10+
.umi-production
11+
.env.local
12+
713
.eslintcache
14+
/examples/dist

.umirc.ts

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { defineConfig } from 'dumi';
2+
3+
export default defineConfig({
4+
mode: 'site',
5+
logo: 'https://img.alicdn.com/tfs/TB1FFA1CFP7gK0jSZFjXXc5aXXa-214-200.png',
6+
title: 'GGEditor',
7+
favicon: 'https://img.alicdn.com/tfs/TB1Des3CNn1gK0jSZKPXXXvUXXa-16-16.ico',
8+
navs: {
9+
'en-US': [
10+
null,
11+
{
12+
title: 'GitHub',
13+
path: 'https://github.com/alibaba/GGEditor',
14+
},
15+
{
16+
title: 'Changelog',
17+
path: 'https://github.com/alibaba/GGEditor/blob/master/CHANGELOG.md',
18+
},
19+
],
20+
'zh-CN': [
21+
null,
22+
{
23+
title: 'GitHub',
24+
path: 'https://github.com/alibaba/GGEditor',
25+
},
26+
{
27+
title: '更新日志',
28+
path: 'https://github.com/alibaba/GGEditor/blob/master/CHANGELOG.md',
29+
},
30+
],
31+
},
32+
extraBabelPlugins: [
33+
[
34+
'import',
35+
{
36+
libraryName: 'antd',
37+
libraryDirectory: 'es',
38+
style: 'css',
39+
},
40+
],
41+
],
42+
});

README.en-US.md

+3-21
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A visual graph editor based on [G6](https://github.com/antvis/g6) and [React](ht
1616

1717
### npm
1818

19-
```sh
19+
```bash
2020
npm install gg-editor --save
2121
```
2222

@@ -91,13 +91,9 @@ const data = {
9191
</GGEditor>;
9292
```
9393

94-
## Documentation
95-
96-
- [API documents](https://www.yuque.com/ggeditor/api-en)
97-
9894
## Examples
9995

100-
```sh
96+
```bash
10197
# Clone the repository
10298
$ git clone https://github.com/alibaba/GGEditor.git
10399

@@ -108,19 +104,5 @@ $ cd gg-editor
108104
$ npm install
109105

110106
# Run examples
111-
$ npm start
107+
$ npm doc:start
112108
```
113-
114-
| Type | Example | Source |
115-
| :-------- | :--------------------- | :---------------------------------------- |
116-
| editor | editor-context | [source](examples/editor-context) |
117-
| graph | flow | [source](examples/flow) |
118-
| graph | mind | [source](examples/mind) |
119-
| component | component-command | [source](examples/component-command) |
120-
| component | component-item-panel | [source](examples/component-item-panel) |
121-
| component | component-detail-panel | [source](examples/component-detail-panel) |
122-
| plugin | plugin-editable-label | [source](examples/plugin-editable-label) |
123-
| plugin | plugin-item-popover | [source](examples/plugin-item-popover) |
124-
| plugin | plugin-context-menu | [source](examples/plugin-context-menu) |
125-
| register | register-node | [source](examples/register-node) |
126-
| register | register-dom-node | [source](examples/register-dom-node) |

README.md

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

1717
### npm
1818

19-
```sh
19+
```bash
2020
npm install gg-editor --save
2121
```
2222

@@ -91,13 +91,9 @@ const data = {
9191
</GGEditor>;
9292
```
9393

94-
## 文档
95-
96-
- [API 文档](https://www.yuque.com/ggeditor/api)
97-
9894
## 示例
9995

100-
```sh
96+
```bash
10197
# 克隆仓库
10298
$ git clone https://github.com/alibaba/GGEditor.git
10399

@@ -108,19 +104,5 @@ $ cd gg-editor
108104
$ npm install
109105

110106
# 运行示例
111-
$ npm start
107+
$ npm doc:start
112108
```
113-
114-
| 类型 | 示例 | 源码 |
115-
| :----- | :--------------------- | :---------------------------------------- |
116-
| 编辑器 | editor-context | [source](examples/editor-context) |
117-
| 图表 | flow | [source](examples/flow) |
118-
| 图表 | mind | [source](examples/mind) |
119-
| 组件 | component-command | [source](examples/component-command) |
120-
| 组件 | component-item-panel | [source](examples/component-item-panel) |
121-
| 组件 | component-detail-panel | [source](examples/component-detail-panel) |
122-
| 插件 | plugin-editable-label | [source](examples/plugin-editable-label) |
123-
| 插件 | plugin-item-popover | [source](examples/plugin-item-popover) |
124-
| 插件 | plugin-context-menu | [source](examples/plugin-context-menu) |
125-
| 注册 | register-node | [source](examples/register-node) |
126-
| 注册 | register-dom-node | [source](examples/register-dom-node) |

docs/examples/component/command.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Command
3+
group:
4+
title: Component
5+
order: 2
6+
---
7+
8+
<code src="../../../examples/component/command" compact background="#f6f7f9" />
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: 命令
3+
group:
4+
title: 组件
5+
order: 2
6+
---
7+
8+
<code src="../../../examples/component/command" compact background="#f6f7f9" />
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: DetailPanel
3+
group:
4+
title: Component
5+
order: 2
6+
---
7+
8+
<code src="../../../examples/component/detail-panel" compact background="#f6f7f9" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: 详情面板
3+
group:
4+
title: 组件
5+
order: 2
6+
---
7+
8+
<code src="../../../examples/component/detail-panel" compact background="#f6f7f9" />

docs/examples/component/item-panel.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: ItemPanel
3+
group:
4+
title: Component
5+
order: 2
6+
---
7+
8+
<code src="../../../examples/component/item-panel" compact background="#f6f7f9" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: 元素面板
3+
group:
4+
title: 组件
5+
order: 2
6+
---
7+
8+
<code src="../../../examples/component/item-panel" compact background="#f6f7f9" />

docs/examples/editor/context.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Context
3+
group:
4+
title: Editor
5+
order: 0
6+
---
7+
8+
<code src="../../../examples/editor/context" compact background="#f6f7f9" />

docs/examples/editor/context.zh-CN.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: 上下文
3+
group:
4+
title: 编辑器
5+
order: 0
6+
---
7+
8+
<code src="../../../examples/editor/context" compact background="#f6f7f9" />

docs/examples/graph/flow.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Flow
3+
group:
4+
title: Graph
5+
order: 1
6+
---
7+
8+
<code src="../../../examples/graph/flow" compact background="#f6f7f9" />

docs/examples/graph/flow.zh-CN.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: 流程图
3+
group:
4+
title: 图表
5+
order: 1
6+
---
7+
8+
<code src="../../../examples/graph/flow" compact background="#f6f7f9" />

docs/examples/graph/mind.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Mind
3+
group:
4+
title: Graph
5+
order: 1
6+
---
7+
8+
<code src="../../../examples/graph/mind" compact background="#f6f7f9" />

docs/examples/graph/mind.zh-CN.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: 脑图
3+
group:
4+
title: 图表
5+
order: 1
6+
---
7+
8+
<code src="../../../examples/graph/mind" compact background="#f6f7f9" />

docs/examples/plugin/context-menu.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: ContextMenu
3+
group:
4+
title: Plugin
5+
order: 3
6+
---
7+
8+
<code src="../../../examples/plugin/context-menu" compact background="#f6f7f9" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: 右键菜单
3+
group:
4+
title: 插件
5+
order: 3
6+
---
7+
8+
<code src="../../../examples/plugin/context-menu" compact background="#f6f7f9" />
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: EditableLabel
3+
group:
4+
title: Plugin
5+
order: 3
6+
---
7+
8+
<code src="../../../examples/plugin/editable-label" compact background="#f6f7f9" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: 标签编辑
3+
group:
4+
title: 插件
5+
order: 3
6+
---
7+
8+
<code src="../../../examples/plugin/editable-label" compact background="#f6f7f9" />

docs/examples/plugin/item-popover.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: ItemPopover
3+
group:
4+
title: Plugin
5+
order: 3
6+
---
7+
8+
<code src="../../../examples/plugin/item-popover" compact background="#f6f7f9" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: 元素浮层
3+
group:
4+
title: 插件
5+
order: 3
6+
---
7+
8+
<code src="../../../examples/plugin/item-popover" compact background="#f6f7f9" />

docs/examples/register/dom-node.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: DOMNode
3+
group:
4+
title: Register
5+
order: 4
6+
---
7+
8+
<code src="../../../examples/register/dom-node" compact background="#f6f7f9" />
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: DOM 节点
3+
group:
4+
title: 注册
5+
order: 4
6+
---
7+
8+
<code src="../../../examples/register/dom-node" compact background="#f6f7f9" />

docs/examples/register/node.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Node
3+
group:
4+
title: Register
5+
order: 4
6+
---
7+
8+
<code src="../../../examples/register/node" compact background="#f6f7f9" />

docs/examples/register/node.zh-CN.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: 节点
3+
group:
4+
title: 注册
5+
order: 4
6+
---
7+
8+
<code src="../../../examples/register/node" compact background="#f6f7f9" />

0 commit comments

Comments
 (0)