forked from xmindltd/xmind-sdk-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.jsx
More file actions
31 lines (27 loc) · 917 Bytes
/
Copy pathexample.jsx
File metadata and controls
31 lines (27 loc) · 917 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
import { Workbook, Topic, Marker, Zipper } from 'xmind';
const wb = new Workbook();
wb.createSheet('sheet-1','Root Topic');
const topic = new Topic({sheet: wb.sheet})
const marker = new Marker();
topic
.on()
.add({title: 'main topic 1'})
.on(topic.cid())
.add({title: 'subtopic 1'})
.add({title: 'subtopic 2'})
.add({title: 'subtopic 3'})
.add({title: 'subtopic 4'})
.on(topic.cid('subtopic 2'))
.note('this is a note record')
.on(topic.cid('subtopic 3'))
.note('this is a note record attached on subtopic 3')
.marker(marker.smiley('cry'))
.on(topic.rootTopicId)
.add({title: 'main topic 1'})
.add({title: 'main topic 2'})
.add({title: 'main topic 2.2'})
.add({title: 'main topic 2.1'})
console.info('Main topic Id:', topic.cid('main topic 1'));
console.info(topic.cids());
const zip = new Zipper({path: '/tmp', workbook: wb});
zip.save().then(status => {console.info(status)});