Files
terraform-docs/docs/user-guide/configuration/formatter.md
Khosrow Moossavi 1ae5fd95ca Restructure configurations docs
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-09-13 18:07:21 -04:00

2.1 KiB

title, description, menu, weight, toc
title description menu weight toc
formatter formatter configuration
docs
parent
configuration
123 true

Since v0.10.0

The following options are supported out of the box by terraform-docs and can be used for FORMATTER_NAME:

  • asciidoc [reference]({{< ref "asciidoc" >}})
  • asciidoc document [reference]({{< ref "asciidoc-document" >}})
  • asciidoc table [reference]({{< ref "asciidoc-table" >}})
  • json [reference]({{< ref "json" >}})
  • markdown [reference]({{< ref "markdown" >}})
  • markdown document [reference]({{< ref "markdown-document" >}})
  • markdown table [reference]({{< ref "markdown-table" >}})
  • pretty [reference]({{< ref "pretty" >}})
  • tfvars hcl [reference]({{< ref "tfvars-hcl" >}})
  • tfvars json [reference]({{< ref "tfvars-json" >}})
  • toml [reference]({{< ref "toml" >}})
  • xml [reference]({{< ref "xml" >}})
  • yaml [reference]({{< ref "yaml" >}})

{{< alert type="info" >}} Short version of formatters can also be used:

  • adoc instead of asciidoc
  • md instead of markdown
  • doc instead of document
  • tbl instead of table {{< /alert >}}

{{< alert type="info" >}} You need to pass name of a plugin as formatter in order to be able to use the plugin. For example, if plugin binary file is called tfdocs-format-foo, formatter name must be set to foo. {{< /alert >}}

Options

Available options with their default values.

formatter: ""

{{< alert type="info" >}} formatter is required and cannot be empty in .terraform-docs.yml. {{< /alert >}}

Examples

Format as Markdown table:

formatter: "markdown table"

Format as Markdown document:

formatter: "md doc"

Format as AsciiDoc document:

formatter: "asciidoc document"

Format as tfdocs-format-myplugin:

formatter: "myplugin"