remark-mind-elixir 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +207 -0
  2. package/package.json +11 -7
package/README.md ADDED
@@ -0,0 +1,207 @@
1
+ # remark-mind-elixir
2
+
3
+ A [remark](https://github.com/remarkjs/remark) plugin for embedding interactive [Mind Elixir](https://mind-elixir.com/) mind maps in Markdown.
4
+
5
+ It lets you define mind maps using YAML inside `elixir-mind` fenced code blocks and transforms them into interactive Mind Elixir maps.
6
+
7
+ ## Features
8
+
9
+ * 📝 Define mind maps directly in Markdown
10
+ * 🌳 YAML-based mind map structure
11
+ * ⚙️ Optional YAML configuration
12
+ * ⚡ Automatic client-side rendering
13
+ * 🌐 Optional CDN-based runtime
14
+ * 🔌 Works with remark and the unified ecosystem
15
+ * 🧩 Built on top of [ZikoJS](https://github.com/zikojs)
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ npm install remark-mind-elixir
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ ```js
26
+ import { remark } from 'remark'
27
+ import remarkMindElixir from 'remark-mind-elixir'
28
+
29
+ const markdown = `
30
+ # My Mind Map
31
+
32
+ \`\`\`elixir-mind
33
+ root:
34
+ topic: JavaScript
35
+ children:
36
+ - topic: Browser
37
+ - topic: Node.js
38
+ \`\`\`
39
+ `
40
+
41
+ const file = await remark()
42
+ .use(remarkMindElixir)
43
+ .process(markdown)
44
+
45
+ console.log(String(file))
46
+ ```
47
+
48
+ ## Markdown Syntax
49
+
50
+ Use an `elixir-mind` fenced code block:
51
+
52
+ ````markdown
53
+ ```elixir-mind
54
+ root:
55
+ topic: JavaScript
56
+ children:
57
+ - topic: Browser
58
+ - topic: Node.js
59
+ - topic: Deno
60
+ ```
61
+ ````
62
+
63
+ The YAML is converted into the data structure expected by Mind Elixir.
64
+
65
+ ## Configuration
66
+
67
+ A configuration document can optionally be placed before the mind-map data.
68
+
69
+ Separate the configuration and data using `---`:
70
+
71
+ ````markdown
72
+ ```elixir-mind
73
+ ---
74
+ direction: right
75
+ ---
76
+ root:
77
+ topic: JavaScript
78
+ children:
79
+ - topic: Browser
80
+ - topic: Node.js
81
+ ```
82
+ ````
83
+
84
+ The first YAML document is interpreted as plugin configuration, while the second document contains the mind-map data.
85
+
86
+ ## Multiple Mind Maps
87
+
88
+ A Markdown document can contain multiple `elixir-mind` blocks:
89
+
90
+ ````markdown
91
+ # Frontend
92
+
93
+ ```elixir-mind
94
+ root:
95
+ topic: Frontend
96
+ children:
97
+ - topic: HTML
98
+ - topic: CSS
99
+ - topic: JavaScript
100
+ ```
101
+
102
+ # Backend
103
+
104
+ ```elixir-mind
105
+ root:
106
+ topic: Backend
107
+ children:
108
+ - topic: Node.js
109
+ - topic: Python
110
+ - topic: Rust
111
+ ```
112
+ ````
113
+
114
+ The client runtime is injected once when at least one mind map is present.
115
+
116
+ ## Options
117
+
118
+ ```js
119
+ remarkMindElixir({
120
+ useCdn: true,
121
+ })
122
+ ```
123
+
124
+ ### `useCdn`
125
+
126
+ Controls whether the plugin injects the Mind Elixir browser runtime from a CDN.
127
+
128
+ **Type:** `boolean`
129
+
130
+ **Default:** `true`
131
+
132
+ ```js
133
+ remarkMindElixir({
134
+ useCdn: false,
135
+ })
136
+ ```
137
+
138
+ When disabled, the plugin does not inject the CDN runtime. Your application must provide the client-side Mind Elixir runtime.
139
+
140
+ ## Client Runtime
141
+
142
+ By default, the plugin injects the Mind Elixir runtime using `esm.sh`.
143
+
144
+ The generated Markdown contains a container similar to:
145
+
146
+ ```html
147
+ <div
148
+ data-elixir-mind
149
+ data-xmind-body="..."
150
+ data-xmind-config="..."
151
+ ></div>
152
+ ```
153
+
154
+ The client runtime finds these containers and mounts a Mind Elixir map into each one.
155
+
156
+ ## How It Works
157
+
158
+ ```text
159
+ Markdown
160
+ │
161
+ ▼
162
+ remark
163
+ │
164
+ ▼
165
+ remark-mind-elixir
166
+ │
167
+ ├── Find `elixir-mind` blocks
168
+ │
169
+ ├── Parse YAML
170
+ │
171
+ ├── Convert YAML to Mind Elixir data
172
+ │
173
+ └── Generate HTML container
174
+ │
175
+ ▼
176
+ Client runtime
177
+ │
178
+ ▼
179
+ Mind Elixir map
180
+ ```
181
+
182
+ ## Ecosystem
183
+
184
+ `remark-mind-elixir` is designed to work with remark-compatible Markdown pipelines, including:
185
+
186
+ * [Remark](https://github.com/remarkjs/remark)
187
+ * [Unified](https://unifiedjs.com/)
188
+ * [MDX](https://mdxjs.com/)
189
+ * [Astro](https://astro.build/)
190
+ * [Vite](https://vite.dev/)
191
+
192
+ It is built on top of ZikoJS utilities while remaining a remark plugin rather than a ZikoJS-specific Markdown processor.
193
+
194
+ ## Related Projects
195
+
196
+ * [ZikoJS](https://github.com/zikojs)
197
+ * [Mind Elixir](https://github.com/SSShooter/mind-elixir-core)
198
+ * [Remark](https://github.com/remarkjs/remark)
199
+ * [Unified](https://unifiedjs.com/)
200
+
201
+ <!-- ## Documentation -->
202
+
203
+ <!-- See the [ZikoJS Remark Plugins documentation](https://remark.zikojs.org/) for guides, syntax references, and examples. -->
204
+
205
+ ## License
206
+
207
+ MIT
package/package.json CHANGED
@@ -1,19 +1,23 @@
1
1
  {
2
2
  "name": "remark-mind-elixir",
3
- "version": "0.3.0",
4
- "description": "",
3
+ "version": "0.3.2",
4
+ "description": "A remark plugin for embedding interactive Mind Elixir mind maps in Markdown.",
5
5
  "keywords": [
6
6
  "remark",
7
- "unified"
7
+ "unified",
8
+ "markdown",
9
+ "mindmap",
10
+ "mind-map",
11
+ "mind-elixir"
8
12
  ],
9
- "homepage": "https://github.com/zikojs/mdx#readme",
13
+ "homepage": "https://github.com/zakarialaoui10/remark-plugins#remark-plugins",
10
14
  "bugs": {
11
- "url": "https://github.com/zikojs/mdx/issues"
15
+ "url": "https://github.com/zakarialaoui10/remark-plugins/issues"
12
16
  },
13
17
  "repository": {
14
18
  "type": "git",
15
19
  "url": "git+https://github.com/zakarialaoui10/remark-plugins.git",
16
- "directory": "packages/remark-plugin-mind-elixir"
20
+ "directory": "packages/mind-elixir"
17
21
  },
18
22
  "publishConfig": {
19
23
  "access": "public"
@@ -31,7 +35,7 @@
31
35
  }
32
36
  },
33
37
  "license": "MIT",
34
- "author": "zakaria elalaoui",
38
+ "author": "Zakaria Elalaoui",
35
39
  "type": "module",
36
40
  "dependencies": {
37
41
  "@zikojs/mind-elixir": "^0.6.2",