Skip to content

Instantly share code, notes, and snippets.

@cajus
Created September 29, 2017 08:41
Show Gist options
  • Save cajus/b00bbeb629013fb73a1bd8431e88c18a to your computer and use it in GitHub Desktop.
Save cajus/b00bbeb629013fb73a1bd8431e88c18a to your computer and use it in GitHub Desktop.
Convert fontawesome icon.yml to qx character map
const yaml = require('js-yaml')
const fs = require('fs')
let res = {}
let doc = yaml.safeLoad(fs.readFileSync('icons.yml', 'utf8'))
doc.icons.forEach((iconDsc) => {
res[iconDsc.id] = iconDsc.unicode
if (res.aliases) {
res.aliases.forEach((alias) => {
res[alias] = iconDsc.unicode
})
}
})
fs.writeFileSync('fontawesome.map', JSON.stringify(res))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment