-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathexample.fully.js
88 lines (67 loc) · 2.36 KB
/
example.fully.js
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
'use strict';
/**
* Example.fully - Topic fully usage
*/
const { Topic, Workbook, Zipper, Marker } = require('../dist');
const workbook = new Workbook();
const topicOnSheet1 = workbook.createSheet('sheet-1', 'Computer science - 1');
const topic = new Topic({ sheet: topicOnSheet1 });
const workbook2 = new Workbook();
const createdSheetList = workbook2.createSheets([
{s: 'sheetName1', t: 'rootTopicName1'},
{s: 'sheetName2', t: 'rootTopicName2'},
{s: 'sheetName3', t: 'rootTopicName3'}
]);
// console.info(createdSheetList);
// console.info('sheetList:', workbook2.getSheets());
// console.info('sheet1', workbook2.getSheet(createdSheetList[0].id));
// const zip2 = new Zipper({path: '/tmp', workbook: workbook2});
// Set theme
workbook.theme('sheet-1', 'robust');
const zip = new Zipper({path: '/tmp', workbook});
const marker = new Marker();
topic
.add({title: 'Programming Language'})
.add({title: 'Software Name'})
.add({title: 'Network device'})
.add({title: 'Computer Brand'})
.marker(marker.smiley('smile'))
.on(topic.cid('Programming Language'))
.add({title: 'dynamic'})
.add({title: 'static'})
.on(topic.cid()/* Also the topic.cid('static') is working */)
.add({title: 'C'})
.add({title: 'C++'})
.add({title: '中文测试'})
.add({title: 'にほんご/にっぽんご'})
.add({title: 'mixed123中文ぽんご😋'})
.add({title: 'Java'})
.on(topic.cid('C'))
.summary({title: 'Low level that is hard to learning', edge: topic.cid('C++')})
.on(topic.cid('dynamic'))
.note('The static languages are fast more than dynamic language')
.add({title: 'Node.js'})
.add({title: 'Python'})
.add({title: 'Ruby'})
.on(topic.cid('dynamic'))
.summary({title: 'In popular'})
// on Software
.on(topic.cid('Software'))
.add({title: 'jetBrains'})
.add({title: 'Microsoft'})
.on(topic.cid('jetBrains'))
.marker(marker.smiley('smile'))
.add({title: 'WebStorm'})
.add({title: 'Pycharm'})
.add({title: 'CLion'})
.add({title: 'IntelliJ Idea'})
.add({title: 'etc.'})
.summary({title: 'all of the productions are belonging to jetbrains'})
.on(topic.cid('Microsoft'))
.marker(marker.smiley('cry'))
.add({title: 'vs code'});
// console.info(workbook.toJSON());
zip.save().then(status => {
status && console.log('%s saved', zip.target());
});
// zip2.save().then(status => status && console.log('zip2 saved'));