remark-mind-elixir 0.3.2 → 0.4.0
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.
- package/README.md +70 -8
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# remark-mind-elixir
|
|
2
2
|
|
|
3
|
-
A [remark](https://github.com/remarkjs/remark) plugin for embedding interactive [Mind Elixir](https://mind-elixir.com/) mind maps in Markdown.
|
|
3
|
+
A [remark](https://github.com/remarkjs/remark) plugin for embedding interactive [Mind Elixir](https://docs.mind-elixir.com/) mind maps in Markdown.
|
|
4
4
|
|
|
5
5
|
It lets you define mind maps using YAML inside `elixir-mind` fenced code blocks and transforms them into interactive Mind Elixir maps.
|
|
6
6
|
|
|
@@ -45,6 +45,71 @@ const file = await remark()
|
|
|
45
45
|
console.log(String(file))
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
+
## Usage with Astro
|
|
49
|
+
|
|
50
|
+
Install the plugin in your Astro project:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm install remark-mind-elixir
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Then add it to the `markdown.remarkPlugins` configuration in `astro.config.mjs`:
|
|
57
|
+
|
|
58
|
+
```js
|
|
59
|
+
// @ts-check
|
|
60
|
+
import { defineConfig } from 'astro/config'
|
|
61
|
+
import remarkMindElixir from 'remark-mind-elixir'
|
|
62
|
+
|
|
63
|
+
export default defineConfig({
|
|
64
|
+
markdown: {
|
|
65
|
+
remarkPlugins: [remarkMindElixir()],
|
|
66
|
+
},
|
|
67
|
+
})
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
You can then use `elixir-mind` blocks directly in your Markdown or MDX pages:
|
|
71
|
+
|
|
72
|
+
````markdown
|
|
73
|
+
# JavaScript
|
|
74
|
+
|
|
75
|
+
```elixir-mind
|
|
76
|
+
root:
|
|
77
|
+
topic: JavaScript
|
|
78
|
+
children:
|
|
79
|
+
- topic: Browser
|
|
80
|
+
children:
|
|
81
|
+
- topic: DOM
|
|
82
|
+
- topic: Web APIs
|
|
83
|
+
- topic: Node.js
|
|
84
|
+
- topic: Deno
|
|
85
|
+
```
|
|
86
|
+
````
|
|
87
|
+
|
|
88
|
+
The plugin transforms the block during Astro's Markdown processing and injects the client-side Mind Elixir runtime automatically.
|
|
89
|
+
|
|
90
|
+
### Astro with CDN disabled
|
|
91
|
+
|
|
92
|
+
By default, `remark-mind-elixir` loads the client runtime from `esm.sh`.
|
|
93
|
+
|
|
94
|
+
You can disable this behavior:
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
import { defineConfig } from 'astro/config'
|
|
98
|
+
import remarkMindElixir from 'remark-mind-elixir'
|
|
99
|
+
|
|
100
|
+
export default defineConfig({
|
|
101
|
+
markdown: {
|
|
102
|
+
remarkPlugins: [
|
|
103
|
+
remarkMindElixir({
|
|
104
|
+
useCdn: false,
|
|
105
|
+
}),
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
})
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
When `useCdn` is disabled, your application must provide the Mind Elixir client runtime itself.
|
|
112
|
+
|
|
48
113
|
## Markdown Syntax
|
|
49
114
|
|
|
50
115
|
Use an `elixir-mind` fenced code block:
|
|
@@ -73,6 +138,7 @@ Separate the configuration and data using `---`:
|
|
|
73
138
|
---
|
|
74
139
|
direction: right
|
|
75
140
|
---
|
|
141
|
+
|
|
76
142
|
root:
|
|
77
143
|
topic: JavaScript
|
|
78
144
|
children:
|
|
@@ -141,7 +207,7 @@ When disabled, the plugin does not inject the CDN runtime. Your application must
|
|
|
141
207
|
|
|
142
208
|
By default, the plugin injects the Mind Elixir runtime using `esm.sh`.
|
|
143
209
|
|
|
144
|
-
The generated
|
|
210
|
+
The generated HTML contains a container similar to:
|
|
145
211
|
|
|
146
212
|
```html
|
|
147
213
|
<div
|
|
@@ -194,14 +260,10 @@ It is built on top of ZikoJS utilities while remaining a remark plugin rather th
|
|
|
194
260
|
## Related Projects
|
|
195
261
|
|
|
196
262
|
* [ZikoJS](https://github.com/zikojs)
|
|
197
|
-
* [Mind Elixir](https://
|
|
263
|
+
* [Mind Elixir](https://docs.mind-elixir.com/)
|
|
198
264
|
* [Remark](https://github.com/remarkjs/remark)
|
|
199
265
|
* [Unified](https://unifiedjs.com/)
|
|
200
266
|
|
|
201
|
-
<!-- ## Documentation -->
|
|
202
|
-
|
|
203
|
-
<!-- See the [ZikoJS Remark Plugins documentation](https://remark.zikojs.org/) for guides, syntax references, and examples. -->
|
|
204
|
-
|
|
205
267
|
## License
|
|
206
268
|
|
|
207
|
-
MIT
|
|
269
|
+
MIT + Mind Elixir License
|
package/package.json
CHANGED