Skip to content

Instantly share code, notes, and snippets.

@vaclavsvejcar
Created February 7, 2022 13:42
Show Gist options
  • Save vaclavsvejcar/73b88d38f1c25b0841a28b7c4f04a0b4 to your computer and use it in GitHub Desktop.
Save vaclavsvejcar/73b88d38f1c25b0841a28b7c4f04a0b4 to your computer and use it in GitHub Desktop.
SME properties generator
(function () {
const json = JSON.parse(document.body.getElementsByTagName('pre')[0].innerText);
const lines = [];
for (let ns of Object.keys(json.cs)) {
for (let [key, value] of Object.entries(json.cs[ns])) {
lines.push(`${ns}.${key}=${value}`);
}
}
const text = lines.join('\n');
const file = new Blob([text], { type: 'text/x-java-properties' });
const a = document.createElement('a');
a.href = URL.createObjectURL(file);
a.download = 'sme.properties';
a.click();
URL.revokeObjectURL(a.href);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment