Skip to content

Commit

Permalink
See #1687. Add Docker executable support for Sass-convert beautifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavin001 committed Jun 16, 2017
1 parent cdccc2f commit 6aee12b
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
17 changes: 17 additions & 0 deletions docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
18 changes: 15 additions & 3 deletions src/beautifiers/sass-convert.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
])
16 changes: 16 additions & 0 deletions src/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 6aee12b

Please sign in to comment.