n8n-nodes-markmap 0.1.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
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# n8n-nodes-markmap
|
|
2
|
+
|
|
3
|
+
This is an [n8n](https://n8n.io) community node that converts **Markdown text** into a self-contained, interactive **markmap mind-map HTML page**.
|
|
4
|
+
|
|
5
|
+
[markmap](https://markmap.js.org/) is a library that visualizes Markdown documents as interactive mind maps.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Follow the [n8n community nodes installation guide](https://docs.n8n.io/integrations/community-nodes/installation/).
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
npm install n8n-nodes-markmap
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Operations
|
|
16
|
+
|
|
17
|
+
### Markdown to HTML
|
|
18
|
+
|
|
19
|
+
Takes Markdown text as input and produces a fully self-contained HTML page with an interactive mind-map visualization.
|
|
20
|
+
|
|
21
|
+
**Inputs:**
|
|
22
|
+
|
|
23
|
+
| Parameter | Type | Default | Description |
|
|
24
|
+
|---|---|---|---|
|
|
25
|
+
| Markdown Text | string | (required) | The Markdown content to visualize |
|
|
26
|
+
| Title | string | `Markmap` | Title for the HTML page |
|
|
27
|
+
|
|
28
|
+
**Options:**
|
|
29
|
+
|
|
30
|
+
| Option | Type | Default | Description |
|
|
31
|
+
|---|---|---|---|
|
|
32
|
+
| Color Freeze Level | number | `0` | Freeze branch colors at a specific depth |
|
|
33
|
+
| Initial Expand Level | number | `-1` | Max node depth to expand on load (`-1` = all) |
|
|
34
|
+
| Max Width | number | `0` | Max width of node content in px (`0` = unlimited) |
|
|
35
|
+
| Zoom | boolean | `true` | Enable zoom on the mind-map |
|
|
36
|
+
| Pan | boolean | `true` | Enable panning on the mind-map |
|
|
37
|
+
| Output Field | string | `html` | Name of the output JSON field containing the HTML |
|
|
38
|
+
|
|
39
|
+
**Screenshot Options:**
|
|
40
|
+
|
|
41
|
+
| Option | Type | Default | Description |
|
|
42
|
+
|---|---|---|---|
|
|
43
|
+
| Enable Screenshot | boolean | `false` | Whether to generate a screenshot of the mindmap using Puppeteer |
|
|
44
|
+
| Chrome Executable Path | string | `C:\Program Files\Google\Chrome\Application\chrome.exe` | Path to the Chrome/Chromium executable for Puppeteer |
|
|
45
|
+
| Screenshot Width | number | `1920` | Width of the screenshot in pixels |
|
|
46
|
+
| Screenshot Height | number | `1080` | Height of the screenshot in pixels |
|
|
47
|
+
| Wait Time (ms) | number | `2000` | Time to wait for the mindmap animation to complete before taking screenshot |
|
|
48
|
+
| Full Page Screenshot | boolean | `false` | Whether to capture the full scrollable page or just the viewport |
|
|
49
|
+
| Output Format | string | `binary` | How to output the screenshot: `binary` (as binary data) or `base64` (as base64 encoded string) |
|
|
50
|
+
|
|
51
|
+
**Output:**
|
|
52
|
+
|
|
53
|
+
The node adds a field (default: `html`) to each item containing the complete HTML page string. You can then:
|
|
54
|
+
|
|
55
|
+
- Write it to a file using the **Write Binary File** node
|
|
56
|
+
- Send it as an email attachment
|
|
57
|
+
- Return it as an HTTP response
|
|
58
|
+
- Store it in a database
|
|
59
|
+
|
|
60
|
+
When screenshot is enabled, the node will also output:
|
|
61
|
+
- **Binary mode**: A binary field named `screenshot` containing the PNG image
|
|
62
|
+
- **Base64 mode**: JSON fields `screenshotBase64` and `screenshotMimeType` containing the base64-encoded image
|
|
63
|
+
|
|
64
|
+
## Markdown Format Specification
|
|
65
|
+
|
|
66
|
+
The node uses standard Markdown syntax to build the mind-map hierarchy:
|
|
67
|
+
|
|
68
|
+
- `# Title` - Root node (level 1 heading), represents the main topic
|
|
69
|
+
- `## Branch` - Second-level node (level 2 heading), represents main branches
|
|
70
|
+
- `### Sub-branch` - Third-level node (level 3 heading), represents sub-branches
|
|
71
|
+
- `- List item` - Leaf nodes (bullet points), represents end content
|
|
72
|
+
|
|
73
|
+
**Example Structure:**
|
|
74
|
+
```markdown
|
|
75
|
+
# Project Plan (root)
|
|
76
|
+
## Phase 1 (branch)
|
|
77
|
+
### Task A (sub-branch)
|
|
78
|
+
- Detail 1 (leaf)
|
|
79
|
+
- Detail 2 (leaf)
|
|
80
|
+
## Phase 2 (branch)
|
|
81
|
+
- Summary (leaf)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The hierarchy is: `# Root` → `## Branch` → `### Sub-branch` → `- Leaf`
|
|
85
|
+
|
|
86
|
+
## Example Workflows
|
|
87
|
+
|
|
88
|
+
### Basic HTML Generation
|
|
89
|
+
```
|
|
90
|
+
[Manual Trigger] -> [Set node with Markdown] -> [Markmap] -> [Write Binary File]
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### With Screenshot
|
|
94
|
+
```
|
|
95
|
+
[Manual Trigger] -> [Set node with Markdown] -> [Markmap with Screenshot enabled] -> [Write Binary File for HTML] -> [Write Binary File for Screenshot]
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Compatibility
|
|
99
|
+
|
|
100
|
+
- n8n >= 1.0.0
|
|
101
|
+
- Node.js >= 18
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
MIT
|
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.Markmap = void 0;
|
|
40
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
41
|
+
const puppeteer_core_1 = __importDefault(require("puppeteer-core"));
|
|
42
|
+
/**
|
|
43
|
+
* Markmap HTML template – a self-contained page that loads d3 and markmap-view
|
|
44
|
+
* from a CDN at runtime and renders the mind-map from an embedded JSON tree.
|
|
45
|
+
*/
|
|
46
|
+
function buildHtml(rootJson, title, jsonOptionsJson, colorFreezeLevel) {
|
|
47
|
+
return `<!doctype html>
|
|
48
|
+
<html>
|
|
49
|
+
<head>
|
|
50
|
+
<meta charset="UTF-8" />
|
|
51
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
52
|
+
<title>${escapeHtml(title)}</title>
|
|
53
|
+
<style>
|
|
54
|
+
* { margin: 0; padding: 0; }
|
|
55
|
+
html {
|
|
56
|
+
font-family: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',
|
|
57
|
+
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
|
58
|
+
}
|
|
59
|
+
#mindmap {
|
|
60
|
+
display: block;
|
|
61
|
+
width: 100vw;
|
|
62
|
+
height: 100vh;
|
|
63
|
+
}
|
|
64
|
+
.markmap-dark {
|
|
65
|
+
background: #27272a;
|
|
66
|
+
color: white;
|
|
67
|
+
}
|
|
68
|
+
</style>
|
|
69
|
+
</head>
|
|
70
|
+
<body>
|
|
71
|
+
<svg id="mindmap"></svg>
|
|
72
|
+
<script src="https://cdn.jsdelivr.net/npm/d3@7"></script>
|
|
73
|
+
<script src="https://cdn.jsdelivr.net/npm/markmap-view@0.18"></script>
|
|
74
|
+
<script>
|
|
75
|
+
(function() {
|
|
76
|
+
var root = ${rootJson};
|
|
77
|
+
var jsonOptions = ${jsonOptionsJson};
|
|
78
|
+
var colorFreezeLevel = ${colorFreezeLevel};
|
|
79
|
+
|
|
80
|
+
var options = markmap.deriveOptions(jsonOptions);
|
|
81
|
+
if (colorFreezeLevel > 0) {
|
|
82
|
+
options.colorFreezeLevel = colorFreezeLevel;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
window.mm = markmap.Markmap.create('svg#mindmap', options, root);
|
|
86
|
+
|
|
87
|
+
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
88
|
+
document.documentElement.classList.add('markmap-dark');
|
|
89
|
+
}
|
|
90
|
+
})();
|
|
91
|
+
</script>
|
|
92
|
+
</body>
|
|
93
|
+
</html>`;
|
|
94
|
+
}
|
|
95
|
+
function escapeHtml(text) {
|
|
96
|
+
return text
|
|
97
|
+
.replace(/&/g, '&')
|
|
98
|
+
.replace(/</g, '<')
|
|
99
|
+
.replace(/>/g, '>')
|
|
100
|
+
.replace(/"/g, '"');
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Take a screenshot of HTML content using Puppeteer
|
|
104
|
+
*/
|
|
105
|
+
async function takeScreenshot(html, chromePath, width, height, waitTime, fullPage = false) {
|
|
106
|
+
const browser = await puppeteer_core_1.default.launch({
|
|
107
|
+
executablePath: chromePath,
|
|
108
|
+
headless: true,
|
|
109
|
+
args: ['--no-sandbox', '--disable-setuid-sandbox'],
|
|
110
|
+
});
|
|
111
|
+
try {
|
|
112
|
+
const page = await browser.newPage();
|
|
113
|
+
await page.setViewport({ width, height });
|
|
114
|
+
await page.setContent(html, { waitUntil: 'networkidle0' });
|
|
115
|
+
// Wait for markmap to render
|
|
116
|
+
await page.waitForFunction('typeof window.mm !== "undefined"', { timeout: 10000 });
|
|
117
|
+
// Additional wait time for animation to complete
|
|
118
|
+
await new Promise(resolve => setTimeout(resolve, waitTime));
|
|
119
|
+
// Take screenshot
|
|
120
|
+
const screenshot = await page.screenshot({
|
|
121
|
+
fullPage: fullPage,
|
|
122
|
+
type: 'png',
|
|
123
|
+
});
|
|
124
|
+
return screenshot;
|
|
125
|
+
}
|
|
126
|
+
finally {
|
|
127
|
+
await browser.close();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
class Markmap {
|
|
131
|
+
constructor() {
|
|
132
|
+
this.description = {
|
|
133
|
+
displayName: 'Markmap',
|
|
134
|
+
name: 'markmap',
|
|
135
|
+
icon: 'file:markmap.svg',
|
|
136
|
+
group: ['transform'],
|
|
137
|
+
version: 1,
|
|
138
|
+
subtitle: '={{$parameter["operation"]}}',
|
|
139
|
+
description: 'Convert Markdown text into an interactive markmap mind-map HTML page. Can be used as a tool by AI Agents to visualize structured information.',
|
|
140
|
+
defaults: {
|
|
141
|
+
name: 'Markmap',
|
|
142
|
+
},
|
|
143
|
+
usableAsTool: true,
|
|
144
|
+
inputs: ['main'],
|
|
145
|
+
outputs: ['main'],
|
|
146
|
+
properties: [
|
|
147
|
+
{
|
|
148
|
+
displayName: 'Operation',
|
|
149
|
+
name: 'operation',
|
|
150
|
+
type: 'options',
|
|
151
|
+
noDataExpression: true,
|
|
152
|
+
options: [
|
|
153
|
+
{
|
|
154
|
+
name: 'Markdown to HTML',
|
|
155
|
+
value: 'markdownToHtml',
|
|
156
|
+
description: 'Transform Markdown text into a self-contained markmap HTML page',
|
|
157
|
+
action: 'Transform markdown to markmap HTML',
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
default: 'markdownToHtml',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
displayName: 'Markdown Text',
|
|
164
|
+
name: 'markdown',
|
|
165
|
+
type: 'string',
|
|
166
|
+
typeOptions: {
|
|
167
|
+
rows: 12,
|
|
168
|
+
},
|
|
169
|
+
default: '',
|
|
170
|
+
required: true,
|
|
171
|
+
placeholder: '# My Topic\n\n## Branch 1\n\n- item a\n- item b\n\n## Branch 2\n\n- item c',
|
|
172
|
+
description: `The Markdown content to convert into a markmap mind-map.
|
|
173
|
+
|
|
174
|
+
Markdown Format Specification:
|
|
175
|
+
- # Title - Root node (level 1 heading), represents the main topic
|
|
176
|
+
- ## Branch - Second-level node (level 2 heading), represents main branches
|
|
177
|
+
- ### Sub-branch - Third-level node (level 3 heading), represents sub-branches
|
|
178
|
+
- - List item - Leaf nodes (bullet points), represents end content
|
|
179
|
+
|
|
180
|
+
Example Structure:
|
|
181
|
+
# Project Plan (root)
|
|
182
|
+
## Phase 1 (branch)
|
|
183
|
+
### Task A (sub-branch)
|
|
184
|
+
- Detail 1 (leaf)
|
|
185
|
+
- Detail 2 (leaf)
|
|
186
|
+
## Phase 2 (branch)
|
|
187
|
+
- Summary (leaf)
|
|
188
|
+
|
|
189
|
+
The hierarchy is: # Root → ## Branch → ### Sub-branch → - Leaf`,
|
|
190
|
+
displayOptions: {
|
|
191
|
+
show: {
|
|
192
|
+
operation: ['markdownToHtml'],
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
displayName: 'Title',
|
|
198
|
+
name: 'title',
|
|
199
|
+
type: 'string',
|
|
200
|
+
default: 'Markmap',
|
|
201
|
+
description: 'Title for the generated HTML page',
|
|
202
|
+
displayOptions: {
|
|
203
|
+
show: {
|
|
204
|
+
operation: ['markdownToHtml'],
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
displayName: 'Enable Screenshot',
|
|
210
|
+
name: 'enableScreenshot',
|
|
211
|
+
type: 'boolean',
|
|
212
|
+
default: false,
|
|
213
|
+
description: 'Whether to generate a screenshot of the mindmap using Puppeteer',
|
|
214
|
+
displayOptions: {
|
|
215
|
+
show: {
|
|
216
|
+
operation: ['markdownToHtml'],
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
displayName: 'Chrome Executable Path',
|
|
222
|
+
name: 'chromePath',
|
|
223
|
+
type: 'string',
|
|
224
|
+
default: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
|
|
225
|
+
required: true,
|
|
226
|
+
description: 'Path to the Chrome/Chromium executable for Puppeteer. This parameter is automatically added when screenshot is enabled',
|
|
227
|
+
displayOptions: {
|
|
228
|
+
show: {
|
|
229
|
+
operation: ['markdownToHtml'],
|
|
230
|
+
enableScreenshot: [true],
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
displayName: 'Screenshot Options',
|
|
236
|
+
name: 'screenshotOptions',
|
|
237
|
+
type: 'collection',
|
|
238
|
+
placeholder: 'Add Option',
|
|
239
|
+
default: {},
|
|
240
|
+
displayOptions: {
|
|
241
|
+
show: {
|
|
242
|
+
operation: ['markdownToHtml'],
|
|
243
|
+
enableScreenshot: [true],
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
options: [
|
|
247
|
+
{
|
|
248
|
+
displayName: 'Screenshot Width',
|
|
249
|
+
name: 'width',
|
|
250
|
+
type: 'number',
|
|
251
|
+
default: 1920,
|
|
252
|
+
description: 'Width of the screenshot in pixels',
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
displayName: 'Screenshot Height',
|
|
256
|
+
name: 'height',
|
|
257
|
+
type: 'number',
|
|
258
|
+
default: 1080,
|
|
259
|
+
description: 'Height of the screenshot in pixels',
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
displayName: 'Wait Time (ms)',
|
|
263
|
+
name: 'waitTime',
|
|
264
|
+
type: 'number',
|
|
265
|
+
default: 2000,
|
|
266
|
+
description: 'Time to wait for the mindmap animation to complete before taking screenshot (in milliseconds)',
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
displayName: 'Full Page Screenshot',
|
|
270
|
+
name: 'fullPage',
|
|
271
|
+
type: 'boolean',
|
|
272
|
+
default: false,
|
|
273
|
+
description: 'Whether to capture the full scrollable page (true) or just the viewport (false). Full page captures the entire mindmap even if it extends beyond the screen',
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
displayName: 'Output Format',
|
|
277
|
+
name: 'outputFormat',
|
|
278
|
+
type: 'options',
|
|
279
|
+
default: 'binary',
|
|
280
|
+
description: 'How to output the screenshot: binary data or base64 encoded string',
|
|
281
|
+
options: [
|
|
282
|
+
{
|
|
283
|
+
name: 'Binary Data',
|
|
284
|
+
value: 'binary',
|
|
285
|
+
description: 'Return screenshot as binary data',
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
name: 'Base64 String',
|
|
289
|
+
value: 'base64',
|
|
290
|
+
description: 'Return screenshot as base64 encoded string in JSON',
|
|
291
|
+
},
|
|
292
|
+
],
|
|
293
|
+
},
|
|
294
|
+
],
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
displayName: 'Options',
|
|
298
|
+
name: 'options',
|
|
299
|
+
type: 'collection',
|
|
300
|
+
placeholder: 'Add Option',
|
|
301
|
+
default: {},
|
|
302
|
+
displayOptions: {
|
|
303
|
+
show: {
|
|
304
|
+
operation: ['markdownToHtml'],
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
options: [
|
|
308
|
+
{
|
|
309
|
+
displayName: 'Color Freeze Level',
|
|
310
|
+
name: 'colorFreezeLevel',
|
|
311
|
+
type: 'number',
|
|
312
|
+
default: 0,
|
|
313
|
+
description: 'Freeze colors at a specific branch depth (0 = no freeze)',
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
displayName: 'Initial Expand Level',
|
|
317
|
+
name: 'initialExpandLevel',
|
|
318
|
+
type: 'number',
|
|
319
|
+
default: -1,
|
|
320
|
+
description: 'The maximum level of nodes to expand on initial render (-1 = expand all)',
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
displayName: 'Max Width',
|
|
324
|
+
name: 'maxWidth',
|
|
325
|
+
type: 'number',
|
|
326
|
+
default: 0,
|
|
327
|
+
description: 'Maximum width of each node content in pixels (0 = no limit)',
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
displayName: 'Zoom',
|
|
331
|
+
name: 'zoom',
|
|
332
|
+
type: 'boolean',
|
|
333
|
+
default: true,
|
|
334
|
+
description: 'Whether to enable zoom and pan on the mind-map',
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
displayName: 'Pan',
|
|
338
|
+
name: 'pan',
|
|
339
|
+
type: 'boolean',
|
|
340
|
+
default: true,
|
|
341
|
+
description: 'Whether to enable panning on the mind-map',
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
displayName: 'Output Field',
|
|
345
|
+
name: 'outputField',
|
|
346
|
+
type: 'string',
|
|
347
|
+
default: 'html',
|
|
348
|
+
description: 'Name of the output field that will contain the HTML string',
|
|
349
|
+
},
|
|
350
|
+
],
|
|
351
|
+
},
|
|
352
|
+
],
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
async execute() {
|
|
356
|
+
const items = this.getInputData();
|
|
357
|
+
const returnData = [];
|
|
358
|
+
// Dynamic import so we can use the ESM markmap-lib package
|
|
359
|
+
let Transformer;
|
|
360
|
+
try {
|
|
361
|
+
const markmapLib = await Promise.resolve().then(() => __importStar(require('markmap-lib')));
|
|
362
|
+
Transformer = markmapLib.Transformer;
|
|
363
|
+
}
|
|
364
|
+
catch (err) {
|
|
365
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Failed to load markmap-lib. Make sure markmap-lib is installed.');
|
|
366
|
+
}
|
|
367
|
+
for (let i = 0; i < items.length; i++) {
|
|
368
|
+
try {
|
|
369
|
+
const operation = this.getNodeParameter('operation', i);
|
|
370
|
+
if (operation === 'markdownToHtml') {
|
|
371
|
+
const markdown = this.getNodeParameter('markdown', i);
|
|
372
|
+
const title = this.getNodeParameter('title', i);
|
|
373
|
+
const options = this.getNodeParameter('options', i, {});
|
|
374
|
+
const enableScreenshot = this.getNodeParameter('enableScreenshot', i);
|
|
375
|
+
const outputField = options.outputField || 'html';
|
|
376
|
+
const colorFreezeLevel = options.colorFreezeLevel ?? 0;
|
|
377
|
+
// 1. Transform Markdown -> tree
|
|
378
|
+
const transformer = new Transformer();
|
|
379
|
+
const { root, frontmatter } = transformer.transform(markdown);
|
|
380
|
+
// 2. Build jsonOptions from frontmatter + user options
|
|
381
|
+
const jsonOptions = {
|
|
382
|
+
...(frontmatter?.markmap || {}),
|
|
383
|
+
};
|
|
384
|
+
if (options.initialExpandLevel !== undefined && options.initialExpandLevel !== -1) {
|
|
385
|
+
jsonOptions.initialExpandLevel = options.initialExpandLevel;
|
|
386
|
+
}
|
|
387
|
+
if (options.maxWidth && options.maxWidth > 0) {
|
|
388
|
+
jsonOptions.maxWidth = options.maxWidth;
|
|
389
|
+
}
|
|
390
|
+
if (options.zoom === false) {
|
|
391
|
+
jsonOptions.zoom = false;
|
|
392
|
+
}
|
|
393
|
+
if (options.pan === false) {
|
|
394
|
+
jsonOptions.pan = false;
|
|
395
|
+
}
|
|
396
|
+
// 3. Build self-contained HTML
|
|
397
|
+
const rootJson = JSON.stringify(root);
|
|
398
|
+
const jsonOptionsJson = JSON.stringify(jsonOptions);
|
|
399
|
+
const html = buildHtml(rootJson, title, jsonOptionsJson, colorFreezeLevel);
|
|
400
|
+
const result = {
|
|
401
|
+
json: {
|
|
402
|
+
...items[i].json,
|
|
403
|
+
[outputField]: html,
|
|
404
|
+
},
|
|
405
|
+
};
|
|
406
|
+
// 4. Take screenshot if enabled
|
|
407
|
+
if (enableScreenshot) {
|
|
408
|
+
// Chrome path is now a separate required parameter
|
|
409
|
+
const chromePath = this.getNodeParameter('chromePath', i);
|
|
410
|
+
const screenshotOptions = this.getNodeParameter('screenshotOptions', i, {});
|
|
411
|
+
const width = screenshotOptions.width || 1920;
|
|
412
|
+
const height = screenshotOptions.height || 1080;
|
|
413
|
+
const waitTime = screenshotOptions.waitTime || 2000;
|
|
414
|
+
const fullPage = screenshotOptions.fullPage || false;
|
|
415
|
+
const outputFormat = screenshotOptions.outputFormat || 'binary';
|
|
416
|
+
try {
|
|
417
|
+
const screenshotBuffer = await takeScreenshot(html, chromePath, width, height, waitTime, fullPage);
|
|
418
|
+
if (outputFormat === 'binary') {
|
|
419
|
+
// Return as binary data
|
|
420
|
+
result.binary = {
|
|
421
|
+
screenshot: {
|
|
422
|
+
data: screenshotBuffer.toString('base64'),
|
|
423
|
+
mimeType: 'image/png',
|
|
424
|
+
fileName: `markmap-${Date.now()}.png`,
|
|
425
|
+
},
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
else if (outputFormat === 'base64') {
|
|
429
|
+
// Return as base64 string in JSON
|
|
430
|
+
result.json.screenshotBase64 = screenshotBuffer.toString('base64');
|
|
431
|
+
result.json.screenshotMimeType = 'image/png';
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
catch (error) {
|
|
435
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Screenshot failed: ${error.message}. Make sure Chrome is installed at the specified path.`);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
returnData.push(result);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
catch (error) {
|
|
442
|
+
if (this.continueOnFail()) {
|
|
443
|
+
returnData.push({
|
|
444
|
+
json: {
|
|
445
|
+
...items[i].json,
|
|
446
|
+
error: error.message,
|
|
447
|
+
},
|
|
448
|
+
});
|
|
449
|
+
continue;
|
|
450
|
+
}
|
|
451
|
+
throw error;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
return [returnData];
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
exports.Markmap = Markmap;
|
|
458
|
+
//# sourceMappingURL=Markmap.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Markmap.node.js","sourceRoot":"","sources":["../../../nodes/Markmap/Markmap.node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAMsB;AACtB,oEAAuC;AAEvC;;;GAGG;AACH,SAAS,SAAS,CACjB,QAAgB,EAChB,KAAa,EACb,eAAuB,EACvB,gBAAwB;IAExB,OAAO;;;;;SAKC,UAAU,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;eAwBX,QAAQ;sBACD,eAAe;2BACV,gBAAgB;;;;;;;;;;;;;;;QAenC,CAAC;AACT,CAAC;AAED,SAAS,UAAU,CAAC,IAAY;IAC/B,OAAO,IAAI;SACT,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,cAAc,CAC5B,IAAY,EACZ,UAAkB,EAClB,KAAa,EACb,MAAc,EACd,QAAgB,EAChB,WAAoB,KAAK;IAEzB,MAAM,OAAO,GAAG,MAAM,wBAAS,CAAC,MAAM,CAAC;QACtC,cAAc,EAAE,UAAU;Q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EACd,sBAAuB,KAAe,CAAC,OAAO,wDAAwD,CACtG,CAAC;wBACH,CAAC;oBACF,CAAC;oBAED,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACzB,CAAC;YACF,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,UAAU,CAAC,IAAI,CAAC;wBACf,IAAI,EAAE;4BACL,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;4BAChB,KAAK,EAAG,KAAe,CAAC,OAAO;yBAC/B;qBACD,CAAC,CAAC;oBACH,SAAS;gBACV,CAAC;gBACD,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AArXD,0BAqXC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="48px" height="48px" viewBox="0 0 48 48" enable-background="new 0 0 48 48" xml:space="preserve"> <image id="image0" width="48" height="48" x="0" y="0"
|
|
4
|
+
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAIGNIUk0AAHomAACAhAAA+gAAAIDo
|
|
5
|
+
AAB1MAAA6mAAADqYAAAXcJy6UTwAAAIZUExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUEACso
|
|
6
|
+
BFFMCVNOCQAAAAAAAAAAAC0qBX11Dn10DQAAAAAAADMwBQAAAAAAAHtyDQAAAAAAAA8NARQTAgUF
|
|
7
|
+
AEpFCB0bAwEBAA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5BUUmZgHtUVMHKJ6ipaxAXnJoTQeq1tHWI
|
|
20
|
+
DH7dfpD6SXpEKmdg0J8MVD/FgGj1DIYgC4yMiVZvMhWkwZSAKjNzC0sosJoGCn1rSwSwsbVDV89r
|
|
21
|
+
P70RD5jhwIimwXFmI14wywlNg/Ns/BrmuKBpcHWbi0/9PHcPdE94enn7QIFvE1DJfD8fBPAPCKQ8
|
|
22
|
+
WJFBEEhDsB3xGvQXADUsDCFeAyTxLQolXkcYOHmHRxBbujCoRIIDc3FUdAyROmKXQMJ/6bK4+ASx
|
|
23
|
+
xKRkQhpSUpcjIq1lRW9aOkE7MjKbkaN6ZRZBHdk5vUgaVuUS9kdefkHh6jVQDWuLiPJ7sWhJadm6
|
|
24
|
+
9Rs2llcQG8BA/wdWZklUEa9+FNAFAADC7dGoBoi/ugAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyNi0w
|
|
25
|
+
Mi0wN1QwMTo1ODo0NiswMDowMK+szAUAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjYtMDItMDdUMDE6
|
|
26
|
+
NTg6NDYrMDA6MDDe8XS5AAAAKHRFWHRkYXRlOnRpbWVzdGFtcAAyMDI2LTAyLTA3VDAxOjU4OjQ2
|
|
27
|
+
KzAwOjAwieRVZgAAAABJRU5ErkJggg==" />
|
|
28
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-markmap",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "n8n community node that converts Markdown text into an interactive markmap mind-map HTML page.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"n8n-community-node-package",
|
|
7
|
+
"n8n",
|
|
8
|
+
"markmap",
|
|
9
|
+
"mindmap",
|
|
10
|
+
"markdown"
|
|
11
|
+
],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"main": "dist/nodes/Markmap/Markmap.node.js",
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc && copyfiles -u 2 \"nodes/**/*.svg\" dist/nodes/Markmap/",
|
|
16
|
+
"dev": "tsc --watch",
|
|
17
|
+
"lint": "eslint . --ext .ts",
|
|
18
|
+
"prepublishOnly": "npm run build"
|
|
19
|
+
},
|
|
20
|
+
"n8n": {
|
|
21
|
+
"n8nNodesApiVersion": 1,
|
|
22
|
+
"nodes": [
|
|
23
|
+
"dist/nodes/Markmap/Markmap.node.js"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"markmap-common": "^0.18.3",
|
|
28
|
+
"markmap-lib": "^0.18.3",
|
|
29
|
+
"markmap-render": "^0.18.3",
|
|
30
|
+
"puppeteer-core": "^21.0.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/node": "^20.0.0",
|
|
34
|
+
"copyfiles": "^2.4.1",
|
|
35
|
+
"n8n-workflow": "^1.30.0",
|
|
36
|
+
"typescript": "^5.4.0"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"n8n-workflow": ">=1.0.0"
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"dist/"
|
|
43
|
+
]
|
|
44
|
+
}
|