From c18c037642fce43463081fbc55526721a413e33b Mon Sep 17 00:00:00 2001 From: wanglin2 <1013335014@qq.com> Date: Fri, 24 Mar 2023 10:31:21 +0800 Subject: [PATCH] =?UTF-8?q?Doc=EF=BC=9A=E6=9B=B4=E6=96=B0=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/pages/Doc/catalogList.js | 1 + web/src/pages/Doc/en/changelog/index.md | 2 ++ web/src/pages/Doc/en/changelog/index.vue | 1 + web/src/pages/Doc/en/markdown/index.md | 35 +++++++++++++++++++++ web/src/pages/Doc/en/markdown/index.vue | 39 ++++++++++++++++++++++++ web/src/pages/Doc/en/xmind/index.md | 6 ++-- web/src/pages/Doc/en/xmind/index.vue | 6 ++-- web/src/pages/Doc/routerList.js | 2 +- web/src/pages/Doc/zh/changelog/index.md | 2 ++ web/src/pages/Doc/zh/changelog/index.vue | 1 + web/src/pages/Doc/zh/markdown/index.md | 35 +++++++++++++++++++++ web/src/pages/Doc/zh/markdown/index.vue | 39 ++++++++++++++++++++++++ web/src/pages/Doc/zh/xmind/index.md | 6 ++-- web/src/pages/Doc/zh/xmind/index.vue | 6 ++-- 14 files changed, 170 insertions(+), 11 deletions(-) create mode 100644 web/src/pages/Doc/en/markdown/index.md create mode 100644 web/src/pages/Doc/en/markdown/index.vue create mode 100644 web/src/pages/Doc/zh/markdown/index.md create mode 100644 web/src/pages/Doc/zh/markdown/index.vue diff --git a/web/src/pages/Doc/catalogList.js b/web/src/pages/Doc/catalogList.js index 37a956b8..3f4b4d07 100644 --- a/web/src/pages/Doc/catalogList.js +++ b/web/src/pages/Doc/catalogList.js @@ -28,6 +28,7 @@ let APIList = [ 'watermark', 'associativeLine', 'xmind', + 'markdown', 'utils' ] diff --git a/web/src/pages/Doc/en/changelog/index.md b/web/src/pages/Doc/en/changelog/index.md index 145b23db..7c449a42 100644 --- a/web/src/pages/Doc/en/changelog/index.md +++ b/web/src/pages/Doc/en/changelog/index.md @@ -4,6 +4,8 @@ optimization: 1.During rich text editing, when initially focusing, all are no longer selected by default; 2.When editing rich text, use the node fill color as the background color to avoid being invisible when the node color is white. +New: 1.Support for importing and exporting Markdown format files. + ## 0.4.6 New: 1.Associated lines support adjusting control points. diff --git a/web/src/pages/Doc/en/changelog/index.vue b/web/src/pages/Doc/en/changelog/index.vue index 30a99a95..a93b237e 100644 --- a/web/src/pages/Doc/en/changelog/index.vue +++ b/web/src/pages/Doc/en/changelog/index.vue @@ -3,6 +3,7 @@

Changelog

0.4.7

optimization: 1.During rich text editing, when initially focusing, all are no longer selected by default; 2.When editing rich text, use the node fill color as the background color to avoid being invisible when the node color is white.

+

New: 1.Support for importing and exporting Markdown format files.

0.4.6

New: 1.Associated lines support adjusting control points.

optimization: 1.When adding historical data, filter data that has not changed compared to the previous time.

diff --git a/web/src/pages/Doc/en/markdown/index.md b/web/src/pages/Doc/en/markdown/index.md new file mode 100644 index 00000000..6e48cf10 --- /dev/null +++ b/web/src/pages/Doc/en/markdown/index.md @@ -0,0 +1,35 @@ +# Markdown parse + +> v0.4.7+ + +Provides methods for importing and exporting `Markdown` files. + +## Import + +```js +import markdown from 'simple-mind-map/src/parse/markdown.js' +``` + +If you are using the file in the format of `umd`, you can obtain it in the following way: + +```html + +``` + +```js +MindMap.markdown +``` + +## Methods + +### transformToMarkdown(data) + +- `data`: Mind map data can be obtained using the `mindMap.getData()` method. + +Convert mind map data into `Markdown` format data, and the returned data is a string. + +### transformMarkdownTo(mdContent) + +- `mdContent`: The `Markdown` data to convert, string type. + +Convert the `Markdown` string into node tree data and return a `Promise` instance. You can use the `mindMap.setData()` method to render the converted data onto the canvas. diff --git a/web/src/pages/Doc/en/markdown/index.vue b/web/src/pages/Doc/en/markdown/index.vue new file mode 100644 index 00000000..d3f51a99 --- /dev/null +++ b/web/src/pages/Doc/en/markdown/index.vue @@ -0,0 +1,39 @@ + + + + + \ No newline at end of file diff --git a/web/src/pages/Doc/en/xmind/index.md b/web/src/pages/Doc/en/xmind/index.md index 7d1fca87..e4d9274e 100644 --- a/web/src/pages/Doc/en/xmind/index.md +++ b/web/src/pages/Doc/en/xmind/index.md @@ -12,9 +12,11 @@ import xmind from 'simple-mind-map/src/parse/xmind.js' If you are using the file in the format of `umd`, you can obtain it in the following way: -```js -import MindMap from "simple-mind-map/dist/simpleMindMap.umd.min" +```html + +``` +```js MindMap.xmind ``` diff --git a/web/src/pages/Doc/en/xmind/index.vue b/web/src/pages/Doc/en/xmind/index.vue index a2fbbdef..a2c3af24 100644 --- a/web/src/pages/Doc/en/xmind/index.vue +++ b/web/src/pages/Doc/en/xmind/index.vue @@ -9,9 +9,9 @@
import xmind from 'simple-mind-map/src/parse/xmind.js'
 

