Skip to content

Commit 6aa77df

Browse files
committed
feat: enhance XMindMark syntax with examples for hyperlinks, notes, and folded topics
- Added examples and usage details for new features in the XMindMark syntax documentation. - Updated HTML to include a link to the npm package and improved the instruction layout in the editor. - Implemented local storage functionality to save and load editor content.
1 parent 002bf6c commit 6aa77df

10 files changed

Lines changed: 442 additions & 32 deletions

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ npm run build
7272

7373
XMindMark syntax is similar to Markdown, using indentation and special symbols to represent the hierarchical structure and relationships of elements in the mind map.
7474

75-
#### Basic Syntax Example:
75+
#### Basic Syntax Example
7676

7777
```
7878
Central Topic
@@ -85,11 +85,14 @@ Central Topic
8585
- Subsubtopic 2.1.1
8686
```
8787

88-
#### Special Features:
88+
#### Advanced Syntax
8989

9090
- **Relationships**: Use `[number]` and `[^number]` to create connections between topics
9191
- **Boundaries**: Use `[B]` or `[Bnumber]` to create boundaries
9292
- **Summaries**: Use `[S]` or `[Snumber]` to create summaries
93+
- **Hyperlinks**: Use `[L:url]` to add hyperlinks to topics
94+
- **Notes**: Use `[N:content]` to add text notes to topics
95+
- **Folding**: Use `[F]` to make topics appear folded
9396

9497
For detailed syntax, please refer to:
9598

README_zh-CN.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ npm run build
7272

7373
XMindMark 语法类似 Markdown,使用缩进和特殊符号表示思维导图的层级结构和元素关系。
7474

75-
#### 基础语法示例:
75+
#### 基础语法示例
7676

7777
```
7878
中心主题
@@ -85,11 +85,14 @@ XMindMark 语法类似 Markdown,使用缩进和特殊符号表示思维导图
8585
- 子子主题2.1.1
8686
```
8787

88-
#### 特殊功能:
88+
#### 高级语法
8989

9090
- **联系**: 使用 `[数字]``[^数字]` 创建主题间连接
9191
- **外框**: 使用 `[B]``[B数字]` 创建外框
9292
- **概要**: 使用 `[S]``[S数字]` 创建概要
93+
- **超链接**: 使用 `[L:url]` 为主题添加超链接
94+
- **笔记**: 使用 `[N:内容]` 为主题添加文本笔记
95+
- **折叠**: 使用 `[F]` 使主题显示为折叠状态
9396

9497
详细语法请参考:
9598

docs/specification.md

