title | description | menu | weight | toc | ||||
---|---|---|---|---|---|---|---|---|
sort |
sort configuration |
|
130 |
true |
Since v0.10.0
To enable sorting of elements sort.enabled
can be used. This will indicate
sorting is enabled or not, but consecutively type of sorting can also be specified
with sort.by
. The following sort types are supported:
name
(default): name of itemsrequired
: by name of inputs AND show required ones firsttype
: type of inputs
Available options with their default values.
sort:
enabled: true
by: name
{{< alert type="warning" >}}
As of v0.13.0
, sort.by
is converted from list
to string
.
{{< /alert >}}
The following error is an indicator that .terraform-docs.yml
still uses
list for sort.by
.
Error: unable to decode config, 1 error(s) decoding:
* 'sort.by' expected type 'string', got unconvertible type '[]interface {}'
Disable sorting:
sort:
enabled: false
Sort by name (terraform-docs >= v0.13.0
):
sort:
enabled: true
by: name
Sort by required (terraform-docs < v0.13.0
):
sort:
enabled: true
by:
- required