Skip to content

Instantly share code, notes, and snippets.

@rbk
Created May 13, 2025 14:11
Show Gist options
  • Save rbk/9d261d80da598599deaf046552045f08 to your computer and use it in GitHub Desktop.
Save rbk/9d261d80da598599deaf046552045f08 to your computer and use it in GitHub Desktop.
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 = `
# VS Code Color Customizations
- Source: https://code.visualstudio.com/api/references/theme-color
- Retrieved: ${new Date().toString()}
NOTE: Key/value pairs should be nested under \`workbench.colorCustomizations\`
## Example Object
\`\`\`js
const colorCustomizations = {
${Object.keys(exampleObject).map(key => {
return `"${key}": "${exampleObject[key]}", // ${glossary[key]}`
}).join('\n')}
}
\`\`\`
`;
document.body.innerHTML = `<pre>${pageContent}</pre>`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment