Add beautifiers information to README
See https://github.com/Glavin001/atom-beautify/issues/1525#issuecomment-292817161
This commit is contained in:
parent
794a47ef88
commit
ba2198675c
|
@ -20,6 +20,7 @@
|
|||
## Table of Contents
|
||||
|
||||
- [Installation](#installation)
|
||||
- [Beautifiers](#beautifiers)
|
||||
- [Language Support](#language-support)
|
||||
- [Usage](#usage)
|
||||
- [Selection of Code](#selection-of-code)
|
||||
|
@ -54,6 +55,11 @@ Thank you.
|
|||
Atom-Beautify is going to be completely rewritten with [Unibeautify](https://github.com/Unibeautify/unibeautify) at its core!
|
||||
See [`unibeautify` branch](../../tree/unibeautify) for work in progress and [Issue #1174](https://github.com/Glavin001/atom-beautify/issues/1174).
|
||||
|
||||
## Beautifiers
|
||||
|
||||
Some of the supported beautifiers are developed for Node.js and are automatically installed when Atom-Beautify is installed. However, other beautifiers are command-line interface (CLI) applications and require you to manually install them.
|
||||
|
||||
{{beautifiers-info beautifiers}}
|
||||
|
||||
## Language Support
|
||||
|
||||
|
|
54
README.md
54
README.md
|
@ -20,6 +20,7 @@
|
|||
## Table of Contents
|
||||
|
||||
- [Installation](#installation)
|
||||
- [Beautifiers](#beautifiers)
|
||||
- [Language Support](#language-support)
|
||||
- [Usage](#usage)
|
||||
- [Selection of Code](#selection-of-code)
|
||||
|
@ -54,6 +55,53 @@ Thank you.
|
|||
Atom-Beautify is going to be completely rewritten with [Unibeautify](https://github.com/Unibeautify/unibeautify) at its core!
|
||||
See [`unibeautify` branch](../../tree/unibeautify) for work in progress and [Issue #1174](https://github.com/Glavin001/atom-beautify/issues/1174).
|
||||
|
||||
## Beautifiers
|
||||
|
||||
Some of the supported beautifiers are developed for Node.js and are automatically installed when Atom-Beautify is installed. However, other beautifiers are command-line interface (CLI) applications and require you to manually install them.
|
||||
|
||||
| Beautifier | Is Pre-Installed? | Installation Instructions |
|
||||
| --- | --- | --- | ---- |
|
||||
| autopep8 | :x: | Go to https://github.com/hhatto/autopep8 and follow the instructions. |
|
||||
| beautysh | :x: | Go to https://github.com/bemeurer/beautysh and follow the instructions. |
|
||||
| clang-format | :x: | Go to https://clang.llvm.org/docs/ClangFormat.html and follow the instructions. |
|
||||
| cljfmt | :white_check_mark: | Nothing! |
|
||||
| Coffee Formatter | :white_check_mark: | Nothing! |
|
||||
| coffee-fmt | :white_check_mark: | Nothing! |
|
||||
| Crystal | :x: | Go to http://crystal-lang.org and follow the instructions. |
|
||||
| CSScomb | :white_check_mark: | Nothing! |
|
||||
| dfmt | :x: | Go to https://github.com/Hackerpilot/dfmt and follow the instructions. |
|
||||
| elm-format | :x: | Go to https://github.com/avh4/elm-format and follow the instructions. |
|
||||
| erl_tidy | :x: | Go to http://erlang.org/doc/man/erl_tidy.html and follow the instructions. |
|
||||
| formatR | :x: | Go to https://github.com/yihui/formatR and follow the instructions. |
|
||||
| Fortran Beautifier | :x: | Go to https://www.gnu.org/software/emacs/ and follow the instructions. |
|
||||
| Gherkin formatter | :white_check_mark: | Nothing! |
|
||||
| gofmt | :x: | Go to https://golang.org/cmd/gofmt/ and follow the instructions. |
|
||||
| hh_format | :x: | Go to http://hhvm.com/ and follow the instructions. |
|
||||
| HTML Beautifier | :x: | Go to https://github.com/threedaymonk/htmlbeautifier and follow the instructions. |
|
||||
| JS Beautify | :white_check_mark: | Nothing! |
|
||||
| JSCS Fixer | :white_check_mark: | Nothing! |
|
||||
| Latex Beautify | :x: | Go to https://github.com/cmhughes/latexindent.pl and follow the instructions. |
|
||||
| Lua beautifier | :x: | Go to https://www.perl.org/ and follow the instructions. |
|
||||
| Marko Beautifier | :white_check_mark: | Nothing! |
|
||||
| ocp-indent | :x: | Go to https://www.typerex.org/ocp-indent.html and follow the instructions. |
|
||||
| Perltidy | :x: | Go to http://perltidy.sourceforge.net/ and follow the instructions. |
|
||||
| PHP-CS-Fixer | :x: | Go to https://github.com/FriendsOfPHP/PHP-CS-Fixer and follow the instructions. |
|
||||
| PHPCBF | :x: | Go to http://php.net/manual/en/install.php and follow the instructions. |
|
||||
| Pretty Diff | :white_check_mark: | Nothing! |
|
||||
| Pug Beautify | :white_check_mark: | Nothing! |
|
||||
| puppet-lint | :x: | Go to http://puppet-lint.com/ and follow the instructions. |
|
||||
| Remark | :white_check_mark: | Nothing! |
|
||||
| Rubocop | :x: | Go to https://github.com/bbatsov/rubocop and follow the instructions. |
|
||||
| Ruby Beautify | :x: | Go to https://github.com/erniebrodeur/ruby-beautify and follow the instructions. |
|
||||
| rustfmt | :x: | Go to https://github.com/nrc/rustfmt and follow the instructions. |
|
||||
| SassConvert | :x: | Go to http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax and follow the instructions. |
|
||||
| sqlformat | :x: | Go to https://github.com/andialbrecht/sqlparse and follow the instructions. |
|
||||
| stylish-haskell | :x: | Go to https://github.com/jaspervdj/stylish-haskell and follow the instructions. |
|
||||
| Tidy Markdown | :white_check_mark: | Nothing! |
|
||||
| TypeScript Formatter | :white_check_mark: | Nothing! |
|
||||
| Uncrustify | :x: | Go to https://github.com/uncrustify/uncrustify and follow the instructions. |
|
||||
| Vue Beautifier | :white_check_mark: | Nothing! |
|
||||
| yapf | :x: | Go to https://github.com/google/yapf and follow the instructions. |
|
||||
|
||||
## Language Support
|
||||
|
||||
|
@ -78,7 +126,7 @@ See [all supported options in the documentation at `docs/options.md`](docs/opti
|
|||
| Elm | `Elm` |`.elm` | [`elm-format`](https://github.com/avh4/elm-format) (Default) |
|
||||
| ERB | `HTML (Ruby - ERB)`, `HTML (Rails)` |`.erb` | [`HTML Beautifier`](https://github.com/threedaymonk/htmlbeautifier), [`Pretty Diff`](https://github.com/prettydiff/prettydiff) (Default) |
|
||||
| Erlang | `Erlang` |`.erl` | [`erl_tidy`](http://erlang.org/doc/man/erl_tidy.html) (Default) |
|
||||
| Fortran | `Fortran - Modern` |`.f90`, `.F90`, `.f95`, `.F95` | [`Fortran Beautifier`](https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/fortran-beautifier/emacs-fortran-formating-script.lisp) (Default) |
|
||||
| Fortran | `Fortran - Modern` |`.f90`, `.F90`, `.f95`, `.F95` | [`Fortran Beautifier`](https://www.gnu.org/software/emacs/) (Default) |
|
||||
| gherkin | `Gherkin` |`.feature` | [`Gherkin formatter`](https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/gherkin.coffee) (Default) |
|
||||
| GLSL | `C`, `opencl`, `GLSL` |`.vert`, `.frag` | [`clang-format`](https://clang.llvm.org/docs/ClangFormat.html) (Default) |
|
||||
| Go | `Go` |`.go` | [`gofmt`](https://golang.org/cmd/gofmt/) (Default) |
|
||||
|
@ -92,7 +140,7 @@ See [all supported options in the documentation at `docs/options.md`](docs/opti
|
|||
| JSX | `JSX`, `JavaScript (JSX)`, `Babel ES6 JavaScript`, `JavaScript with JSX` |`.jsx`, `.js` | [`JS Beautify`](https://github.com/beautify-web/js-beautify), [`Pretty Diff`](https://github.com/prettydiff/prettydiff) (Default) |
|
||||
| LaTeX | `LaTeX` |`.tex` | [`Latex Beautify`](https://github.com/cmhughes/latexindent.pl) (Default) |
|
||||
| LESS | `LESS` |`.less` | [`CSScomb`](https://github.com/csscomb/csscomb.js), [`Pretty Diff`](https://github.com/prettydiff/prettydiff) (Default) |
|
||||
| Lua | `Lua` |`.lua` | [`Lua beautifier`](https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/lua-beautifier/beautifier.pl) (Default) |
|
||||
| Lua | `Lua` |`.lua` | [`Lua beautifier`](https://www.perl.org/) (Default) |
|
||||
| Markdown | `GitHub Markdown` |`.markdown`, `.md` | [`Remark`](https://github.com/wooorm/remark), [`Tidy Markdown`](https://github.com/slang800/tidy-markdown) (Default) |
|
||||
| Marko | `Marko` |`.marko` | [`Marko Beautifier`](https://github.com/marko-js/marko-prettyprint) (Default) |
|
||||
| Mustache | `HTML (Mustache)` |`.mustache` | [`JS Beautify`](https://github.com/beautify-web/js-beautify) (Default) |
|
||||
|
@ -120,7 +168,7 @@ See [all supported options in the documentation at `docs/options.md`](docs/opti
|
|||
| UX Markup | `UX` |`.ux` | [`Pretty Diff`](https://github.com/prettydiff/prettydiff) (Default) |
|
||||
| Vala | `Vala` |`.vala`, `.vapi` | [`Uncrustify`](https://github.com/uncrustify/uncrustify) (Default) |
|
||||
| Visualforce | `Visualforce` |`.page` | [`Pretty Diff`](https://github.com/prettydiff/prettydiff) (Default) |
|
||||
| Vue | `Vue Component` |`.vue` | `Vue Beautifier` (Default) |
|
||||
| Vue | `Vue Component` |`.vue` | [`Vue Beautifier`](https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/vue-beautifier.coffee) (Default) |
|
||||
| XML | `SLD`, `XML`, `XHTML`, `XSD`, `XSL`, `JSP`, `GSP` |`.sld`, `.xml`, `.xhtml`, `.xsd`, `.xsl`, `.jsp`, `.gsp`, `.plist`, `.recipe` | [`JS Beautify`](https://github.com/beautify-web/js-beautify), [`Pretty Diff`](https://github.com/prettydiff/prettydiff) (Default) |
|
||||
| XTemplate | `XTemplate` |`.xtemplate` | [`Pretty Diff`](https://github.com/prettydiff/prettydiff) (Default) |
|
||||
|
||||
|
|
|
@ -150,6 +150,31 @@ Handlebars.registerHelper('language-options-support', (languageOptions, options)
|
|||
return new Handlebars.SafeString(results)
|
||||
)
|
||||
|
||||
|
||||
Handlebars.registerHelper('beautifiers-info', (beautifiers, options) ->
|
||||
|
||||
###
|
||||
| Beautifier | Is Pre-Installed? | Installation Instructions |
|
||||
| --- | ---- |
|
||||
| Pretty Diff | :white_check_mark: | N/A |
|
||||
| AutoPEP8 | :x: | LINK |
|
||||
###
|
||||
|
||||
rows = _.map(beautifiers, (beautifier, k) ->
|
||||
name = beautifier.name
|
||||
isPreInstalled = beautifier.isPreInstalled
|
||||
link = beautifier.link
|
||||
installationInstructions = if isPreInstalled then "Nothing!" else "Go to #{link} and follow the instructions."
|
||||
return "| #{name} | #{if isPreInstalled then ':white_check_mark:' else ':x:'} | #{installationInstructions} |"
|
||||
)
|
||||
results = """
|
||||
| Beautifier | Is Pre-Installed? | Installation Instructions |
|
||||
| --- | --- | --- | ---- |
|
||||
#{rows.join('\n')}
|
||||
"""
|
||||
return new Handlebars.SafeString(results)
|
||||
)
|
||||
|
||||
sortKeysBy = (obj, comparator) ->
|
||||
keys = _.sortBy(_.keys(obj), (key) ->
|
||||
return if comparator then comparator(obj[key], key) else key
|
||||
|
@ -176,6 +201,7 @@ context = {
|
|||
packageOptions: sortSettings(packageOptions)
|
||||
languageOptions: sortSettings(languageOptions)
|
||||
beautifierOptions: sortSettings(beautifierOptions)
|
||||
beautifiers: _.sortBy(beautifier.beautifiers, (beautifier) -> beautifier.name.toLowerCase())
|
||||
}
|
||||
result = template(context)
|
||||
readmeResult = readmeTemplate(context)
|
||||
|
|
|
@ -9,6 +9,7 @@ module.exports = class Autopep8 extends Beautifier
|
|||
|
||||
name: "autopep8"
|
||||
link: "https://github.com/hhatto/autopep8"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
Python: true
|
||||
|
|
|
@ -31,6 +31,11 @@ module.exports = class Beautifier
|
|||
###
|
||||
options: {}
|
||||
|
||||
###
|
||||
Is the beautifier a command-line interface beautifier?
|
||||
###
|
||||
isPreInstalled: true
|
||||
|
||||
###
|
||||
Supported languages by this Beautifier
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@ Beautifier = require('./beautifier')
|
|||
module.exports = class BashBeautify extends Beautifier
|
||||
name: "beautysh"
|
||||
link: "https://github.com/bemeurer/beautysh"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
Bash:
|
||||
indent_size: true
|
||||
|
|
|
@ -11,6 +11,7 @@ module.exports = class ClangFormat extends Beautifier
|
|||
|
||||
name: "clang-format"
|
||||
link: "https://clang.llvm.org/docs/ClangFormat.html"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
"C++": false
|
||||
|
|
|
@ -8,6 +8,7 @@ Beautifier = require('./beautifier')
|
|||
module.exports = class Crystal extends Beautifier
|
||||
name: "Crystal"
|
||||
link: "http://crystal-lang.org"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
Crystal: false
|
||||
|
|
|
@ -7,6 +7,7 @@ Beautifier = require('./beautifier')
|
|||
module.exports = class Dfmt extends Beautifier
|
||||
name: "dfmt"
|
||||
link: "https://github.com/Hackerpilot/dfmt"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
D: false
|
||||
|
|
|
@ -7,6 +7,7 @@ Beautifier = require('./beautifier')
|
|||
module.exports = class ElmFormat extends Beautifier
|
||||
name: "elm-format"
|
||||
link: "https://github.com/avh4/elm-format"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
Elm: true
|
||||
|
|
|
@ -9,6 +9,7 @@ module.exports = class ErlTidy extends Beautifier
|
|||
|
||||
name: "erl_tidy"
|
||||
link: "http://erlang.org/doc/man/erl_tidy.html"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
Erlang: true
|
||||
|
|
|
@ -9,6 +9,7 @@ Beautifier = require('../beautifier')
|
|||
module.exports = class R extends Beautifier
|
||||
name: "formatR"
|
||||
link: "https://github.com/yihui/formatR"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
R: true
|
||||
|
|
|
@ -8,7 +8,8 @@ path = require("path")
|
|||
|
||||
module.exports = class FortranBeautifier extends Beautifier
|
||||
name: "Fortran Beautifier"
|
||||
link: "https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/fortran-beautifier/emacs-fortran-formating-script.lisp"
|
||||
link: "https://www.gnu.org/software/emacs/"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
Fortran: true
|
||||
|
|
|
@ -8,6 +8,7 @@ Beautifier = require('./beautifier')
|
|||
module.exports = class Gofmt extends Beautifier
|
||||
name: "gofmt"
|
||||
link: "https://golang.org/cmd/gofmt/"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
Go: true
|
||||
|
|
|
@ -8,6 +8,7 @@ Beautifier = require('./beautifier')
|
|||
module.exports = class HhFormat extends Beautifier
|
||||
name: "hh_format"
|
||||
link: "http://hhvm.com/"
|
||||
isPreInstalled: false
|
||||
|
||||
options:
|
||||
PHP: false
|
||||
|
|
|
@ -8,6 +8,8 @@ Beautifier = require('./beautifier')
|
|||
module.exports = class HTMLBeautifier extends Beautifier
|
||||
name: "HTML Beautifier"
|
||||
link: "https://github.com/threedaymonk/htmlbeautifier"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
ERB:
|
||||
indent_size: true
|
||||
|
|
|
@ -8,6 +8,7 @@ temp = require("temp").track()
|
|||
module.exports = class LatexBeautify extends Beautifier
|
||||
name: "Latex Beautify"
|
||||
link: "https://github.com/cmhughes/latexindent.pl"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
LaTeX: true
|
||||
|
|
|
@ -7,7 +7,8 @@ Beautifier = require('../beautifier')
|
|||
|
||||
module.exports = class Lua extends Beautifier
|
||||
name: "Lua beautifier"
|
||||
link: "https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/lua-beautifier/beautifier.pl"
|
||||
link: "https://www.perl.org/"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
Lua: true
|
||||
|
|
|
@ -8,6 +8,7 @@ Beautifier = require('./beautifier')
|
|||
module.exports = class OCPIndent extends Beautifier
|
||||
name: "ocp-indent"
|
||||
link: "https://www.typerex.org/ocp-indent.html"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
OCaml: true
|
||||
|
|
|
@ -7,6 +7,7 @@ Beautifier = require('./beautifier')
|
|||
module.exports = class PerlTidy extends Beautifier
|
||||
name: "Perltidy"
|
||||
link: "http://perltidy.sourceforge.net/"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
Perl: true
|
||||
|
|
|
@ -10,6 +10,7 @@ module.exports = class PHPCSFixer extends Beautifier
|
|||
|
||||
name: 'PHP-CS-Fixer'
|
||||
link: "https://github.com/FriendsOfPHP/PHP-CS-Fixer"
|
||||
isPreInstalled: false
|
||||
|
||||
options:
|
||||
PHP: true
|
||||
|
|
|
@ -8,6 +8,7 @@ Beautifier = require('./beautifier')
|
|||
module.exports = class PHPCBF extends Beautifier
|
||||
name: "PHPCBF"
|
||||
link: "http://php.net/manual/en/install.php"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
_:
|
||||
|
|
|
@ -8,6 +8,7 @@ module.exports = class PuppetFix extends Beautifier
|
|||
# this is what displays as your Default Beautifier in Language Config
|
||||
name: "puppet-lint"
|
||||
link: "http://puppet-lint.com/"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
Puppet: true
|
||||
|
|
|
@ -8,6 +8,7 @@ Beautifier = require('./beautifier')
|
|||
module.exports = class Rubocop extends Beautifier
|
||||
name: "Rubocop"
|
||||
link: "https://github.com/bbatsov/rubocop"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
Ruby:
|
||||
|
|
|
@ -8,6 +8,7 @@ Beautifier = require('./beautifier')
|
|||
module.exports = class RubyBeautify extends Beautifier
|
||||
name: "Ruby Beautify"
|
||||
link: "https://github.com/erniebrodeur/ruby-beautify"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
Ruby:
|
||||
|
|
|
@ -11,6 +11,7 @@ versionCheckState = false
|
|||
module.exports = class Rustfmt extends Beautifier
|
||||
name: "rustfmt"
|
||||
link: "https://github.com/nrc/rustfmt"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
Rust: true
|
||||
|
|
|
@ -4,6 +4,7 @@ Beautifier = require('./beautifier')
|
|||
module.exports = class SassConvert extends Beautifier
|
||||
name: "SassConvert"
|
||||
link: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax"
|
||||
isPreInstalled: false
|
||||
|
||||
options:
|
||||
# TODO: Add support for options
|
||||
|
|
|
@ -8,6 +8,7 @@ Beautifier = require('./beautifier')
|
|||
module.exports = class Sqlformat extends Beautifier
|
||||
name: "sqlformat"
|
||||
link: "https://github.com/andialbrecht/sqlparse"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
SQL: true
|
||||
|
|
|
@ -8,6 +8,7 @@ Beautifier = require('./beautifier')
|
|||
module.exports = class StylishHaskell extends Beautifier
|
||||
name: "stylish-haskell"
|
||||
link: "https://github.com/jaspervdj/stylish-haskell"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
Haskell: true
|
||||
|
|
|
@ -11,6 +11,8 @@ _ = require('lodash')
|
|||
module.exports = class Uncrustify extends Beautifier
|
||||
name: "Uncrustify"
|
||||
link: "https://github.com/uncrustify/uncrustify"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
Apex: true
|
||||
C: true
|
||||
|
|
|
@ -5,6 +5,7 @@ _ = require('lodash')
|
|||
|
||||
module.exports = class VueBeautifier extends Beautifier
|
||||
name: "Vue Beautifier"
|
||||
link: "https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/vue-beautifier.coffee"
|
||||
|
||||
options:
|
||||
Vue: true
|
||||
|
|
|
@ -9,6 +9,7 @@ module.exports = class Yapf extends Beautifier
|
|||
|
||||
name: "yapf"
|
||||
link: "https://github.com/google/yapf"
|
||||
isPreInstalled: false
|
||||
|
||||
options: {
|
||||
Python: false
|
||||
|
|
Loading…
Reference in New Issue