Lines changed: 63 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -222,20 +222,74 @@ Central Topic
222222
- subtopic 2 [B]
223223
```
224224

225-
# Advanced usage
225+
## Hyperlinks
226226

227-
### Perform multiple marker symbol at one topic
227+
**_Syntax: `[L:url]` - This marker symbol adds a hyperlink to a topic._**
228228

229-
Every marker symbol of topic must be placed after topic content without any spaces. Like:
229+
Add a hyperlink to a topic by appending `[L:url]` after the topic content. The URL should be placed inside the brackets without any spaces between `L:` and the URL.
230230

231+
```
232+
Central Topic
233+
234+
- Topic with hyperlink [L:https://example.com]
235+
- Another topic
231236
```
232237

233-
Seasons of 2021
238+
Hyperlinks can be combined with other markers:
239+
240+
```
241+
Central Topic
234242
235-
- Spring [1]
236-
- Summer [B1]
237-
- Autumn [B1][^1](Cool)[S1]
238-
- Winter [S1]
243+
- Topic with hyperlink and boundary [L:https://example.com][B]
239244
```
240245

241-
In the example above, "Summer" and "Autumn" will be wrapped by a boundary, "Autumn" and "Winter" will be wrapped by a summary topic, a relationship will connected "Spring" and "Autumn" with title: "Cool".
246+
## Notes
247+
248+
**_Syntax: `[N:content]` - This marker symbol adds text notes to a topic._**
249+
250+
Add text notes to a topic by appending `[N:content]` after the topic content. The note content should be placed inside the brackets without any spaces between `N:` and the content.
251+
252+
```
253+
Central Topic
254+
255+
- Topic with a note [N:This is an important note]
256+
- Another topic
257+
```
258+
259+
Notes currently only support plain text content. Complex formatted content or HTML is not supported in the note content.
260+
261+
Notes can be combined with other markers:
262+
263+
```
264+
Central Topic
265+
266+
- Topic with note and summary [N:Remember this detail][S]
267+
```
268+
269+
## Folded Topics
270+
271+
**_Syntax: `[F]` - This marker symbol makes a topic appear folded._**
272+
273+
Make a topic appear folded (collapsed) by appending `[F]` after the topic content.
274+
275+
```
276+
Central Topic
277+
278+
- Folded topic with subtopics [F]
279+
* Subtopic 1
280+
* Subtopic 2
281+
```
282+
283+
This is particularly useful for complex mind maps where you want certain branches to be initially collapsed for better readability.
284+
285+
Folding can be combined with other markers:
286+
287+
```
288+
Central Topic
289+
290+
- Folded topic with boundary [F][B]
291+
* Subtopic 1
292+
* Subtopic 2
293+
```
294+
295+

docs/specification_zh-CN.md

Lines changed: 62 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -222,19 +222,72 @@ XMindMark 的第一行将被视为中心主题,之前的任何空行都将被
222222
- 子主题 2 [B]
223223
```
224224

225-
# 高级用法
225+
## 超链接
226226

227-
### 在一个主题上应用多个标记符号
227+
**_语法:`[L:url]` - 此标记符号为主题添加超链接。_**
228228

229-
主题的每个标记符号必须放在主题内容之后,中间不能有任何空格。例如:
229+
通过在主题内容后附加 `[L:url]` 为主题添加超链接。URL 应该放在括号内,`L:` 和 URL 之间不应有任何空格。
230230

231231
```
232-
2021年的季节
232+
中心主题
233+
234+
- 带超链接的主题 [L:https://example.com]
235+
- 其他主题
236+
```
237+
238+
超链接可以与其他标记组合使用:
239+
240+
```
241+
中心主题
242+
243+
- 带超链接和外框的主题 [L:https://example.com][B]
244+
```
245+
246+
## 笔记
247+
248+
**_语法:`[N:内容]` - 此标记符号为主题添加文本笔记。_**
249+
250+
通过在主题内容后附加 `[N:内容]` 为主题添加文本笔记。笔记内容应该放在括号内,`N:` 和内容之间不应有任何空格。
233251

234-
- 春季 [1]
235-
- 夏季 [B1]
236-
- 秋季 [B1][^1](凉爽)[S1]
237-
- 冬季 [S1]
238252
```
253+
中心主题
254+
255+
- 带笔记的主题 [N:这是一个重要的笔记]
256+
- 其他主题
257+
```
258+
259+
笔记目前只支持纯文本内容。笔记内容中不支持复杂的格式化内容或HTML。
260+
261+
笔记可以与其他标记组合使用:
262+
263+
```
264+
中心主题
265+
266+
- 带笔记和概要的主题 [N:记住这个细节][S]
267+
```
268+
269+
## 折叠主题
270+
271+
**_语法:`[F]` - 此标记符号使主题显示为折叠状态。_**
272+
273+
通过在主题内容后附加 `[F]` 使主题显示为折叠(收起)状态。
274+
275+
```
276+
中心主题
277+
278+
- 带子主题的折叠主题 [F]
279+
* 子主题 1
280+
* 子主题 2
281+
```
282+
283+
这对于复杂的思维导图特别有用,您可以让某些分支初始时折叠以提高可读性。
284+
285+
折叠可以与其他标记组合使用:
286+
287+
```
288+
中心主题
239289
240-
在上面的示例中,"夏季"和"秋季"将被一个外框包围,"秋季"和"冬季"将被一个概要主题包围,一个标题为"凉爽"的关系将连接"春季"和"秋季"。
290+
- 带外框的折叠主题 [F][B]
291+
* 子主题 1
292+
* 子主题 2
293+
```

docs/xmindmark-syntax.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,33 @@ XMindMark Syntax Guide
6767
- Relationships can connect to boundary or summary titles
6868
[B] Advanced Syntax
6969

70-
- Notes [S]
70+
- Hyperlinks Syntax
71+
* Syntax
72+
- Use [L:url] to add hyperlink to topic
73+
- Example: GitHub Website [L:https://github.com]
74+
* Usage
75+
- Can be applied to any topic including central topic
76+
- Can be combined with other markers
77+
78+
- Notes Syntax
79+
* Syntax
80+
- Use [N:content] to add notes to topic
81+
- Example: Meeting Topic [N:Remember to prepare slides]
82+
* Limitations
83+
- Only supports plain text, no complex formatting
84+
- Cannot contain nested markers
85+
86+
- Folded Topics Syntax
87+
* Syntax
88+
- Use [F] to make a topic appear folded
89+
- Example: Project Details [F]
90+
- Subtopic 1
91+
- Subtopic 2
92+
* Behavior
93+
- Child topics will be hidden by default in the mind map
94+
- Useful for large mind maps with many branches
95+
96+
- Usage Tips [S]
7197
* Marker Rules
7298
- Markers must directly follow topic content (no spaces)
7399
- Numbers can be non-consecutive

docs/xmindmark-syntax_zh-CN.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ XMindMark 语法教程
1919
[S1] 概要
2020
[B1] 基础语法
2121

22-
- 联系语法
22+
- 关系语法
2323
* 语法规则
2424
- 使用 [<数字>] 标记源主题[1]
2525
- 使用 [^<数字>] 标记目标主题
26-
- 相同数字创建联系
27-
* 联系标题[^1](联系标题)
26+
- 相同数字创建关系
27+
* 关系标题[^1](关系标题)
2828
-[^<数字>] 后添加(标题内容)
2929

3030
- 外框语法
@@ -67,7 +67,33 @@ XMindMark 语法教程
6767
- 联系可以连接到外框或概要标题
6868
[B] 进阶语法
6969

70-
- 注意事项 [S]
70+
- 超链接语法
71+
* 语法
72+
- 使用 [L:url] 为主题添加超链接
73+
- 例如:GitHub网站 [L:https://github.com]
74+
* 用法
75+
- 可应用于任何主题,包括中心主题
76+
- 可与其他标记组合使用
77+
78+
- 笔记语法
79+
* 语法
80+
- 使用 [N:内容] 为主题添加笔记
81+
- 例如:会议主题 [N:记得准备幻灯片]
82+
* 限制
83+
- 仅支持纯文本,不支持复杂格式
84+
- 不能包含嵌套标记
85+
86+
- 折叠主题语法
87+
* 语法
88+
- 使用 [F] 使主题显示为折叠状态
89+
- 例如:项目细节 [F]
90+
- 子主题 1
91+
- 子主题 2
92+
* 行为
93+
- 子主题在思维导图中默认会被隐藏
94+
- 适用于具有多个分支的大型思维导图
95+
96+
- 使用提示 [S]
7197
* 标记规则
7298
- 标记必须紧跟主题内容(无空格)
7399
- 数字可以不连续

index.html

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@
4646
<span class="logo-tag">XMind Online Editor</span>
4747
</div>
4848
<div class="github-link">
49+
<a
50+
href="https://www.npmjs.com/package/@markxmind/markxmind-core"
51+
target="_blank"
52+
rel="noopener noreferrer"
53+
class="npm-link"
54+
title="@markxmind/markxmind-core on npm"
55+
>
56+
<img src="https://img.shields.io/npm/v/@markxmind/markxmind-core.svg" alt="npm version" />
57+
</a>
4958
<a href="https://github.com/jinzcdev/markxmind/stargazers" target="_blank" class="github-stars">
5059
<img src="https://img.shields.io/github/stars/jinzcdev/markxmind" alt="GitHub Stars" />
5160
</a>
@@ -95,7 +104,17 @@
95104
</svg>
96105
Choose File <small>(.xmind / .xmindmark / .md / .txt)</small>
97106
</label>
98-
<div class="instruction">Or edit your mind map below:</div>
107+
<div class="instruction-row">
108+
<span class="instruction">Or edit your mind map below:</span>
109+
<div class="example-segment" role="group" aria-label="Load example">
110+
<button type="button" id="load-example-en" class="example-segment-btn" title="Load English example">
111+
EN
112+
</button>
113+
<button type="button" id="load-example-cn" class="example-segment-btn" title="Load Chinese example">
114+
115+
</button>
116+
</div>
117+
</div>
99118
<div id="input" class="editor-container"></div>
100119
</div>
101120
<div id="resizer"></div>

0 commit comments

Comments
 (0)