1.0.7 • Published 11 months ago

com.hydroper.tmlanguage.yamlsyntax2json v1.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

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"
}
1.0.7

11 months ago

1.0.6

11 months ago