-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathcreatePDF.js
More file actions
43 lines (31 loc) · 848 Bytes
/
createPDF.js
File metadata and controls
43 lines (31 loc) · 848 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
34
35
36
37
38
39
40
41
42
43
const markdownpdf = require("markdown-pdf");
const dateFormat = require('dateformat');
const time = dateFormat(new Date(), "yyyy.mm.dd");
const options = {
remarkable: {
breaks: false,
preset: 'full'
},
};
const seminarsPDF = `./Seminars_${time}.pdf`;
let seminarsMD = [];
for (let i = 1; i <= 26; i++) {
seminarsMD.push(`Seminars/Seminar_${i < 10 ? "0" + i : i}.md`)
}
markdownpdf(options).concat
.from(seminarsMD)
.to(seminarsPDF, () => {
console.log("Created", seminarsPDF);
});
const lecturesPDF = `./Lectures_${time}.pdf`;
let lecturesMD = [];
for (let i = 1; i <= 22; i++) {
if (i !== 14 && (i === 1 || i > 5)) {
lecturesMD.push(`Lectures/Lecture_${i < 10 ? "0" + i : i}.md`);
}
}
markdownpdf(options).concat
.from(lecturesMD)
.to(lecturesPDF, () => {
console.log("Created", lecturesPDF);
});