diff --git a/README.md b/README.md index eafa7dd..9b80bd6 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,7 @@ See [all supported options in the documentation at `docs/options.md`](docs/opti | Apex | `Apex` |`.cls`, `.trigger` | **[`Uncrustify`](https://github.com/uncrustify/uncrustify)** | | Arduino | `Arduino` |`.ino`, `.pde` | **[`Uncrustify`](https://github.com/uncrustify/uncrustify)** | | Bash | `Shell Script` |`.bash`, `.sh` | **[`beautysh`](https://github.com/bemeurer/beautysh)** | +| Blade | `Blade` |`.blade.php` | **[`JS Beautify`](https://github.com/beautify-web/js-beautify)** | | C | `C`, `opencl` |`.h`, `.c`, `.cl` | **[`Uncrustify`](https://github.com/uncrustify/uncrustify)**, [`clang-format`](https://clang.llvm.org/docs/ClangFormat.html) | | Coldfusion | `html` |`.cfm`, `.cfml`, `.cfc` | **[`Pretty Diff`](https://github.com/prettydiff/prettydiff)** | | Clojure | `Clojure` |`.clj`, `.cljs`, `.edn` | **[`cljfmt`](https://github.com/snoe/node-cljfmt)** | diff --git a/docs/options.md b/docs/options.md index 5ceec35..99cb129 100644 --- a/docs/options.md +++ b/docs/options.md @@ -786,6 +786,501 @@ Indentation uses tabs, overrides `Indent Size` and `Indent Char` (Supported by b } ``` +#### [Blade](#blade) + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +| Option | JS Beautify | +| --- | --- | +| `disabled` | :white_check_mark: | +| `default_beautifier` | :white_check_mark: | +| `beautify_on_save` | :white_check_mark: | +| `brace_style` | :white_check_mark: | +| `end_with_newline` | :white_check_mark: | +| `extra_liners` | :white_check_mark: | +| `indent_char` | :white_check_mark: | +| `indent_inner_html` | :white_check_mark: | +| `indent_scripts` | :white_check_mark: | +| `indent_size` | :white_check_mark: | +| `max_preserve_newlines` | :white_check_mark: | +| `preserve_newlines` | :white_check_mark: | +| `unformatted` | :white_check_mark: | +| `wrap_attributes` | :white_check_mark: | +| `wrap_attributes_indent_size` | :white_check_mark: | +| `wrap_line_length` | :white_check_mark: | + +**Description**: + +Options for language Blade + +##### [Disable Beautifying Language](#disable-beautifying-language) + +**Important**: This option is only configurable from within Atom Beautify's setting panel. + +**Type**: `boolean` + +**Description**: + +Disable Blade Beautification + +**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 "*Disable Beautifying Language*" and change it to your desired configuration. + +##### [Default Beautifier](#default-beautifier) + +**Important**: This option is only configurable from within Atom Beautify's setting panel. + +**Default**: `JS Beautify` + +**Type**: `string` + +**Enum**: `JS Beautify` + +**Description**: + +Default Beautifier to be used for Blade + +**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 "*Default Beautifier*" and change it to your desired configuration. + +##### [Beautify On Save](#beautify-on-save) + +**Important**: This option is only configurable from within Atom Beautify's setting panel. + +**Type**: `boolean` + +**Description**: + +Automatically beautify Blade files on save + +**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 "*Beautify On Save*" and change it to your desired configuration. + +##### [Brace style](#brace-style) + +**Namespace**: `html` + +**Key**: `brace_style` + +**Default**: `collapse` + +**Type**: `string` + +**Enum**: `collapse` `expand` `end-expand` `none` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +[collapse|expand|end-expand|none] (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "brace_style": "collapse" + } +} +``` + +##### [End with newline](#end-with-newline) + +**Namespace**: `html` + +**Key**: `end_with_newline` + +**Type**: `boolean` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +End output with newline (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "end_with_newline": false + } +} +``` + +##### [Extra liners](#extra-liners) + +**Namespace**: `html` + +**Key**: `extra_liners` + +**Default**: `head,body,/html` + +**Type**: `array` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +List of tags (defaults to [head,body,/html] that should have an extra newline before them. (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "extra_liners": [ + "head", + "body", + "/html" + ] + } +} +``` + +##### [Indent char](#indent-char) + +**Namespace**: `html` + +**Key**: `indent_char` + +**Default**: ` ` + +**Type**: `string` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Indentation character (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "indent_char": " " + } +} +``` + +##### [Indent inner html](#indent-inner-html) + +**Namespace**: `html` + +**Key**: `indent_inner_html` + +**Type**: `boolean` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Indent and sections. (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "indent_inner_html": false + } +} +``` + +##### [Indent scripts](#indent-scripts) + +**Namespace**: `html` + +**Key**: `indent_scripts` + +**Default**: `normal` + +**Type**: `string` + +**Enum**: `keep` `separate` `normal` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +[keep|separate|normal] (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "indent_scripts": "normal" + } +} +``` + +##### [Indent size](#indent-size) + +**Namespace**: `html` + +**Key**: `indent_size` + +**Default**: `4` + +**Type**: `integer` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Indentation size/length (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "indent_size": 4 + } +} +``` + +##### [Max preserve newlines](#max-preserve-newlines) + +**Namespace**: `html` + +**Key**: `max_preserve_newlines` + +**Default**: `10` + +**Type**: `integer` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Number of line-breaks to be preserved in one chunk (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "max_preserve_newlines": 10 + } +} +``` + +##### [Preserve newlines](#preserve-newlines) + +**Namespace**: `html` + +**Key**: `preserve_newlines` + +**Default**: `true` + +**Type**: `boolean` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Preserve line-breaks (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "preserve_newlines": true + } +} +``` + +##### [Unformatted](#unformatted) + +**Namespace**: `html` + +**Key**: `unformatted` + +**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,small,strike,tt,pre,h1,h2,h3,h4,h5,h6` + +**Type**: `array` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +List of tags (defaults to inline) that should not be reformatted (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "unformatted": [ + "a", + "abbr", + "area", + "audio", + "b", + "bdi", + "bdo", + "br", + "button", + "canvas", + "cite", + "code", + "data", + "datalist", + "del", + "dfn", + "em", + "embed", + "i", + "iframe", + "img", + "input", + "ins", + "kbd", + "keygen", + "label", + "map", + "mark", + "math", + "meter", + "noscript", + "object", + "output", + "progress", + "q", + "ruby", + "s", + "samp", + "select", + "small", + "span", + "strong", + "sub", + "sup", + "svg", + "template", + "textarea", + "time", + "u", + "var", + "video", + "wbr", + "text", + "acronym", + "address", + "big", + "dt", + "ins", + "small", + "strike", + "tt", + "pre", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6" + ] + } +} +``` + +##### [Wrap attributes](#wrap-attributes) + +**Namespace**: `html` + +**Key**: `wrap_attributes` + +**Default**: `auto` + +**Type**: `string` + +**Enum**: `auto` `force` `force-aligned` `force-expand-multiline` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Wrap attributes to new lines [auto|force|force-aligned|force-expand-multiline] (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "wrap_attributes": "auto" + } +} +``` + +##### [Wrap attributes indent size](#wrap-attributes-indent-size) + +**Namespace**: `html` + +**Key**: `wrap_attributes_indent_size` + +**Default**: `4` + +**Type**: `integer` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Indent wrapped attributes to after N characters (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "wrap_attributes_indent_size": 4 + } +} +``` + +##### [Wrap line length](#wrap-line-length) + +**Namespace**: `html` + +**Key**: `wrap_line_length` + +**Default**: `250` + +**Type**: `integer` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Maximum characters per line (0 disables) (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "wrap_line_length": 250 + } +} +``` + #### [C](#c) **Supported Beautifiers**: [`Uncrustify`](#uncrustify) [`clang-format`](#clang-format) @@ -15515,6 +16010,30 @@ Indentation size/length (Supported by HTML Beautifier, Pretty Diff) ### JS Beautify +##### [Indent inner html](#indent-inner-html) + +**Namespace**: `html` + +**Key**: `indent_inner_html` + +**Type**: `boolean` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Indent and sections. (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "indent_inner_html": false + } +} +``` + ##### [Indent size](#indent-size) **Namespace**: `html` @@ -15567,6 +16086,343 @@ Indentation character (Supported by JS Beautify, Pretty Diff) } ``` +##### [Brace style](#brace-style) + +**Namespace**: `html` + +**Key**: `brace_style` + +**Default**: `collapse` + +**Type**: `string` + +**Enum**: `collapse` `expand` `end-expand` `none` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +[collapse|expand|end-expand|none] (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "brace_style": "collapse" + } +} +``` + +##### [Indent scripts](#indent-scripts) + +**Namespace**: `html` + +**Key**: `indent_scripts` + +**Default**: `normal` + +**Type**: `string` + +**Enum**: `keep` `separate` `normal` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +[keep|separate|normal] (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "indent_scripts": "normal" + } +} +``` + +##### [Wrap line length](#wrap-line-length) + +**Namespace**: `html` + +**Key**: `wrap_line_length` + +**Default**: `250` + +**Type**: `integer` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff) + +**Description**: + +Maximum characters per line (0 disables) (Supported by JS Beautify, Pretty Diff) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "wrap_line_length": 250 + } +} +``` + +##### [Wrap attributes](#wrap-attributes) + +**Namespace**: `html` + +**Key**: `wrap_attributes` + +**Default**: `auto` + +**Type**: `string` + +**Enum**: `auto` `force` `force-aligned` `force-expand-multiline` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Wrap attributes to new lines [auto|force|force-aligned|force-expand-multiline] (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "wrap_attributes": "auto" + } +} +``` + +##### [Wrap attributes indent size](#wrap-attributes-indent-size) + +**Namespace**: `html` + +**Key**: `wrap_attributes_indent_size` + +**Default**: `4` + +**Type**: `integer` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Indent wrapped attributes to after N characters (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "wrap_attributes_indent_size": 4 + } +} +``` + +##### [Preserve newlines](#preserve-newlines) + +**Namespace**: `html` + +**Key**: `preserve_newlines` + +**Default**: `true` + +**Type**: `boolean` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff) + +**Description**: + +Preserve line-breaks (Supported by JS Beautify, Pretty Diff) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "preserve_newlines": true + } +} +``` + +##### [Max preserve newlines](#max-preserve-newlines) + +**Namespace**: `html` + +**Key**: `max_preserve_newlines` + +**Default**: `10` + +**Type**: `integer` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +Number of line-breaks to be preserved in one chunk (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "max_preserve_newlines": 10 + } +} +``` + +##### [Unformatted](#unformatted) + +**Namespace**: `html` + +**Key**: `unformatted` + +**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,small,strike,tt,pre,h1,h2,h3,h4,h5,h6` + +**Type**: `array` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +List of tags (defaults to inline) that should not be reformatted (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "unformatted": [ + "a", + "abbr", + "area", + "audio", + "b", + "bdi", + "bdo", + "br", + "button", + "canvas", + "cite", + "code", + "data", + "datalist", + "del", + "dfn", + "em", + "embed", + "i", + "iframe", + "img", + "input", + "ins", + "kbd", + "keygen", + "label", + "map", + "mark", + "math", + "meter", + "noscript", + "object", + "output", + "progress", + "q", + "ruby", + "s", + "samp", + "select", + "small", + "span", + "strong", + "sub", + "sup", + "svg", + "template", + "textarea", + "time", + "u", + "var", + "video", + "wbr", + "text", + "acronym", + "address", + "big", + "dt", + "ins", + "small", + "strike", + "tt", + "pre", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6" + ] + } +} +``` + +##### [End with newline](#end-with-newline) + +**Namespace**: `html` + +**Key**: `end_with_newline` + +**Type**: `boolean` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +End output with newline (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "end_with_newline": false + } +} +``` + +##### [Extra liners](#extra-liners) + +**Namespace**: `html` + +**Key**: `extra_liners` + +**Default**: `head,body,/html` + +**Type**: `array` + +**Supported Beautifiers**: [`JS Beautify`](#js-beautify) + +**Description**: + +List of tags (defaults to [head,body,/html] that should have an extra newline before them. (Supported by JS Beautify) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "extra_liners": [ + "head", + "body", + "/html" + ] + } +} +``` + ##### [Selector separator newline](#selector-separator-newline) **Namespace**: `css` @@ -15617,82 +16473,6 @@ Add a newline between CSS rules (Supported by JS Beautify, Pretty Diff) } ``` -##### [Preserve newlines](#preserve-newlines) - -**Namespace**: `html` - -**Key**: `preserve_newlines` - -**Default**: `true` - -**Type**: `boolean` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff) - -**Description**: - -Preserve line-breaks (Supported by JS Beautify, Pretty Diff) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "preserve_newlines": true - } -} -``` - -##### [Wrap line length](#wrap-line-length) - -**Namespace**: `html` - -**Key**: `wrap_line_length` - -**Default**: `250` - -**Type**: `integer` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff) - -**Description**: - -Maximum characters per line (0 disables) (Supported by JS Beautify, Pretty Diff) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "wrap_line_length": 250 - } -} -``` - -##### [End with newline](#end-with-newline) - -**Namespace**: `html` - -**Key**: `end_with_newline` - -**Type**: `boolean` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) - -**Description**: - -End output with newline (Supported by JS Beautify) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "end_with_newline": false - } -} -``` - ##### [Indent level](#indent-level) **Namespace**: `js` @@ -15741,32 +16521,6 @@ Indentation uses tabs, overrides `Indent Size` and `Indent Char` (Supported by J } ``` -##### [Max preserve newlines](#max-preserve-newlines) - -**Namespace**: `html` - -**Key**: `max_preserve_newlines` - -**Default**: `10` - -**Type**: `integer` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) - -**Description**: - -Number of line-breaks to be preserved in one chunk (Supported by JS Beautify) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "max_preserve_newlines": 10 - } -} -``` - ##### [Space in paren](#space-in-paren) **Namespace**: `js` @@ -15839,34 +16593,6 @@ Add a space before an anonymous function's parens, ie. function () (Supported by } ``` -##### [Brace style](#brace-style) - -**Namespace**: `html` - -**Key**: `brace_style` - -**Default**: `collapse` - -**Type**: `string` - -**Enum**: `collapse` `expand` `end-expand` `none` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) - -**Description**: - -[collapse|expand|end-expand|none] (Supported by JS Beautify) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "brace_style": "collapse" - } -} -``` - ##### [Break chained methods](#break-chained-methods) **Namespace**: `js` @@ -16089,237 +16815,6 @@ Insert spaces between brackets in object literals (Supported by JS Beautify) } ``` -##### [Indent inner html](#indent-inner-html) - -**Namespace**: `html` - -**Key**: `indent_inner_html` - -**Type**: `boolean` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) - -**Description**: - -Indent and sections. (Supported by JS Beautify) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "indent_inner_html": false - } -} -``` - -##### [Indent scripts](#indent-scripts) - -**Namespace**: `html` - -**Key**: `indent_scripts` - -**Default**: `normal` - -**Type**: `string` - -**Enum**: `keep` `separate` `normal` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) - -**Description**: - -[keep|separate|normal] (Supported by JS Beautify) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "indent_scripts": "normal" - } -} -``` - -##### [Wrap attributes](#wrap-attributes) - -**Namespace**: `html` - -**Key**: `wrap_attributes` - -**Default**: `auto` - -**Type**: `string` - -**Enum**: `auto` `force` `force-aligned` `force-expand-multiline` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) - -**Description**: - -Wrap attributes to new lines [auto|force|force-aligned|force-expand-multiline] (Supported by JS Beautify) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "wrap_attributes": "auto" - } -} -``` - -##### [Wrap attributes indent size](#wrap-attributes-indent-size) - -**Namespace**: `html` - -**Key**: `wrap_attributes_indent_size` - -**Default**: `4` - -**Type**: `integer` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) - -**Description**: - -Indent wrapped attributes to after N characters (Supported by JS Beautify) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "wrap_attributes_indent_size": 4 - } -} -``` - -##### [Unformatted](#unformatted) - -**Namespace**: `html` - -**Key**: `unformatted` - -**Default**: `a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,keygen,label,map,mark,math,meter,noscript,object,output,progress,q,ruby,s,samp,select,small,span,strong,sub,sup,svg,template,textarea,time,u,var,video,wbr,text,acronym,address,big,dt,ins,small,strike,tt,pre,h1,h2,h3,h4,h5,h6` - -**Type**: `array` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) - -**Description**: - -List of tags (defaults to inline) that should not be reformatted (Supported by JS Beautify) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "unformatted": [ - "a", - "abbr", - "area", - "audio", - "b", - "bdi", - "bdo", - "br", - "button", - "canvas", - "cite", - "code", - "data", - "datalist", - "del", - "dfn", - "em", - "embed", - "i", - "iframe", - "img", - "input", - "ins", - "kbd", - "keygen", - "label", - "map", - "mark", - "math", - "meter", - "noscript", - "object", - "output", - "progress", - "q", - "ruby", - "s", - "samp", - "select", - "small", - "span", - "strong", - "sub", - "sup", - "svg", - "template", - "textarea", - "time", - "u", - "var", - "video", - "wbr", - "text", - "acronym", - "address", - "big", - "dt", - "ins", - "small", - "strike", - "tt", - "pre", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6" - ] - } -} -``` - -##### [Extra liners](#extra-liners) - -**Namespace**: `html` - -**Key**: `extra_liners` - -**Default**: `head,body,/html` - -**Type**: `array` - -**Supported Beautifiers**: [`JS Beautify`](#js-beautify) - -**Description**: - -List of tags (defaults to [head,body,/html] that should have an extra newline before them. (Supported by JS Beautify) - -**Example `.jsbeautifyrc` Configuration** - -```json -{ - "html": { - "extra_liners": [ - "head", - "body", - "/html" - ] - } -} -``` - ##### [E4x](#e4x) **Namespace**: `jsx` diff --git a/package.json b/package.json index 676b559..7f92498 100644 --- a/package.json +++ b/package.json @@ -303,7 +303,8 @@ "atom-beautify:beautify-language-tsx", "atom-beautify:beautify-language-verilog", "atom-beautify:beautify-language-vhdl", - "atom-beautify:beautify-language-gn" + "atom-beautify:beautify-language-gn", + "atom-beautify:beautify-language-blade" ], ".tree-view .file .name": [ "atom-beautify:beautify-file" @@ -447,7 +448,8 @@ "emacs verilog mode", "vhdl", "vhdl beautifier", - "gn" + "gn", + "blade" ], "devDependencies": { "codo": "^2.1.2", @@ -486,4 +488,4 @@ "prettydiff2" ] } -} +} \ No newline at end of file diff --git a/spec/beautify-languages-spec.coffee b/spec/beautify-languages-spec.coffee index 4310acd..bca9711 100644 --- a/spec/beautify-languages-spec.coffee +++ b/spec/beautify-languages-spec.coffee @@ -44,7 +44,7 @@ describe "BeautifyLanguages", -> # Activate all of the languages allLanguages = [ - "c", "clojure", "coffee-script", "css", "csharp", "d", + "blade", "c", "clojure", "coffee-script", "css", "csharp", "d", "gfm", "go", "html", "html-swig", "java", "javascript", "json", "less", "lua", "marko", "mustache", "objective-c", "perl", "php", "python", "ruby", "sass", "sql", diff --git a/src/options.json b/src/options.json index 458cd8b..60476a0 100644 --- a/src/options.json +++ b/src/options.json @@ -186,6 +186,327 @@ } } }, + "blade": { + "title": "Blade", + "type": "object", + "description": "Options for language Blade", + "collapsed": true, + "beautifiers": [ + "JS Beautify" + ], + "grammars": [ + "Blade" + ], + "extensions": [ + "blade.php" + ], + "properties": { + "indent_inner_html": { + "type": "boolean", + "default": false, + "description": "Indent and sections. (Supported by JS Beautify)", + "title": "Indent inner html", + "beautifiers": [ + "JS Beautify" + ], + "key": "indent_inner_html", + "language": { + "name": "HTML", + "namespace": "html" + } + }, + "indent_size": { + "type": "integer", + "default": null, + "minimum": 0, + "description": "Indentation size/length (Supported by JS Beautify)", + "title": "Indent size", + "beautifiers": [ + "JS Beautify" + ], + "key": "indent_size", + "language": { + "name": "HTML", + "namespace": "html" + } + }, + "indent_char": { + "type": "string", + "default": null, + "description": "Indentation character (Supported by JS Beautify)", + "title": "Indent char", + "beautifiers": [ + "JS Beautify" + ], + "key": "indent_char", + "language": { + "name": "HTML", + "namespace": "html" + } + }, + "brace_style": { + "type": "string", + "default": "collapse", + "enum": [ + "collapse", + "expand", + "end-expand", + "none" + ], + "description": "[collapse|expand|end-expand|none] (Supported by JS Beautify)", + "title": "Brace style", + "beautifiers": [ + "JS Beautify" + ], + "key": "brace_style", + "language": { + "name": "HTML", + "namespace": "html" + } + }, + "indent_scripts": { + "type": "string", + "default": "normal", + "enum": [ + "keep", + "separate", + "normal" + ], + "description": "[keep|separate|normal] (Supported by JS Beautify)", + "title": "Indent scripts", + "beautifiers": [ + "JS Beautify" + ], + "key": "indent_scripts", + "language": { + "name": "HTML", + "namespace": "html" + } + }, + "wrap_line_length": { + "type": "integer", + "default": 250, + "description": "Maximum characters per line (0 disables) (Supported by JS Beautify)", + "title": "Wrap line length", + "beautifiers": [ + "JS Beautify" + ], + "key": "wrap_line_length", + "language": { + "name": "HTML", + "namespace": "html" + } + }, + "wrap_attributes": { + "type": "string", + "default": "auto", + "enum": [ + "auto", + "force", + "force-aligned", + "force-expand-multiline" + ], + "description": "Wrap attributes to new lines [auto|force|force-aligned|force-expand-multiline] (Supported by JS Beautify)", + "title": "Wrap attributes", + "beautifiers": [ + "JS Beautify" + ], + "key": "wrap_attributes", + "language": { + "name": "HTML", + "namespace": "html" + } + }, + "wrap_attributes_indent_size": { + "type": "integer", + "default": null, + "minimum": 0, + "description": "Indent wrapped attributes to after N characters (Supported by JS Beautify)", + "title": "Wrap attributes indent size", + "beautifiers": [ + "JS Beautify" + ], + "key": "wrap_attributes_indent_size", + "language": { + "name": "HTML", + "namespace": "html" + } + }, + "preserve_newlines": { + "type": "boolean", + "default": true, + "description": "Preserve line-breaks (Supported by JS Beautify)", + "title": "Preserve newlines", + "beautifiers": [ + "JS Beautify" + ], + "key": "preserve_newlines", + "language": { + "name": "HTML", + "namespace": "html" + } + }, + "max_preserve_newlines": { + "type": "integer", + "default": 10, + "description": "Number of line-breaks to be preserved in one chunk (Supported by JS Beautify)", + "title": "Max preserve newlines", + "beautifiers": [ + "JS Beautify" + ], + "key": "max_preserve_newlines", + "language": { + "name": "HTML", + "namespace": "html" + } + }, + "unformatted": { + "type": "array", + "default": [ + "a", + "abbr", + "area", + "audio", + "b", + "bdi", + "bdo", + "br", + "button", + "canvas", + "cite", + "code", + "data", + "datalist", + "del", + "dfn", + "em", + "embed", + "i", + "iframe", + "img", + "input", + "ins", + "kbd", + "keygen", + "label", + "map", + "mark", + "math", + "meter", + "noscript", + "object", + "output", + "progress", + "q", + "ruby", + "s", + "samp", + "select", + "small", + "span", + "strong", + "sub", + "sup", + "svg", + "template", + "textarea", + "time", + "u", + "var", + "video", + "wbr", + "text", + "acronym", + "address", + "big", + "dt", + "ins", + "small", + "strike", + "tt", + "pre", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6" + ], + "items": { + "type": "string" + }, + "description": "List of tags (defaults to inline) that should not be reformatted (Supported by JS Beautify)", + "title": "Unformatted", + "beautifiers": [ + "JS Beautify" + ], + "key": "unformatted", + "language": { + "name": "HTML", + "namespace": "html" + } + }, + "end_with_newline": { + "type": "boolean", + "default": false, + "description": "End output with newline (Supported by JS Beautify)", + "title": "End with newline", + "beautifiers": [ + "JS Beautify" + ], + "key": "end_with_newline", + "language": { + "name": "HTML", + "namespace": "html" + } + }, + "extra_liners": { + "type": "array", + "default": [ + "head", + "body", + "/html" + ], + "items": { + "type": "string" + }, + "description": "List of tags (defaults to [head,body,/html] that should have an extra newline before them. (Supported by JS Beautify)", + "title": "Extra liners", + "beautifiers": [ + "JS Beautify" + ], + "key": "extra_liners", + "language": { + "name": "HTML", + "namespace": "html" + } + }, + "disabled": { + "title": "Disable Beautifying Language", + "order": -3, + "type": "boolean", + "default": false, + "description": "Disable Blade Beautification" + }, + "default_beautifier": { + "title": "Default Beautifier", + "order": -2, + "type": "string", + "default": "JS Beautify", + "description": "Default Beautifier to be used for Blade", + "enum": [ + "JS Beautify" + ] + }, + "beautify_on_save": { + "title": "Beautify On Save", + "order": -1, + "type": "boolean", + "default": false, + "description": "Automatically beautify Blade files on save" + } + } + }, "cs": { "title": "C#", "type": "object",