https://github.com/mattmcfarland/maniascript.tmlanguage
Native tmLanguage Grammar for ManiaScript
https://github.com/mattmcfarland/maniascript.tmlanguage
maniascript tmlanguage
Last synced: 8 months ago
JSON representation
Native tmLanguage Grammar for ManiaScript
- Host: GitHub
- URL: https://github.com/mattmcfarland/maniascript.tmlanguage
- Owner: MattMcFarland
- Created: 2017-03-23T17:21:55.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2021-08-11T02:47:48.000Z (over 4 years ago)
- Last Synced: 2025-04-06T16:29:45.909Z (about 1 year ago)
- Topics: maniascript, tmlanguage
- Language: JavaScript
- Size: 71.3 KB
- Stars: 2
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# ManiaScript.tmLanguage
Native TextMate Language Grammar File
## Why?
This is the grammar resource for ManiaScript. It's purpose is to be the single source of truth for
the grammar files, so that text/code editors may use the same .tmLanguage files.
## How to use
The final .tmLanguage file is *not* in source control, instead it is built from the `src` path.
## Usage
```
git clone https://github.com/MattMcFarland/ManiaScript.tmLanguage
cd ManiaScript.tmLanguage
npm install
npm run build
```
Once you build the scripts, you can access it in the `build` path, then you may export that to your plugin.
I recommend using this as a dependency, instead of manually copying it over. However, it depends on the IDE you are supporting.
## Usage with a NodeJS editor
Editors like Atom and VS Code for example use the NodeJS runtime, so you can simply do this as part of your `publish` script
```javascript
const tmLanguage = require('maniascript-tmlanguage')
// write to xml
fs.writeFileSync('ManiaScript.tmLanguage', tmLanguage.plist);
// write to yaml
fs.writeFileSync('ManiaScript.YAML-tmLanguage', tmLanguage.yaml);
// write to json
fs.writeFileSync('ManiaScript.JSON-tmLanguage', tmLanguage.json);
```