ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Riot Syntax

by ilearnio ST3

Syntax highlighting for plain-js RiotJS tags

Details

Installs

  • Total 1K
  • Win 417
  • OS X 604
  • Linux 188
Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3
Windows 1 2 0 0 0 1 0 2 1 1 1 1 1 0 2 3 0 0 3 1 0 2 3 0 1 2 0 0 0 0 0 0 1 0 0 0 2 1 0 0 0 0 0 1 0
OS X 1 0 0 0 1 2 0 0 0 2 0 1 1 4 2 4 2 0 1 1 0 0 2 2 0 1 2 0 0 0 0 0 0 2 0 2 2 1 0 0 0 0 0 1 0
Linux 1 1 0 0 0 1 0 1 1 0 0 0 0 1 0 0 0 2 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 1 0 2 0 1 1 0 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?

  1. Linter support
  2. You can use JS sourcemaps
  3. Easier debugging (browser or terminal)
  4. Easier testing
  5. No extra compilation step
  6. 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
    },
    ...
  }
}