forked from xmindltd/xmind-sdk-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.marker.js
More file actions
33 lines (22 loc) · 758 Bytes
/
Copy pathexample.marker.js
File metadata and controls
33 lines (22 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
'use strict';
/**
* Example.marker - Marker usage
*/
const { Workbook, Topic, Zipper, Marker } = require('xmind');
const wb = new Workbook();
const topic = new Topic({sheet: wb.createSheet('sheet-1', 'central topic')});
const zip = new Zipper({path: '/tmp', workbook: wb});
const marker = new Marker();
topic
.add({title: 'main topic 1'})
// attach markers to main topic 1
.on(topic.cid())
.marker(marker.smiley('cry'))
.marker(marker.week('fri'))
.marker(marker.smiley('laugh'))
.on(topic.rootTopicId)
.add({title: 'main topic 2'})
// detach marker from main topic 1
.on(topic.cid('main topic 1'))
.marker(Object.assign({}, marker.smiley('cry'), {del: true}));
zip.save().then(status => process.exit(status ? 0 : 1));