diff --git a/docs/options.md b/docs/options.md index da88035..d49a2fc 100644 --- a/docs/options.md +++ b/docs/options.md @@ -334,6 +334,23 @@ Options for Rscript executable. 2. Go into *Packages* and search for "*Atom Beautify*" package. 3. Find the option "*Rscript*" and change it to your desired configuration. +##### [SassConvert](#sassconvert) + +**Important**: This option is only configurable from within Atom Beautify's setting panel. + +**Type**: `object` + +**Description**: + +Options for SassConvert executable. + +**How to Configure** + +1. You can open the [Settings View](https://github.com/atom/settings-view) by navigating to +*Edit > Preferences (Linux)*, *Atom > Preferences (OS X)*, or *File > Preferences (Windows)*. +2. Go into *Packages* and search for "*Atom Beautify*" package. +3. Find the option "*SassConvert*" and change it to your desired configuration. + ##### [Uncrustify](#uncrustify) **Important**: This option is only configurable from within Atom Beautify's setting panel. diff --git a/src/beautifiers/sass-convert.coffee b/src/beautifiers/sass-convert.coffee index e53fa98..5a8fe68 100644 --- a/src/beautifiers/sass-convert.coffee +++ b/src/beautifiers/sass-convert.coffee @@ -4,7 +4,20 @@ Beautifier = require('./beautifier') module.exports = class SassConvert extends Beautifier name: "SassConvert" link: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax" - isPreInstalled: false + executables: [ + { + name: "SassConvert" + cmd: "sass-convert" + homepage: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax" + installation: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax" + version: { + parse: (text) -> text.match(/Sass (\d+\.\d+\.\d+)/)[1] + } + docker: { + image: "unibeautify/sass-convert" + } + } + ] options: # TODO: Add support for options @@ -14,8 +27,7 @@ module.exports = class SassConvert extends Beautifier beautify: (text, language, options, context) -> lang = language.toLowerCase() - - @run("sass-convert", [ + @exe("sass-convert").run([ @tempFile("input", text), "--from", lang, "--to", lang ]) diff --git a/src/options.json b/src/options.json index 8456f22..f70f67d 100644 --- a/src/options.json +++ b/src/options.json @@ -9306,6 +9306,22 @@ } } }, + "sass-convert": { + "key": "sass-convert", + "title": "SassConvert", + "type": "object", + "collapsed": true, + "description": "Options for SassConvert executable.", + "properties": { + "path": { + "key": "path", + "title": "Binary/Script Path", + "type": "string", + "default": "", + "description": "Absolute path to the \"sass-convert\" executable's binary/script." + } + } + }, "rscript": { "key": "rscript", "title": "Rscript",