Riot Syntax
Syntax highlighting for plain-js RiotJS tags
Details
Installs
- Total 2K
- Win 676
- Mac 895
- Linux 329
Jul 26 | Jul 25 | Jul 24 | Jul 23 | Jul 22 | Jul 21 | Jul 20 | Jul 19 | Jul 18 | Jul 17 | Jul 16 | Jul 15 | Jul 14 | Jul 13 | Jul 12 | Jul 11 | Jul 10 | Jul 9 | Jul 8 | Jul 7 | Jul 6 | Jul 5 | Jul 4 | Jul 3 | Jul 2 | Jul 1 | Jun 30 | Jun 29 | Jun 28 | Jun 27 | Jun 26 | Jun 25 | Jun 24 | Jun 23 | Jun 22 | Jun 21 | Jun 20 | Jun 19 | Jun 18 | Jun 17 | Jun 16 | Jun 15 | Jun 14 | Jun 13 | Jun 12 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Riot Syntax
Only supports Sublime Text 3.
Language definitions for ES6+ JavaScript with RiotJS extensions for Sublime Text 3.
Adds syntax highlighting support for HTML right inside of ES6 strings (i.e …) when it's inside of riot.tag('your-tag', ...)
. It also supports modern JavaScript syntax, including arrow functions, destructuring, shorthand methods, template strings, and more.
This package is a port of Babel-Sublime for RiotJS. The Babel-Sublime only supports syntax highlighting of React .jsx
components. This package is here to change it. Basically, all it does, is that it makes your HTML inside of … strings to act like it's React's HTML inside of JavaScript.
Please note, that it has no jsx
support. It ships with a new syntax called JavaScript Riot
which should be used only for your Riot's pure-js tags. If you are not planning to ever use jsx
, you can use it as your default JavaScript syntax.
Screenshots
Why to use plain JavaScript instead of .tag
files?
- Linter support
- You can use JS sourcemaps
- Easier debugging (browser or terminal)
- Easier testing
- No extra compilation step
- Require tags with Webpack or Browserify directly, without any loaders
Installation
Find it as Riot Syntax through Package Control.
Setting as the default syntax
To set it as the default syntax for a particular extension:
1. Open a file with that extension,
2. Select View
from the menu,
3. Then Syntax
->
Open all with current extension as...
->
JavaScript Riot
.
4. Repeat this for each extension (e.g.: .js
, .jsr
, .riot
).
Setting a Color Scheme
Riot Syntax comes bundled with Next
, Monokai
and Github
color themes. Select one from Preferences
->
Color Scheme
->
Riot Syntax
Configuring the “Sublime Linter” package
If you are using a custom extension name (e.g: .riot
) for your RiotJS tags and you want to have linting support for such file, then you need to customize “sublime linter” config file.
Go to Package Settings
->
Sublime Linter
->
Settings – User
and add this line "javascript riot": "javascript"
to your syntax_map
. After this modification your config file should look like so:
{
"user": {
...
"syntax_map": {
...
"javascript riot": "javascript" // <- add this line
},
...
}
}