Skip to content

hydroper/tmlanguage-yaml2json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Convert YAML TMLanguage form with variables to JSON

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published