From 9d23726496db3a27c896bf48f423092d02a5a825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Mon, 24 Feb 2020 22:25:58 +0100 Subject: [PATCH] adding --- CHANGELOG.md | 2 + LICENSE | 22 ++++ README.md | 12 +++ grammars/riotjs.cson | 238 +++++++++++++++++++++++++++++++++++++++++++ package.json | 12 +++ 5 files changed, 286 insertions(+) create mode 100644 CHANGELOG.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 grammars/riotjs.cson create mode 100644 package.json 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": {} +}