com.hydroperfox.tmlanguage.yaml2json
v1.0.0
Published
Convert YAML TMLanguage syntax with variables to JSON format.
Downloads
4
Readme
tmlangyaml2json
Convert a tmLanguage written in YAML to JSON.
Features:
- Variable replacement using the
{{variableName}}syntax.
Note this was repository had to be recreated as I deleted it previously.
Usage
Install with:
npm i -g com.hydroperfox.tmlanguage.yaml2jsonWrite a file mylanguage.tmLanguage.yaml:
# tmLanguage
---
$schema: https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json
name: MyLanguageName
scopeName: source.mylang
variables:
someVar: 'xxx'
patterns:
- include: '#foo'
repository:
foo:
patterns: []Then run:
tmlangyaml2json mylanguage.tmLanguage.yaml mylanguage.tmLanguage.jsonThe output looks like follows:
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "MyLanguageName",
"patterns": [
{
"include": "#foo"
}
],
"repository": {
"foo": {
"patterns": []
}
},
"scopeName": "source.mylang"
}