Skip to content

Commit b3b85f5

Browse files
committed
feat: transform into logseq plugin
1 parent aece666 commit b3b85f5

25 files changed

Lines changed: 1259 additions & 3361 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ data.json
2020

2121
# Exclude macOS Finder (System Explorer) View States
2222
.DS_Store
23+
24+
dist/*

dist/LICENSE

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Copyright (C) 2020-2025 by Dynalist Inc.
2+
3+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
4+
5+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

dist/README.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
[English](README.md) | [中文](README_zh.md)
2+
3+
# Obsidian Mind Map
4+
5+
An intuitive mind map plugin for Obsidian that transforms your markdown documents into interactive mind maps using [Mind Elixir](https://github.com/ssshooter/mind-elixir-core).
6+
7+
## Features
8+
9+
### Mind Map View
10+
11+
![Mind Map View](./screenshots/ob-mindmap-open-mindmap.jpg)
12+
13+
- **Open as Mind Map**: Transform any markdown file into an interactive mind map view
14+
- **Smart Parsing**: Automatically parses markdown headers and lists into hierarchical mind map nodes
15+
- **Split View**: Opens mind maps in a split pane while preserving your original document
16+
- **Auto-Refresh**: Mind map updates automatically when the source file changes
17+
- **Customizable Root**: Choose between using the filename or the first H1 heading as the root node
18+
19+
### Code Block Rendering
20+
21+
![Code Block Rendering](./screenshots/ob-mindelixir-codeblock.gif)
22+
23+
- **Inline Mind Maps**: Embed mind maps directly in your notes using `mindelixir` code blocks
24+
- **Plain Text Format**: Use simple indented text format for quick mind map creation
25+
- **Non-Intrusive**: Mind maps render seamlessly within your markdown content
26+
27+
### Mobile Support
28+
29+
![Mobile Support](./screenshots/ob-mindmap-mobile.jpg)
30+
31+
- **Works on Mobile**: Fully functional on Obsidian's mobile app, allowing you to view and interact with mind maps on the go
32+
33+
## Usage
34+
35+
### Method 1: Mind Map View
36+
37+
1. Open any markdown file in Obsidian
38+
2. Click the mind map icon in the ribbon, or
39+
3. Use the command palette: `Mind Map: Open as Mind Map`
40+
4. Your markdown content will open as an interactive mind map in a split pane
41+
42+
### Method 2: Code Blocks
43+
44+
Create inline mind maps using the `mindelixir` code block:
45+
46+
````markdown
47+
```mindelixir
48+
Root Topic
49+
Subtopic 1
50+
Detail 1
51+
Detail 2
52+
Subtopic 2
53+
Detail 3
54+
```
55+
````
56+
57+
For the specific format specification, please refer to the [Mind Elixir Plain Text Format Reference](https://github.com/SSShooter/mind-elixir-core/blob/master/skills/plaintext-format/SKILL.md).
58+
59+
## Settings
60+
61+
- **Use first H1 as root**: When enabled, uses the first H1 heading as the root node instead of the filename. Content before the first H1 will be ignored.
62+
63+
## Manually installing the plugin
64+
65+
- Copy over `main.js`, `styles.css`, `manifest.json` to your vault `VaultFolder/.obsidian/plugins/your-plugin-id/`.
66+
67+
## TODO
68+
69+
- Support node copy and paste
70+
- Support reverse edit in `mindelixir` code block
71+
- Record links delta if modified
72+
- Support image in mind map

dist/README_zh.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
[English](README.md) | [中文](README_zh.md)
2+
3+
# Obsidian 思维导图
4+
5+
一个直观的 Obsidian 思维导图插件,使用 [Mind Elixir](https://github.com/ssshooter/mind-elixir-core) 将您的 Markdown 文档转换为交互式思维导图。
6+
7+
## 功能特性
8+
9+
### 思维导图视图
10+
11+
![思维导图视图](./screenshots/ob-mindmap-open-mindmap.jpg)
12+
13+
- **打开为思维导图**:将任意 Markdown 文件转换为交互式思维导图视图
14+
- **智能解析**:自动将 Markdown 标题和列表解析为具有层级的思维导图节点
15+
- **分屏视图**:在分屏中打开思维导图,同时保留原始文档
16+
- **自动更新**:源文件内容发生变更时,思维导图会自动刷新
17+
- **自定义根节点**:可选择使用文件名或第一个 H1 标题作为根节点
18+
19+
### 代码块渲染
20+
21+
![代码块渲染](./screenshots/ob-mindelixir-codeblock.gif)
22+
23+
- **内联思维导图**:使用 `mindelixir` 代码块在笔记中直接嵌入思维导图
24+
- **纯文本格式**:使用简单的缩进文本格式快速创建思维导图
25+
- **无缝集成**:思维导图在 Markdown 内容中自然渲染
26+
27+
### 移动端支持
28+
29+
![移动端支持](./screenshots/ob-mindmap-mobile.jpg)
30+
31+
- **支持移动端**:在 Obsidian 移动端应用上提供完整功能,让您随时随地查看并操作思维导图
32+
33+
## 使用方法
34+
35+
### 方法一:思维导图视图
36+
37+
1. 在 Obsidian 中打开任意 Markdown 文件
38+
2. 点击左侧边栏(Ribbon)的思维导图图标,或者
39+
3. 使用命令面板,输入并选择:`Mind Map: Open as Mind Map`
40+
4. 您的 Markdown 内容将在分屏中作为交互式思维导图打开
41+
42+
### 方法二:代码块
43+
44+
使用 `mindelixir` 代码块创建内联思维导图:
45+
46+
````markdown
47+
```mindelixir
48+
Root Topic
49+
Subtopic 1
50+
Detail 1
51+
Detail 2
52+
Subtopic 2
53+
Detail 3
54+
```
55+
````
56+
57+
详细的格式规范,请参考 [Mind Elixir 纯文本格式规范](https://github.com/SSShooter/mind-elixir-core/blob/master/skills/plaintext-format/SKILL.md)
58+
59+
## 设置
60+
61+
- **使用第一个 H1 作为根节点 (Use first H1 as root)**:启用后,将使用文件中的第一个 H1 标题而不是文件名作为根节点。第一个 H1 之前的内容将被忽略。
62+
63+
## 手动安装插件
64+
65+
-`main.js``styles.css``manifest.json` 复制到您的 Vault 目录下的 `VaultFolder/.obsidian/plugins/your-plugin-id/` 中。
66+
67+
## 待办事项 (TODO)
68+
69+
- 支持节点的复制和粘贴
70+
- 支持在 `mindelixir` 代码块中进行反向编辑
71+
- 支持连线的记录与修改
72+
- 导图内嵌图片支持

dist/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Logseq Mind Elixir Plugin</title>
7+
<script type="module" crossorigin src="./assets/index-DJsRZgfi.js"></script>
8+
<link rel="stylesheet" crossorigin href="./assets/index-Bpl1sGTd.css">
9+
</head>
10+
<body>
11+
<div id="app"></div>
12+
</body>
13+
</html>

dist/package.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "obsidian-mindmap",
3+
"version": "2.0.0",
4+
"description": "An intuitive mind map plugin for Obsidian.",
5+
"main": "index.html",
6+
"type": "module",
7+
"author": "SSShooter",
8+
"logseq": {
9+
"id": "logseq-mind-elixir",
10+
"title": "Mind Elixir",
11+
"icon": "map"
12+
},
13+
"scripts": {
14+
"dev": "vite",
15+
"build": "tsc -noEmit -skipLibCheck && vite build",
16+
"lint": "eslint ."
17+
},
18+
"keywords": [
19+
"logseq",
20+
"mindmap",
21+
"mind-elixir"
22+
],
23+
"license": "0-BSD",
24+
"devDependencies": {
25+
"@eslint/js": "9.30.1",
26+
"@types/node": "^16.11.6",
27+
"esbuild": "0.25.5",
28+
"globals": "14.0.0",
29+
"jiti": "2.6.1",
30+
"tslib": "2.4.0",
31+
"typescript": "~5.8.3",
32+
"typescript-eslint": "8.35.1"
33+
},
34+
"dependencies": {
35+
"mind-elixir": "5.10.0-beta.1",
36+
"vite": "^8.0.1",
37+
"vite-plugin-logseq": "^1.1.2"
38+
}
39+
}

esbuild.config.mjs

Lines changed: 0 additions & 84 deletions
This file was deleted.

index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Logseq Mind Elixir Plugin</title>
7+
</head>
8+
<body>
9+
<div id="app"></div>
10+
<script type="module" src="/src/main.ts"></script>
11+
</body>
12+
</html>

manifest.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

package.json

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,38 @@
22
"name": "obsidian-mindmap",
33
"version": "2.0.0",
44
"description": "An intuitive mind map plugin for Obsidian.",
5-
"main": "main.js",
5+
"main": "dist/index.html",
66
"type": "module",
7+
"author": "SSShooter",
8+
"logseq": {
9+
"id": "logseq-mind-elixir",
10+
"title": "Mind Elixir",
11+
"icon": "map"
12+
},
713
"scripts": {
8-
"dev": "node esbuild.config.mjs",
9-
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
10-
"version": "node version-bump.mjs && git add manifest.json versions.json",
14+
"dev": "vite",
15+
"build": "tsc -noEmit -skipLibCheck && vite build",
1116
"lint": "eslint ."
1217
},
13-
"keywords": [],
18+
"keywords": [
19+
"logseq",
20+
"mindmap",
21+
"mind-elixir"
22+
],
1423
"license": "0-BSD",
1524
"devDependencies": {
1625
"@eslint/js": "9.30.1",
1726
"@types/node": "^16.11.6",
1827
"esbuild": "0.25.5",
19-
"eslint-plugin-obsidianmd": "0.1.9",
2028
"globals": "14.0.0",
2129
"jiti": "2.6.1",
2230
"tslib": "2.4.0",
2331
"typescript": "~5.8.3",
2432
"typescript-eslint": "8.35.1"
2533
},
2634
"dependencies": {
27-
"@types/mdast": "^4.0.4",
2835
"mind-elixir": "5.10.0-beta.1",
29-
"obsidian": "latest",
30-
"rehype-stringify": "^10.0.1",
31-
"remark": "^15.0.1",
32-
"remark-gfm": "^4.0.0",
33-
"remark-parse": "^11.0.0",
34-
"remark-rehype": "^11.1.1",
35-
"unified": "^11.0.0",
36-
"unist-util-visit": "^5.0.0"
36+
"vite": "^8.0.1",
37+
"vite-plugin-logseq": "^1.1.2"
3738
}
3839
}

0 commit comments

Comments
 (0)