Skip to content

Commit 26caa65

Browse files
committed
Update build script
1 parent 751064a commit 26caa65

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

build.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ const caption = (s) => {
4949
text: s,
5050
fontSize: 15,
5151
bold: true,
52-
margin: [30, 5, 5, 5],
52+
margin: [30, 5, 30, 5],
5353
});
5454
};
5555

5656
const index = (s) => {
5757
content.push({
5858
text: s,
5959
fontSize: 12,
60-
margin: [30, 2, 5, 2],
60+
margin: [30, 2, 30, 2],
6161
preserveLeadingSpaces: true,
6262
});
6363
};
@@ -66,7 +66,8 @@ const para = (s) => {
6666
content.push({
6767
text: s,
6868
fontSize: 12,
69-
margin: [30, 5, 5, 5],
69+
alignment: 'justify',
70+
margin: [30, 5, 30, 5],
7071
});
7172
};
7273

@@ -92,8 +93,14 @@ const code = (src) => {
9293
});
9394
};
9495

96+
const abstract = fs.readFileSync('content/Abstract.en.md', 'utf8');
97+
const text = abstract.replace('#', '').split('\n');
98+
caption(text.shift());
99+
para(text.join(' '));
100+
95101
const src = fs.readFileSync('content/Index.en.md', 'utf8');
96102
const data = src.split('\n');
103+
97104
for (let i = 0; i < data.length; i++) {
98105
const row = data[i];
99106
if (row.startsWith('#')) {
@@ -106,13 +113,15 @@ for (let i = 0; i < data.length; i++) {
106113
}
107114
}
108115

116+
/*
109117
para('Consider following:');
110118
code(`const id = (x) => x;
111119
112120
// Usage
113121
114122
const res = id(5);
115123
console.log({ res });`);
124+
*/
116125

117126
const now = new Date();
118127

0 commit comments

Comments
 (0)