Reformat the first version info in the option docs (#5604)

* Reformat the first version info in the option docs

* Make the italic text actually italic

* Update new options; reword the filepath docs
master
Jed Fox 2018-12-07 13:16:31 -05:00 committed by GitHub
parent 7c1758de86
commit b878a54e6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 24 deletions

View File

@ -141,7 +141,7 @@ Valid options:
## Arrow Function Parentheses
_available in v1.9.0+_
_First available in v1.9.0_
Include parentheses around a sole arrow function parameter.
@ -182,22 +182,22 @@ Valid options:
- `"babylon"` (via [@babel/parser](https://github.com/babel/babel/tree/master/packages/babel-parser))
- `"flow"` (via [flow-parser](https://github.com/facebook/flow/tree/master/src/parser))
- `"typescript"` (via [typescript-estree](https://github.com/JamesHenry/typescript-estree)) _Since v1.4.0_
- `"css"` (via [postcss-scss](https://github.com/postcss/postcss-scss) and [postcss-less](https://github.com/shellscape/postcss-less), autodetects which to use) _Since v1.7.1_
- `"scss"` (same parsers as `"css"`, prefers postcss-scss) _Since v1.7.1_
- `"less"` (same parsers as `"css"`, prefers postcss-less) _Since v1.7.1_
- `"json"` (via [@babel/parser parseExpression](https://babeljs.io/docs/en/next/babel-parser.html#babelparserparseexpressioncode-options)) _Since v1.5.0_
- `"json5"` (same parser as `"json"`, but outputs as [json5](https://json5.org/)) _Since v1.13.0_
- `"json-stringify"` (same parser as `"json"`, but outputs like `JSON.stringify`) _Since v1.13.0_
- `"graphql"` (via [graphql/language](https://github.com/graphql/graphql-js/tree/master/src/language)) _Since v1.5.0_
- `"markdown"` (via [remark-parse](https://github.com/wooorm/remark/tree/master/packages/remark-parse)) _Since v1.8.0_
- `"mdx"` (via [remark-parse](https://github.com/wooorm/remark/tree/master/packages/remark-parse) and [@mdx-js/mdx](https://github.com/mdx-js/mdx/tree/master/packages/mdx)) _Since v1.15.0_
- `"html"` (via [angular-html-parser](https://github.com/ikatyang/angular-html-parser/tree/master/packages/angular-html-parser)) _Since 1.15.0_
- `"vue"` (same parser as `"html"`, but also formats vue-specific syntax) _Since 1.10.0_
- `"angular"` (same parser as `"html"`, but also formats angular-specific syntax via [angular-estree-parser](https://github.com/ikatyang/angular-estree-parser)) _Since 1.15.0_
- `"yaml"` (via [yaml](https://github.com/eemeli/yaml) and [yaml-unist-parser](https://github.com/ikatyang/yaml-unist-parser)) _Since 1.14.0_
- `"typescript"` (via [typescript-estree](https://github.com/JamesHenry/typescript-estree)) _First available in v1.4.0_
- `"css"` (via [postcss-scss](https://github.com/postcss/postcss-scss) and [postcss-less](https://github.com/shellscape/postcss-less), autodetects which to use) _First available in v1.7.1_
- `"scss"` (same parsers as `"css"`, prefers postcss-scss) _First available in v1.7.1_
- `"less"` (same parsers as `"css"`, prefers postcss-less) _First available in v1.7.1_
- `"json"` (via [@babel/parser parseExpression](https://babeljs.io/docs/en/next/babel-parser.html#babelparserparseexpressioncode-options)) _First available in v1.5.0_
- `"json5"` (same parser as `"json"`, but outputs as [json5](https://json5.org/)) _First available in v1.13.0_
- `"json-stringify"` (same parser as `"json"`, but outputs like `JSON.stringify`) _First available in v1.13.0_
- `"graphql"` (via [graphql/language](https://github.com/graphql/graphql-js/tree/master/src/language)) _First available in v1.5.0_
- `"markdown"` (via [remark-parse](https://github.com/wooorm/remark/tree/master/packages/remark-parse)) _First available in v1.8.0_
- `"mdx"` (via [remark-parse](https://github.com/wooorm/remark/tree/master/packages/remark-parse) and [@mdx-js/mdx](https://github.com/mdx-js/mdx/tree/master/packages/mdx)) _First available in v1.15.0_
- `"html"` (via [angular-html-parser](https://github.com/ikatyang/angular-html-parser/tree/master/packages/angular-html-parser)) _First available in 1.15.0_
- `"vue"` (same parser as `"html"`, but also formats vue-specific syntax) _First available in 1.10.0_
- `"angular"` (same parser as `"html"`, but also formats angular-specific syntax via [angular-estree-parser](https://github.com/ikatyang/angular-estree-parser)) _First available in 1.15.0_
- `"yaml"` (via [yaml](https://github.com/eemeli/yaml) and [yaml-unist-parser](https://github.com/ikatyang/yaml-unist-parser)) _First available in 1.14.0_
[Custom parsers](api.md#custom-parser-api) are also supported. _Since v1.5.0_
[Custom parsers](api.md#custom-parser-api) are also supported. _First available in v1.5.0_
| Default | CLI Override | API Override |
| ------- | ----------------------------------------------- | ---------------------------------------------------------- |
@ -205,9 +205,11 @@ Valid options:
Note: the default value was `"babylon"` until v1.13.0.
<a name="filepath"></a>
## File Path
Specify the input filepath. This will be used to do parser inference.
Specify the file name to use to infer which parser to use.
For example, the following will use the CSS parser:
@ -221,7 +223,7 @@ cat foo | prettier --stdin-filepath foo.css
## Require pragma
_available in v1.7.0+_
_First available in v1.7.0_
Prettier can restrict itself to only format files that contain a special comment, called a pragma, at the top of the file. This is very useful when gradually transitioning large, unformatted codebases to prettier.
@ -247,7 +249,7 @@ or
## Insert Pragma
_available in v1.8.0+_
_First available in v1.8.0_
Prettier can insert a special @format marker at the top of files specifying that the file has been formatted with prettier. This works well when used in tandem with the `--require-pragma` option. If there is already a docblock at the top of the file then this option will add a newline to it with the @format marker.
@ -257,7 +259,7 @@ Prettier can insert a special @format marker at the top of files specifying that
## Prose Wrap
_available in v1.8.2+_
_First available in v1.8.2_
By default, Prettier will wrap markdown text as-is since some services use a linebreak-sensitive renderer, e.g. GitHub comment and BitBucket. In some cases you may want to rely on editor/viewer soft wrapping instead, so this option allows you to opt out with `"never"`.
@ -265,7 +267,7 @@ Valid options:
- `"always"` - Wrap prose if it exceeds the print width.
- `"never"` - Do not wrap prose.
- `"preserve"` - Wrap prose as-is. _available in v1.9.0+_
- `"preserve"` - Wrap prose as-is. _First available in v1.9.0_
| Default | CLI Override | API Override |
| ------------ | ----------------------------------------------------------- | ----------------------------------------------------------- |
@ -273,7 +275,7 @@ Valid options:
## HTML Whitespace Sensitivity
_available in v1.15.0+_
_First available in v1.15.0_
Specify the global whitespace sensitivity for HTML files, see [whitespace-sensitive formatting] for more info.
@ -291,7 +293,7 @@ Valid options:
## End of Line
_available in 1.15.0+_
_First available in 1.15.0_
For historical reasons, there exist two commonly used flavors of line endings in text files. That is `\n` (or `LF` for _Line Feed_) and `\r\n` (or `CRLF` for _Carriage Return + Line Feed_).
The former is common on Linux and macOS, while the latter is prevalent on Windows.

View File

@ -5,6 +5,10 @@ html body {
overflow-x: hidden;
}
em {
font-style: italic;
}
.mainContainer .wrapper a:hover,
.mainContainer .wrapper a:focus,
.inner .projectIntro a:hover,