If you are using the file in the format of umd, you can obtain it in the following way:

-
import MindMap from "simple-mind-map/dist/simpleMindMap.umd.min"
-
-MindMap.xmind
+
<script src="simple-mind-map/dist/simpleMindMap.umd.min.js"></script>
+
+
MindMap.xmind
 

Methods

xmind.parseXmindFile(file)

diff --git a/web/src/pages/Doc/routerList.js b/web/src/pages/Doc/routerList.js index d46c02cc..dfb7372f 100644 --- a/web/src/pages/Doc/routerList.js +++ b/web/src/pages/Doc/routerList.js @@ -1,3 +1,3 @@ - export default [{"lang":"zh","children":[{"path":"associativeLine","title":"AssociativeLine 插件"},{"path":"batchExecution","title":"BatchExecution实例"},{"path":"changelog","title":"Changelog"},{"path":"command","title":"Command实例"},{"path":"constructor","title":"构造函数"},{"path":"doExport","title":"Export 插件"},{"path":"drag","title":"Drag插件"},{"path":"introduction","title":"简介"},{"path":"keyboardNavigation","title":"KeyboardNavigation插件"},{"path":"keyCommand","title":"KeyCommand实例"},{"path":"miniMap","title":"MiniMap插件"},{"path":"node","title":"Node实例"},{"path":"render","title":"Render实例"},{"path":"richText","title":"RichText插件"},{"path":"select","title":"Select 插件 "},{"path":"start","title":"开始"},{"path":"translate","title":"参与翻译"},{"path":"utils","title":"内置工具方法"},{"path":"view","title":"View实例"},{"path":"watermark","title":"Watermark插件"},{"path":"xmind","title":"XMind解析"}]},{"lang":"en","children":[{"path":"associativeLine","title":"AssociativeLine plugin"},{"path":"batchExecution","title":"batchExecution instance"},{"path":"changelog","title":"Changelog"},{"path":"command","title":"command instance"},{"path":"constructor","title":"Constructor"},{"path":"doExport","title":"Export plugin"},{"path":"drag","title":"Drag plugin"},{"path":"introduction","title":"Introduction"},{"path":"keyboardNavigation","title":"KeyboardNavigation plugin"},{"path":"keyCommand","title":"KeyCommand instance"},{"path":"miniMap","title":"MiniMap plugin"},{"path":"node","title":"Node instance"},{"path":"render","title":"Render instance"},{"path":"richText","title":"RichText plugin"},{"path":"select","title":"Select plugin"},{"path":"start","title":"Start"},{"path":"translate","title":"Participate in translation"},{"path":"utils","title":"Utility Methods"},{"path":"view","title":"View instance"},{"path":"watermark","title":"Watermark plugin"},{"path":"xmind","title":"XMind parse"}]}] + export default [{"lang":"zh","children":[{"path":"associativeLine","title":"AssociativeLine 插件"},{"path":"batchExecution","title":"BatchExecution实例"},{"path":"changelog","title":"Changelog"},{"path":"command","title":"Command实例"},{"path":"constructor","title":"构造函数"},{"path":"doExport","title":"Export 插件"},{"path":"drag","title":"Drag插件"},{"path":"introduction","title":"简介"},{"path":"keyboardNavigation","title":"KeyboardNavigation插件"},{"path":"keyCommand","title":"KeyCommand实例"},{"path":"miniMap","title":"MiniMap插件"},{"path":"node","title":"Node实例"},{"path":"render","title":"Render实例"},{"path":"richText","title":"RichText插件"},{"path":"select","title":"Select 插件 "},{"path":"start","title":"开始"},{"path":"translate","title":"参与翻译"},{"path":"utils","title":"内置工具方法"},{"path":"view","title":"View实例"},{"path":"watermark","title":"Watermark插件"},{"path":"xmind","title":"XMind解析"},{"path":"markdown","title":"Markdown解析"}]},{"lang":"en","children":[{"path":"associativeLine","title":"AssociativeLine plugin"},{"path":"batchExecution","title":"batchExecution instance"},{"path":"changelog","title":"Changelog"},{"path":"command","title":"command instance"},{"path":"constructor","title":"Constructor"},{"path":"doExport","title":"Export plugin"},{"path":"drag","title":"Drag plugin"},{"path":"introduction","title":"Introduction"},{"path":"keyboardNavigation","title":"KeyboardNavigation plugin"},{"path":"keyCommand","title":"KeyCommand instance"},{"path":"miniMap","title":"MiniMap plugin"},{"path":"node","title":"Node instance"},{"path":"render","title":"Render instance"},{"path":"richText","title":"RichText plugin"},{"path":"select","title":"Select plugin"},{"path":"start","title":"Start"},{"path":"translate","title":"Participate in translation"},{"path":"utils","title":"Utility Methods"},{"path":"view","title":"View instance"},{"path":"watermark","title":"Watermark plugin"},{"path":"xmind","title":"XMind parse"},{"path":"markdown","title":"Markdown parse"}]}] \ No newline at end of file diff --git a/web/src/pages/Doc/zh/changelog/index.md b/web/src/pages/Doc/zh/changelog/index.md index 0353e517..9c174ba9 100644 --- a/web/src/pages/Doc/zh/changelog/index.md +++ b/web/src/pages/Doc/zh/changelog/index.md @@ -4,6 +4,8 @@ 优化:1.富文本编辑时初始聚焦时不再默认全选;2.富文本编辑时使用节点填充色作为背景色,避免节点颜色为白色时看不见。 +新增:1.支持导入和导出Markdown格式文件。 + ## 0.4.6 新增:1.关联线支持调整控制点。 diff --git a/web/src/pages/Doc/zh/changelog/index.vue b/web/src/pages/Doc/zh/changelog/index.vue index 82d0cab8..253e3629 100644 --- a/web/src/pages/Doc/zh/changelog/index.vue +++ b/web/src/pages/Doc/zh/changelog/index.vue @@ -3,6 +3,7 @@

