com.hydroper.tmlanguage.yamlsyntax2json
v1.0.7
Published
Convert YAML TMLanguage syntax with variables to JSON format.
Downloads
1
Readme
tmlanguage-yaml2json
Convert a tmLanguage written in YAML to JSON.
Features:
- Variable replacement using the
{{variableName}}
syntax.
Usage
Install with:
npm i -g com.hydroper.tmlanguage.yamlsyntax2json
Write 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:
yamlsyntax2json mylanguage.tmLanguage.yaml mylanguage.tmLanguage.json
The 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"
}