1.2.11 • Published 1 month ago

antlers-formatter v1.2.11

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

Antlers Formatter CLI

The Antlers formatter CLI is an opinionated formatting tool built on top of js-beautify, and is provided as a standalone version of the formatter that ships with the Visual Studio Code extension.

Installation

The command line Antlers formatter can be installed with npm using the following command:

npm install antlers-formatter -g

The format command accepts the following options:

OptionFlagDescription
file--fThe path to the template to format.
dir--dA directory path to format all Antlers files, recursively.
output--outAn optional file path where the formatted results will be saved. When specified, the file (or files in a directory) is not overwritten.
dump--ddWhen specified, no results are saved to disk. Formatted results are displayed within the terminal.
options--oAn optional file path to a JSON file containing Antlers formatting settings.

General usage:

antlersformat format --f="/path/to/file/to/format.antlers.html"

Antlers Formatting Settings

The default Antlers formatter settings look like this when saved as JSON:

{
    "htmlOptions": {},
    "formatFrontMatter": true,
    "insertSpaces": true,
    "maxStatementsPerLine": 3,
    "tabSize": 4,
    "formatExtensions": [
        ".antlers.html"
    ]
}
  • formatFrontMatter - Controls whether document Front Matter is formatted.
  • insertSpaces - Controls whether the Antlers formatter should insert spaces
  • maxStatementsPerLine - Suggests a maximum number of Antlers statements that should appear on a single line (i.e., {{ test; test += 3; test += 5; }})
  • tabSize - The number of spaces to use for indentation
  • formatExtensions - A list of file extensions that will be formatted when formatting a directory.

The htmlOptions object may be used to set the HTML formatting options used by the Antlers formatter. These settings follow the same rules as the default Visual Studio Code HTML Formatter. The formatter will do its best to respect these settings, but may be unable to under certain circumstances.

  • htmlOptions.indentEmptyLines
  • htmlOptions.wrapLineLength
  • htmlOptions.unformatted
  • htmlOptions.indentInnerHtml
  • htmlOptions.wrapAttributes
  • htmlOptions.wrapAttributesIndentSize
  • htmlOptions.preserveNewLines
  • htmlOptions.indentHandlebars
  • htmlOptions.endWithNewline
  • htmlOptions.extraLiners
  • htmlOptions.indentScripts
  • htmlOptions.unformattedContentDelimiter

Reporting Issues

If you come across an issue, or have a suggestion to improve Antlers Toolbox, feel free to create an issue on the project's GitHub repository here:

https://github.com/Stillat/vscode-antlers-language-server/issues

If you are looking to report a security vulnerability, please do not create an issue on the GitHub repository.

To report sensitive issues or a security vulnerability please email security@stillat.com with the relevant details.

Emails requesting information on bounties, etc. will not be responded to.

License

This formatter utility is open-sourced software licensed under the MIT license.

1.2.11

1 month ago

1.2.10

4 months ago

1.2.9

5 months ago

1.2.8

6 months ago

1.2.7

7 months ago

1.2.6

9 months ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.19

1 year ago

1.1.18

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.17

1 year ago

1.1.1

2 years ago

1.1.0

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.14

1 year ago

1.1.13

2 years ago

1.0.16

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago