Skip to content

Commit

Permalink
Merge pull request #2085 from raizapw19/fix-language-names
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
bitwiseman committed Aug 6, 2022
2 parents fc2a584 + cbdc4a8 commit 26039eb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Expand Up @@ -26,7 +26,7 @@ If you are interested, please take a look at the [CONTRIBUTING.md](https://githu

# Installation

You can install the beautifier for node.js or python.
You can install the beautifier for Node.js or Python.

## Node.js JavaScript

Expand Down Expand Up @@ -85,7 +85,7 @@ $ pip install cssbeautifier
```

# Usage
You can beautify javascript using JS Beautifier in your web browser, or on the command-line using node.js or python.
You can beautify JavaScript using JS Beautifier in your web browser, or on the command-line using Node.js or Python.

## Web Browser
Open [beautifier.io](https://beautifier.io/). Options are available via the UI.
Expand All @@ -101,7 +101,7 @@ When installed globally, the beautifier provides an executable `js-beautify` scr
$ js-beautify foo.js
```

To use `js-beautify` as a `node` library (after install locally), import and call the appropriate beautifier method for javascript (js), css, or html. All three method signatures are `beautify(code, options)`. `code` is the string of code to be beautified. options is an object with the settings you would like used to beautify the code.
To use `js-beautify` as a `node` library (after install locally), import and call the appropriate beautifier method for JavaScript (JS), CSS, or HTML. All three method signatures are `beautify(code, options)`. `code` is the string of code to be beautified. options is an object with the settings you would like used to beautify the code.

The configuration option names are the same as the CLI names but with underscores instead of dashes. For example, `--indent-size 2 --space-in-empty-paren` would be `{ indent_size: 2, space_in_empty_paren: true }`.

Expand Down Expand Up @@ -130,7 +130,7 @@ To use `jsbeautifier` as a library is simple:

```python
import jsbeautifier
res = jsbeautifier.beautify('your javascript string')
res = jsbeautifier.beautify('your JavaScript string')
res = jsbeautifier.beautify_file('some_file.js')
```

Expand All @@ -140,7 +140,7 @@ res = jsbeautifier.beautify_file('some_file.js')
opts = jsbeautifier.default_options()
opts.indent_size = 2
opts.space_in_empty_paren = True
res = jsbeautifier.beautify('some javascript', opts)
res = jsbeautifier.beautify('some JavaScript', opts)
```

The configuration option names are the same as the CLI names but with underscores instead of dashes. The example above would be set on the command-line as `--indent-size 2 --space-in-empty-paren`.
Expand Down Expand Up @@ -188,7 +188,7 @@ Beautifier Options:
-C, --comma-first Put commas at the beginning of new line instead of end
-O, --operator-position Set operator position (before-newline|after-newline|preserve-newline) [before-newline]
--indent-empty-lines Keep indentation on empty lines
--templating List of templating languages (auto,django,erb,handlebars,php,smarty) ["auto"] auto = none in JavaScript, all in html
--templating List of templating languages (auto,django,erb,handlebars,php,smarty) ["auto"] auto = none in JavaScript, all in HTML
```

Which correspond to the underscored option keys for both library interfaces
Expand Down Expand Up @@ -251,7 +251,7 @@ Configuration sources provided earlier in this stack will override later ones.

The settings are a shallow tree whose values are inherited for all languages, but
can be overridden. This works for settings passed directly to the API in either implementation.
In the Javascript implementation, settings loaded from a config file, such as .jsbeautifyrc, can also use inheritance/overriding.
In the JavaScript implementation, settings loaded from a config file, such as .jsbeautifyrc, can also use inheritance/overriding.

Below is an example configuration tree showing all the supported locations
for language override nodes. We'll use `indent_size` to discuss how this configuration would behave, but any number of settings can be inherited or overridden:
Expand Down

0 comments on commit 26039eb

Please sign in to comment.