forked from good-lly/gdpr-documents
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_pdfs.js
41 lines (38 loc) · 1.14 KB
/
generate_pdfs.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
var markdownpdf = require('markdown-pdf');
var mdDocs = [
'./docs/cz_česky/gdpr_access_cz.md',
'./docs/cz_česky/gdpr_erase_cz.md',
'./docs/de_deutsche/gdpr_access_de.md',
'./docs/de_deutsche/gdpr_erase_de.md',
'./docs/en_english/gdpr_access_en.md',
'./docs/en_english/gdpr_erase_en.md',
'./docs/es_español/gdpr_access_es.md',
'./docs/es_español/gdpr_erase_es.md',
'./docs/fr_français/gdpr_access_fr.md',
'./docs/fr_français/gdpr_erase_fr.md',
'./docs/it_italiano/gdpr_access_it.md',
'./docs/it_italiano/gdpr_erase_it.md',
'./docs/nl_nederlands/gdpr_access_nl.md',
'./docs/nl_nederlands/gdpr_erase_nl.md',
'./docs/pl_polsky/gdpr_access_pl.md',
'./docs/pl_polsky/gdpr_erase_pl.md',
],
pdfDocs = mdDocs.map(function(d) {
return d.replace('.md', '.pdf');
});
var options = {
paperFormat: 'Legal',
remarkable: {
html: true,
breaks: true,
plugins: [require('remarkable-classy')],
syntax: ['footnote', 'sup', 'sub'],
},
};
markdownpdf(options)
.from(mdDocs)
.to(pdfDocs, function() {
pdfDocs.forEach(function(d) {
console.log('Created', d);
});
});