Changelog

0.4.7

优化:1.富文本编辑时初始聚焦时不再默认全选;2.富文本编辑时使用节点填充色作为背景色,避免节点颜色为白色时看不见。

+

新增:1.支持导入和导出Markdown格式文件。

0.4.6

新增:1.关联线支持调整控制点。

优化:1.添加历史数据时过滤和上一次相比没有改变的数据。

diff --git a/web/src/pages/Doc/zh/markdown/index.md b/web/src/pages/Doc/zh/markdown/index.md new file mode 100644 index 00000000..c09146fb --- /dev/null +++ b/web/src/pages/Doc/zh/markdown/index.md @@ -0,0 +1,35 @@ +# Markdown解析 + +> v0.4.7+ + +提供导入和导出`Markdown`文件的方法。 + +## 引入 + +```js +import markdown from 'simple-mind-map/src/parse/markdown.js' +``` + +如果使用的是`umd`格式的文件,那么可以通过如下方式获取: + +```html + +``` + +```js +MindMap.markdown +``` + +## 方法 + +### transformToMarkdown(data) + +- `data`:思维导图数据,可以通过`mindMap.getData()`方法获取。 + +将思维导图数据转换成`Markdown`格式数据,返回的是字符串。 + +### transformMarkdownTo(mdContent) + +- `mdContent`:要转换的`Markdown`数据,字符串类型。 + +将`Markdown`字符串转换成节点树数据,返回一个`Promise`实例。可以使用`mindMap.setData()`方法将转换后的数据渲染到画布上。 diff --git a/web/src/pages/Doc/zh/markdown/index.vue b/web/src/pages/Doc/zh/markdown/index.vue new file mode 100644 index 00000000..134eb73f --- /dev/null +++ b/web/src/pages/Doc/zh/markdown/index.vue @@ -0,0 +1,39 @@ + + + + + \ No newline at end of file diff --git a/web/src/pages/Doc/zh/xmind/index.md b/web/src/pages/Doc/zh/xmind/index.md index ce6c17c0..3f827b7f 100644 --- a/web/src/pages/Doc/zh/xmind/index.md +++ b/web/src/pages/Doc/zh/xmind/index.md @@ -12,9 +12,11 @@ import xmind from 'simple-mind-map/src/parse/xmind.js' 如果使用的是`umd`格式的文件,那么可以通过如下方式获取: -```js -import MindMap from "simple-mind-map/dist/simpleMindMap.umd.min" +```html + +``` +```js MindMap.xmind ``` diff --git a/web/src/pages/Doc/zh/xmind/index.vue b/web/src/pages/Doc/zh/xmind/index.vue index 1cdd47fa..db2a4228 100644 --- a/web/src/pages/Doc/zh/xmind/index.vue +++ b/web/src/pages/Doc/zh/xmind/index.vue @@ -9,9 +9,9 @@
import xmind from 'simple-mind-map/src/parse/xmind.js'
 

如果使用的是umd格式的文件,那么可以通过如下方式获取:

-
import MindMap from "simple-mind-map/dist/simpleMindMap.umd.min"
-
-MindMap.xmind
+
<script src="simple-mind-map/dist/simpleMindMap.umd.min.js"></script>
+
+
MindMap.xmind
 

方法

xmind.parseXmindFile(file)