const items = Array.from(document.querySelectorAll('main ul li')); const glossary = {} const exampleObject = {}; items.map(x => { const xx = x.textContent.split(':'); const desc = xx[1]?.trim(); const key = xx[0]?.trim(); if (!key.startsWith('The ')) { exampleObject[key] = "#ff0000"; glossary[key] = desc; } })
const pageContent = `
- Source: https://code.visualstudio.com/api/references/theme-color
- Retrieved: ${new Date().toString()}
NOTE: Key/value pairs should be nested under `workbench.colorCustomizations`
```js
const colorCustomizations = {
${Object.keys(exampleObject).map(key => {
return "${key}": "${exampleObject[key]}", // ${glossary[key]}
}).join('\n')}
}
```
; document.body.innerHTML =
${pageContent}`;