Skip to content

Commit

Permalink
docs: Document defaultStringType option more explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
eemeli committed May 18, 2022
1 parent c80d4c2 commit 5050494
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions docs/03_options.md
Expand Up @@ -146,22 +146,22 @@ The `doc.toString()` method may be called with additional options to control the

Used by: `stringify()` and `doc.toString()`

| Name | Type | Default | Description |
| ------------------------------ | -------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| blockQuote | `boolean ⎮ 'folded' ⎮ 'literal'` | `true` | Use block quote styles for scalar values where applicable. Set to `false` to disable block quotes completely. |
| collectionStyle | `'any' ⎮ 'block' ⎮ 'flow'` | `'any'` | Enforce `'block'` or `'flow'` style on maps and sequences. By default, allows each collection to set its own `flow: boolean` property. |
| commentString | `(comment: string) => string` | | Output should be valid for the current schema. By default, empty comment lines are left empty, lines consisting of a single space are replaced by `#`, and all other lines are prefixed with a `#`. |
| defaultKeyType | `Typenull` | `null` | If not `null`, overrides `defaultStringType` for implicit key values. |
| defaultStringType | `Type` | `'PLAIN'` | The default type of string literal used to stringify values. |
| directives | `boolean ⎮ null` | `null` | Include directives in the output. If `true`, at least the document-start marker `---` is always included. If `false`, no directives or marker is ever included. If `null`, directives and marker may be included if required. |
| doubleQuotedAsJSON | `boolean` | `false` | Restrict double-quoted strings to use JSON-compatible syntax. |
| doubleQuotedMinMultiLineLength | `number` | `40` | Minimum length for double-quoted strings to use multiple lines to represent the value. |
| falseStr | `string` | `'false'` | String representation for `false` values. |
| indent | `number` | `2` | The number of spaces to use when indenting code. Should be a strictly positive integer. |
| indentSeq | `boolean` | `true` | Whether block sequences should be indented. |
| lineWidth | `number` | `80` | Maximum line width (set to `0` to disable folding). This is a soft limit, as only double-quoted semantics allow for inserting a line break in the middle of a word. |
| minContentWidth | `number` | `20` | Minimum line width for highly-indented content (set to `0` to disable). |
| nullStr | `string` | `'null'` | String representation for `null` values. |
| simpleKeys | `boolean` | `false` | Require keys to be scalars and always use implicit rather than explicit notation. |
| singleQuote | `boolean ⎮ null` | `null` | Use 'single quote' rather than "double quote" where applicable. Set to `false` to disable single quotes completely. |
| trueStr | `string` | `'true'` | String representation for `true` values. |
| Name | Type | Default | Description |
| ------------------------------ | ----------------------------------------------------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| blockQuote | `boolean ⎮ 'folded' ⎮ 'literal'` | `true` | Use block quote styles for scalar values where applicable. Set to `false` to disable block quotes completely. |
| collectionStyle | `'any' ⎮ 'block' ⎮ 'flow'` | `'any'` | Enforce `'block'` or `'flow'` style on maps and sequences. By default, allows each collection to set its own `flow: boolean` property. |
| commentString | `(comment: string) => string` | | Output should be valid for the current schema. By default, empty comment lines are left empty, lines consisting of a single space are replaced by `#`, and all other lines are prefixed with a `#`. |
| defaultKeyType | `'BLOCK_FOLDED''BLOCK_LITERAL' ⎮` `'QUOTE_DOUBLE' ⎮ 'QUOTE_SINGLE' ⎮` `'PLAIN' ⎮ null` | `null` | If not `null`, overrides `defaultStringType` for implicit key values. |
| defaultStringType | `'BLOCK_FOLDED' ⎮ 'BLOCK_LITERAL' ⎮` `'QUOTE_DOUBLE' ⎮ 'QUOTE_SINGLE' ⎮` `'PLAIN'` | `'PLAIN'` | The default type of string literal used to stringify values. |
| directives | `boolean ⎮ null` | `null` | Include directives in the output. If `true`, at least the document-start marker `---` is always included. If `false`, no directives or marker is ever included. If `null`, directives and marker may be included if required. |
| doubleQuotedAsJSON | `boolean` | `false` | Restrict double-quoted strings to use JSON-compatible syntax. |
| doubleQuotedMinMultiLineLength | `number` | `40` | Minimum length for double-quoted strings to use multiple lines to represent the value. |
| falseStr | `string` | `'false'` | String representation for `false` values. |
| indent | `number` | `2` | The number of spaces to use when indenting code. Should be a strictly positive integer. |
| indentSeq | `boolean` | `true` | Whether block sequences should be indented. |
| lineWidth | `number` | `80` | Maximum line width (set to `0` to disable folding). This is a soft limit, as only double-quoted semantics allow for inserting a line break in the middle of a word. |
| minContentWidth | `number` | `20` | Minimum line width for highly-indented content (set to `0` to disable). |
| nullStr | `string` | `'null'` | String representation for `null` values. |
| simpleKeys | `boolean` | `false` | Require keys to be scalars and always use implicit rather than explicit notation. |
| singleQuote | `boolean ⎮ null` | `null` | Use 'single quote' rather than "double quote" where applicable. Set to `false` to disable single quotes completely. |
| trueStr | `string` | `'true'` | String representation for `true` values. |

0 comments on commit 5050494

Please sign in to comment.