From 888bf9e1d170746ae91ec9338e9e13681bfa1502 Mon Sep 17 00:00:00 2001 From: Khosrow Moossavi Date: Thu, 16 Jan 2020 15:05:04 -0500 Subject: [PATCH] fix: Do not wrap multiline blocks in table with (#164) --- internal/pkg/print/markdown/markdown.go | 2 +- .../markdown/table/testdata/table-EscapeCharacters.golden | 8 ++++---- .../table/testdata/table-IndentationAboveAllowed.golden | 8 ++++---- .../table/testdata/table-IndentationBellowAllowed.golden | 8 ++++---- .../table/testdata/table-IndentationOfFour.golden | 8 ++++---- .../print/markdown/table/testdata/table-NoHeader.golden | 8 ++++---- .../print/markdown/table/testdata/table-NoOutputs.golden | 8 ++++---- .../markdown/table/testdata/table-NoProviders.golden | 8 ++++---- .../print/markdown/table/testdata/table-OnlyInputs.golden | 8 ++++---- .../print/markdown/table/testdata/table-SortByName.golden | 8 ++++---- .../markdown/table/testdata/table-SortByRequired.golden | 8 ++++---- .../markdown/table/testdata/table-WithRequired.golden | 8 ++++---- internal/pkg/print/markdown/table/testdata/table.golden | 8 ++++---- 13 files changed, 49 insertions(+), 49 deletions(-) diff --git a/internal/pkg/print/markdown/markdown.go b/internal/pkg/print/markdown/markdown.go index a07349f..5874d50 100644 --- a/internal/pkg/print/markdown/markdown.go +++ b/internal/pkg/print/markdown/markdown.go @@ -77,7 +77,7 @@ func SanitizeItemForTable(s string, settings *print.Settings) string { return segment }, func(segment string) string { - segment = fmt.Sprintf("
%s
", strings.Replace(strings.Replace(segment, "\n", "
", -1), "\r", "", -1)) + segment = fmt.Sprintf("
%s
", strings.Replace(strings.Replace(segment, "\n", "
", -1), "\r", "", -1)) return segment }, ) diff --git a/internal/pkg/print/markdown/table/testdata/table-EscapeCharacters.golden b/internal/pkg/print/markdown/table/testdata/table-EscapeCharacters.golden index 10feec5..660d90e 100644 --- a/internal/pkg/print/markdown/table/testdata/table-EscapeCharacters.golden +++ b/internal/pkg/print/markdown/table/testdata/table-EscapeCharacters.golden @@ -38,14 +38,14 @@ module "foo_bar" { | string-1 | It's string number one. | `string` | `"bar"` | | map-3 | n/a | `map` | `{}` | | map-2 | It's map number two. | `map` | n/a | -| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| +| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| | list-3 | n/a | `list` | `[]` | | list-2 | It's list number two. | `list` | n/a | -| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| +| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| | input\_with\_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| -| long\_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| +| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| +| long\_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| | no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE\_WITH\_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | ## Outputs diff --git a/internal/pkg/print/markdown/table/testdata/table-IndentationAboveAllowed.golden b/internal/pkg/print/markdown/table/testdata/table-IndentationAboveAllowed.golden index 28d1238..83ca75c 100644 --- a/internal/pkg/print/markdown/table/testdata/table-IndentationAboveAllowed.golden +++ b/internal/pkg/print/markdown/table/testdata/table-IndentationAboveAllowed.golden @@ -38,14 +38,14 @@ module "foo_bar" { | string-1 | It's string number one. | `string` | `"bar"` | | map-3 | n/a | `map` | `{}` | | map-2 | It's map number two. | `map` | n/a | -| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| +| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| | list-3 | n/a | `list` | `[]` | | list-2 | It's list number two. | `list` | n/a | -| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| +| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| | input_with_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| -| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| +| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| +| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| | no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | ## Outputs diff --git a/internal/pkg/print/markdown/table/testdata/table-IndentationBellowAllowed.golden b/internal/pkg/print/markdown/table/testdata/table-IndentationBellowAllowed.golden index 28d1238..83ca75c 100644 --- a/internal/pkg/print/markdown/table/testdata/table-IndentationBellowAllowed.golden +++ b/internal/pkg/print/markdown/table/testdata/table-IndentationBellowAllowed.golden @@ -38,14 +38,14 @@ module "foo_bar" { | string-1 | It's string number one. | `string` | `"bar"` | | map-3 | n/a | `map` | `{}` | | map-2 | It's map number two. | `map` | n/a | -| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| +| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| | list-3 | n/a | `list` | `[]` | | list-2 | It's list number two. | `list` | n/a | -| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| +| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| | input_with_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| -| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| +| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| +| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| | no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | ## Outputs diff --git a/internal/pkg/print/markdown/table/testdata/table-IndentationOfFour.golden b/internal/pkg/print/markdown/table/testdata/table-IndentationOfFour.golden index aeedd84..aa0b665 100644 --- a/internal/pkg/print/markdown/table/testdata/table-IndentationOfFour.golden +++ b/internal/pkg/print/markdown/table/testdata/table-IndentationOfFour.golden @@ -38,14 +38,14 @@ module "foo_bar" { | string-1 | It's string number one. | `string` | `"bar"` | | map-3 | n/a | `map` | `{}` | | map-2 | It's map number two. | `map` | n/a | -| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| +| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| | list-3 | n/a | `list` | `[]` | | list-2 | It's list number two. | `list` | n/a | -| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| +| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| | input_with_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| -| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| +| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| +| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| | no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | #### Outputs diff --git a/internal/pkg/print/markdown/table/testdata/table-NoHeader.golden b/internal/pkg/print/markdown/table/testdata/table-NoHeader.golden index 3f3e970..ed63efa 100644 --- a/internal/pkg/print/markdown/table/testdata/table-NoHeader.golden +++ b/internal/pkg/print/markdown/table/testdata/table-NoHeader.golden @@ -17,14 +17,14 @@ | string-1 | It's string number one. | `string` | `"bar"` | | map-3 | n/a | `map` | `{}` | | map-2 | It's map number two. | `map` | n/a | -| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| +| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| | list-3 | n/a | `list` | `[]` | | list-2 | It's list number two. | `list` | n/a | -| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| +| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| | input_with_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| -| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| +| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| +| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| | no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | ## Outputs diff --git a/internal/pkg/print/markdown/table/testdata/table-NoOutputs.golden b/internal/pkg/print/markdown/table/testdata/table-NoOutputs.golden index fb7d534..ede589f 100644 --- a/internal/pkg/print/markdown/table/testdata/table-NoOutputs.golden +++ b/internal/pkg/print/markdown/table/testdata/table-NoOutputs.golden @@ -38,12 +38,12 @@ module "foo_bar" { | string-1 | It's string number one. | `string` | `"bar"` | | map-3 | n/a | `map` | `{}` | | map-2 | It's map number two. | `map` | n/a | -| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| +| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| | list-3 | n/a | `list` | `[]` | | list-2 | It's list number two. | `list` | n/a | -| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| +| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| | input_with_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| -| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| +| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| +| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| | no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | diff --git a/internal/pkg/print/markdown/table/testdata/table-NoProviders.golden b/internal/pkg/print/markdown/table/testdata/table-NoProviders.golden index b68dad8..ccadfdb 100644 --- a/internal/pkg/print/markdown/table/testdata/table-NoProviders.golden +++ b/internal/pkg/print/markdown/table/testdata/table-NoProviders.golden @@ -29,14 +29,14 @@ module "foo_bar" { | string-1 | It's string number one. | `string` | `"bar"` | | map-3 | n/a | `map` | `{}` | | map-2 | It's map number two. | `map` | n/a | -| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| +| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| | list-3 | n/a | `list` | `[]` | | list-2 | It's list number two. | `list` | n/a | -| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| +| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| | input_with_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| -| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| +| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| +| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| | no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | ## Outputs diff --git a/internal/pkg/print/markdown/table/testdata/table-OnlyInputs.golden b/internal/pkg/print/markdown/table/testdata/table-OnlyInputs.golden index ada972a..c511e5e 100644 --- a/internal/pkg/print/markdown/table/testdata/table-OnlyInputs.golden +++ b/internal/pkg/print/markdown/table/testdata/table-OnlyInputs.golden @@ -8,12 +8,12 @@ | string-1 | It's string number one. | `string` | `"bar"` | | map-3 | n/a | `map` | `{}` | | map-2 | It's map number two. | `map` | n/a | -| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| +| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| | list-3 | n/a | `list` | `[]` | | list-2 | It's list number two. | `list` | n/a | -| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| +| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| | input_with_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| -| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| +| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| +| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| | no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | diff --git a/internal/pkg/print/markdown/table/testdata/table-SortByName.golden b/internal/pkg/print/markdown/table/testdata/table-SortByName.golden index 7677753..d566f4a 100644 --- a/internal/pkg/print/markdown/table/testdata/table-SortByName.golden +++ b/internal/pkg/print/markdown/table/testdata/table-SortByName.golden @@ -32,14 +32,14 @@ module "foo_bar" { | Name | Description | Type | Default | |------|-------------|------|---------| -| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| +| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | | input_with_underscores | A variable with underscores. | `any` | n/a | -| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| +| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| | list-2 | It's list number two. | `list` | n/a | | list-3 | n/a | `list` | `[]` | -| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| -| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| +| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| +| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| | map-2 | It's map number two. | `map` | n/a | | map-3 | n/a | `map` | `{}` | | no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | diff --git a/internal/pkg/print/markdown/table/testdata/table-SortByRequired.golden b/internal/pkg/print/markdown/table/testdata/table-SortByRequired.golden index 2d2c876..bd4563f 100644 --- a/internal/pkg/print/markdown/table/testdata/table-SortByRequired.golden +++ b/internal/pkg/print/markdown/table/testdata/table-SortByRequired.golden @@ -37,12 +37,12 @@ module "foo_bar" { | map-2 | It's map number two. | `map` | n/a | | string-2 | It's string number two. | `string` | n/a | | unquoted | n/a | `any` | n/a | -| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| +| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| +| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| | list-3 | n/a | `list` | `[]` | -| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| -| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| +| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| +| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| | map-3 | n/a | `map` | `{}` | | no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | | string-1 | It's string number one. | `string` | `"bar"` | diff --git a/internal/pkg/print/markdown/table/testdata/table-WithRequired.golden b/internal/pkg/print/markdown/table/testdata/table-WithRequired.golden index d541421..5bd5776 100644 --- a/internal/pkg/print/markdown/table/testdata/table-WithRequired.golden +++ b/internal/pkg/print/markdown/table/testdata/table-WithRequired.golden @@ -38,14 +38,14 @@ module "foo_bar" { | string-1 | It's string number one. | `string` | `"bar"` | no | | map-3 | n/a | `map` | `{}` | no | | map-2 | It's map number two. | `map` | n/a | yes | -| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| no | +| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| no | | list-3 | n/a | `list` | `[]` | no | | list-2 | It's list number two. | `list` | n/a | yes | -| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| no | +| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| no | | input_with_underscores | A variable with underscores. | `any` | n/a | yes | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | no | -| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| no | -| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| no | +| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| no | +| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| no | | no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | no | ## Outputs diff --git a/internal/pkg/print/markdown/table/testdata/table.golden b/internal/pkg/print/markdown/table/testdata/table.golden index 28d1238..83ca75c 100644 --- a/internal/pkg/print/markdown/table/testdata/table.golden +++ b/internal/pkg/print/markdown/table/testdata/table.golden @@ -38,14 +38,14 @@ module "foo_bar" { | string-1 | It's string number one. | `string` | `"bar"` | | map-3 | n/a | `map` | `{}` | | map-2 | It's map number two. | `map` | n/a | -| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| +| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| | list-3 | n/a | `list` | `[]` | | list-2 | It's list number two. | `list` | n/a | -| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| +| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| | input_with_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| -| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| +| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| +| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| | no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | ## Outputs