From bf91dd2d7a4979fa35ec696ce46a2245862d659b Mon Sep 17 00:00:00 2001 From: s4l1h Date: Fri, 13 Jan 2017 01:48:16 +0300 Subject: [PATCH] Golang template support added doc. --- docs/options.md | 177 ++++++++++++++++++++++++++++++++++++ package.json | 3 +- src/languages/gohtml.coffee | 1 + 3 files changed, 180 insertions(+), 1 deletion(-) diff --git a/docs/options.md b/docs/options.md index 6bb63b3..37a590a 100644 --- a/docs/options.md +++ b/docs/options.md @@ -3685,6 +3685,183 @@ Automatically beautify Go files on save 2. Go into *Packages* and search for "*Atom Beautify*" package. 3. Find the option "*Beautify On Save*" and change it to your desired configuration. +#### [Golang Template](#golang-template) + +**Supported Beautifiers**: [`Pretty Diff`](#pretty-diff) + +| Option | Pretty Diff | +| --- | --- | +| `disabled` | :white_check_mark: | +| `default_beautifier` | :white_check_mark: | +| `beautify_on_save` | :white_check_mark: | +| `indent_char` | :white_check_mark: | +| `indent_size` | :white_check_mark: | +| `preserve_newlines` | :white_check_mark: | +| `wrap_line_length` | :white_check_mark: | + +**Description**: + +Options for language Golang Template + +##### [Disable Beautifying Language](#disable-beautifying-language) + +**Important**: This option is only configurable from within Atom Beautify's setting panel. + +**Type**: `boolean` + +**Description**: + +Disable Golang Template 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**: `Pretty Diff` + +**Type**: `string` + +**Enum**: `Pretty Diff` + +**Description**: + +Default Beautifier to be used for Golang Template + +**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 Golang Template 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. + +##### [Indent char](#indent-char) + +**Namespace**: `html` + +**Key**: `indent_char` + +**Default**: ` ` + +**Type**: `string` + +**Supported Beautifiers**: [`Pretty Diff`](#pretty-diff) + +**Description**: + +Indentation character (Supported by Pretty Diff) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "indent_char": " " + } +} +``` + +##### [Indent size](#indent-size) + +**Namespace**: `html` + +**Key**: `indent_size` + +**Default**: `4` + +**Type**: `integer` + +**Supported Beautifiers**: [`Pretty Diff`](#pretty-diff) + +**Description**: + +Indentation size/length (Supported by Pretty Diff) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "indent_size": 4 + } +} +``` + +##### [Preserve newlines](#preserve-newlines) + +**Namespace**: `html` + +**Key**: `preserve_newlines` + +**Default**: `true` + +**Type**: `boolean` + +**Supported Beautifiers**: [`Pretty Diff`](#pretty-diff) + +**Description**: + +Preserve line-breaks (Supported by 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**: [`Pretty Diff`](#pretty-diff) + +**Description**: + +Maximum characters per line (0 disables) (Supported by Pretty Diff) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "html": { + "wrap_line_length": 250 + } +} +``` + #### [Handlebars](#handlebars) **Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff) diff --git a/package.json b/package.json index a9f5bad..66b3df3 100644 --- a/package.json +++ b/package.json @@ -291,7 +291,8 @@ "bash", "beautysh", "glsl", - "hh_format" + "hh_format", + "golang template" ], "devDependencies": { "coffeelint": "^1.10.1", diff --git a/src/languages/gohtml.coffee b/src/languages/gohtml.coffee index c237043..76fdf67 100644 --- a/src/languages/gohtml.coffee +++ b/src/languages/gohtml.coffee @@ -3,6 +3,7 @@ module.exports = { name: "Golang Template" description: "Comma-Separated Values" namespace: "gohtml" + fallback: ["html"] ### Supported Grammars