commit 9d23726496db3a27c896bf48f423092d02a5a825 Author: Björn Date: Mon Feb 24 22:25:58 2020 +0100 adding diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..6d707dd --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,2 @@ +## 0.1.0 +* Init diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b362558 --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2020 Björn Hase, Tentakelfabrik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/README.md b/README.md new file mode 100644 index 0000000..2430bd0 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# Riotjs Syntax highlight for Atom + +[Riot.js](https://riot.js.org) '.riot' components. + +## Install + +In Atom Editor, search under Preferences > Install for "language-riotjs" + +## Credits + +* Thanks to @dekimasoon, i have used his version as template +* Thanks to @hedefalk, i have used his script-tag from vue diff --git a/grammars/riotjs.cson b/grammars/riotjs.cson new file mode 100644 index 0000000..02462b8 --- /dev/null +++ b/grammars/riotjs.cson @@ -0,0 +1,238 @@ +scopeName: 'source.riot' +name: 'HTML (Riotjs)' +fileTypes: [ + 'riot' +] +patterns: [ + + # HTML ------------------------------- + { + name: 'meta.tag.any.html' + begin: '(' + endCaptures: + '0': + name: 'punctuation.definition.tag.end.html' + patterns: [ + { 'include': '#riotExpressions' } + { 'include': '#tagStuff' } + ] + } + # ------------------------------- HTML + + # Script ------------------------------- + { + name: "source.js.embedded.html" + begin: "(?:^\\s+)?(<)((?i:script))\\b(?![^>]*/>|lang=[\"'].*[\"'])" + beginCaptures: + "1": + name: "punctuation.definition.tag.html" + "2": + name: "entity.name.tag.script.html" + end: "(?<=)(?:\\s*\\n)?" + endCaptures: + "2": + name: "punctuation.definition.tag.html" + patterns: [ + { + include: "#tag-stuff" + } + { + begin: "(?)" + end: "(]*(?:(?:/>)|(?:type="(?:text/)?(?:sass|scss)")))' + end: '()(?:\\s*\\n)?' + captures: + '1': + name: 'punctuation.definition.tag.begin.html' + '2': + name: 'entity.name.tag.style.html' + '3': + name: 'punctuation.definition.tag.end.html' + patterns: [ + { include: '#tagStuff' } + { + begin: '(>)' + end: '(?=]*type="(?:text/)?sass")' + end: '()(?:\\s*\\n)?' + captures: + '1': + name: 'punctuation.definition.tag.begin.html' + '2': + name: 'entity.name.tag.style.html' + '3': + name: 'punctuation.definition.tag.end.html' + patterns: [ + { include: '#tagStuff' } + { + begin: '(>)' + end: '(?=]*type="(?:text/)?scss")' + end: '()(?:\\s*\\n)?' + captures: + '1': + name: 'punctuation.definition.tag.begin.html' + '2': + name: 'entity.name.tag.style.html' + '3': + name: 'punctuation.definition.tag.end.html' + patterns: [ + { include: '#tagStuff' } + { + begin: '(>)' + end: '(?=)' + patterns: [ + { + name: 'string.quoted.double.html' + contentName: 'meta.toc-list.id.html' + begin: '"' + beginCaptures: + '0': + name: 'punctuation.definition.string.begin.html' + end: '"' + endCaptures: + '0': + name: 'punctuation.definition.string.end.html' + } + { + name: 'string.quoted.single.html' + contentName: 'meta.toc-list.id.html' + begin: '\'' + beginCaptures: + '0': + name: 'punctuation.definition.string.begin.html' + end: '\'' + endCaptures: + '0': + name: 'punctuation.definition.string.end.html' + } + ] + + tagStuff: + patterns: [ + { include: '#tagIdAttribute' } + { include: '#tagGenericAttribute' } + { include: '#stringDoubleQuoted' } + { include: '#stringSingleQuoted' } + ] diff --git a/package.json b/package.json new file mode 100644 index 0000000..61a1fc8 --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "language-riotjs", + "version": "0.1.0", + "description": "Riotjs Syntax highlight for Atom", + "keywords": [], + "repository": "https://github.com/dekimasoon/language-riot-tag", + "license": "MIT", + "engines": { + "atom": ">=1.0.0 <2.0.0" + }, + "dependencies": {} +}