-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathminimize.js
39 lines (38 loc) · 1012 Bytes
/
minimize.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
const JSON5 = require('json5');
const fs = require('fs');
fs.readFile('themes/Prism-color-theme.json', 'utf8', (err, content) => {
const parsed = JSON5.parse(content);
fs.writeFile('themes/Prism-color-theme-minimized.json', JSON.stringify(parsed), 'utf8', () => {
console.log('✔ DONE');
});
const noBoldTokenColors = [];
for (const item of parsed.tokenColors) {
if (!item.settings) continue;
if (item.settings.fontStyle === 'bold') {
const scope = item.scope;
const settings = {};
if (item.settings) {
settings.foreground = item.settings.foreground;
}
noBoldTokenColors.push({
scope,
settings,
});
} else {
noBoldTokenColors.push(item);
}
}
noBoldTokenColors.push({
"scope": "markup.bold",
"settings": {
"fontStyle": "bold"
}
});
const noBold = {
...parsed,
tokenColors: noBoldTokenColors,
}
fs.writeFile('themes/Prism-color-theme-no-bold-minimized.json', JSON.stringify(noBold), 'utf8', () => {
console.log('✔ NO BOLD DONE');
});
});