-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
250 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/target | ||
dprint_plugin/deployment/plugin.wasm | ||
docs/book |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[book] | ||
title = "Pretty YAML Documentation" | ||
authors = ["Pig Fang"] | ||
language = "en" | ||
|
||
[output.html] | ||
git-repository-url = "https://github.com/g-plane/pretty_yaml" | ||
edit-url-template = "https://github.com/g-plane/pretty_yaml/edit/main/docs/{path}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Summary | ||
|
||
- [Configuration](./config/README.md) | ||
- [printWidth](./config/print-width.md) | ||
- [indentWidth](./config/indent-width.md) | ||
- [lineBreak](./config/line-break.md) | ||
- [quotes](./config/quotes.md) | ||
- [trailingComma](./config/trailing-comma.md) | ||
- [formatComments](./config/format-comments.md) | ||
- [indentBlockSequenceInMap](./config/indent-block-sequence-in-map.md) | ||
- [braceSpacing](./config/brace-spacing.md) | ||
- [bracketSpacing](./config/bracket-spacing.md) | ||
- [dashSpacing](./config/dash-spacing.md) | ||
- [trimTrailingWhitespaces](./config/trim-trailing-whitespaces.md) | ||
- [trimTrailingZero](./config/trim-trailing-zero.md) | ||
- [ignoreCommentDirective](./config/ignore-comment-directive.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Configuration | ||
|
||
Options name in this page are in camel case. | ||
If you're using Pretty YAML as a Rust crate, please use snake case instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# `braceSpacing` | ||
|
||
Control whether whitespace should be inserted between braces or not. | ||
|
||
Default option is `true`. | ||
|
||
## Example for `false` | ||
|
||
```yaml | ||
{a: b} | ||
``` | ||
|
||
## Example for `true` | ||
|
||
```yaml | ||
{ a: b } | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# `bracketSpacing` | ||
|
||
Control whether whitespace should be inserted between brackets or not. | ||
|
||
Default option is `false`. | ||
|
||
## Example for `false` | ||
|
||
```yaml | ||
[a, b] | ||
``` | ||
|
||
## Example for `true` | ||
|
||
```yaml | ||
[ a, b ] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# `dashSpacing` | ||
|
||
Control the whitespace behavior of block compact map in block sequence value. | ||
This option is only effective when `indentWidth` is greater than 2. | ||
|
||
Possible options: | ||
|
||
- `"oneSpace"`: Insert only one space after `-`. | ||
- `"indent"`: Insert spaces to align indentation, respecting `indentWidth` option. | ||
|
||
Default option is `"oneSpace"`. | ||
|
||
The examples below assume `indentWidth` is `4`. | ||
|
||
## Example for `"oneSpace"` | ||
|
||
```yaml | ||
outer: | ||
- key1: value1 | ||
key2: value2 | ||
``` | ||
## Example for `"indent"` | ||
```yaml | ||
outer: | ||
- key1: value1 | ||
key2: value2 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# `formatComments` | ||
|
||
Control whether whitespace should be inserted at the beginning of comments or not. | ||
|
||
When this option is set to `false`, comments contain leading whitespace will still be kept as-is. | ||
|
||
Default option is `false`. | ||
|
||
## Example for `false` | ||
|
||
```yaml | ||
#comment | ||
``` | ||
|
||
## Example for `true` | ||
|
||
```yaml | ||
# comment | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# `ignoreCommentDirective` | ||
|
||
Text directive for ignoring formatting specific content. | ||
|
||
Default is `"pretty-yaml-ignore"`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# `indentBlockSequenceInMap` | ||
|
||
Control whether block sequence should be indented or not in a block map. | ||
|
||
Default option is `true`. | ||
|
||
## Example for `false` | ||
|
||
```yaml | ||
key: | ||
- item | ||
``` | ||
## Example for `true` | ||
|
||
```yaml | ||
key: | ||
- item | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# `indentWidth` | ||
|
||
Size of indentation. | ||
|
||
Default option is `2`. This can't be zero. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# `lineBreak` | ||
|
||
Specify use `\n` (LF) or `\r\n` (CRLF) for line break. | ||
|
||
Default option is `"lf"`. Possible options are `"lf"` and `"crlf"`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# `printWidth` | ||
|
||
The line width limitation that Pretty YAML should *(but not must)* avoid exceeding. Pretty YAML will try its best to keep line width less than this value, but it may exceed for some cases, for example, a very very long single word. | ||
|
||
Default option is `80`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# `quotes` | ||
|
||
Control the quotes. | ||
|
||
Possible options: | ||
|
||
- `"preferDouble"`: Use double quotes as possible. However if there're escaped characters in strings, quotes will be kept as-is. | ||
- `"preferSingle"`: Use single quotes as possible. However if there're `\` char or `"` char in strings, quotes will be kept as-is. | ||
|
||
Default option is `"preferDouble"`. | ||
We recommend to use double quotes because behavior in single quoted scalars is counter-intuitive. | ||
|
||
## Example for `"preferDouble"` | ||
|
||
```yaml | ||
- "text" | ||
``` | ||
## Example for `"preferSingle"` | ||
```yaml | ||
- 'text' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# `trailingComma` | ||
|
||
Control whether trailing comma should be inserted or not. | ||
|
||
Default option is `true`. | ||
|
||
## Example for `false` | ||
|
||
```yaml | ||
- [ | ||
a | ||
] | ||
- { | ||
a: b | ||
} | ||
``` | ||
|
||
## Example for `true` | ||
|
||
```yaml | ||
- [ | ||
a, | ||
] | ||
- { | ||
a: b, | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# `trimTrailingWhitespaces` | ||
|
||
Control whether trailing whitespaces should be trimmed or not. | ||
|
||
Default option is `true`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# `trimTrailingZero` | ||
|
||
Control whether trailing zeros should be removed or not. | ||
|
||
Numbers without trailing zeros will still be kept as-is. | ||
|
||
Default option is `false`. | ||
|
||
## Example for `false` | ||
|
||
```yaml | ||
- 1.20 | ||
- 1.0 | ||
``` | ||
## Example for `true` | ||
|
||
```yaml | ||
- 1.2 | ||
- 1 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters