mirror of
https://github.com/terraform-docs/terraform-docs.git
synced 2026-03-27 12:58:35 +07:00
Save generated content directly into a file
There are two modes for saving into file:
- inject: partially replace the target file with generated output
- replace: completely replace the target file with generated output
The output generated by formatters (markdown, asciidoc, etc) will be
inserted into a template before getting saved into the file. This
template can be customized with '--output-template' CLI flag or
corresponding item in '.terraform-docs.yml' config file. Its default
value is:
```
<!-- BEGIN_TF_DOCS -->
{{ .Content }}
<!-- END_TF_DOCS -->
```
This consists of three items, all of them are mandatory:
- begin comment
- content variable
- end comment
You may change the wording of comment as you wish, but the comment must
be present in the template.
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
This commit is contained in:
@@ -32,6 +32,9 @@ terraform-docs asciidoc document [PATH] [flags]
|
||||
--hide strings hide section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
--hide-all hide all sections (default false)
|
||||
--indent int indention level of AsciiDoc sections [1, 2, 3, 4, 5] (default 2)
|
||||
--output-file string File in module directory to insert output into (default "")
|
||||
--output-mode string Output to file method [inject, replace] (default "inject")
|
||||
--output-template string Output template (default "<!-- BEGIN_TF_DOCS -->\n{{ .Content }}\n<!-- END_TF_DOCS -->")
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs (default "")
|
||||
--required show Required column or section (default true)
|
||||
|
||||
@@ -32,6 +32,9 @@ terraform-docs asciidoc table [PATH] [flags]
|
||||
--hide strings hide section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
--hide-all hide all sections (default false)
|
||||
--indent int indention level of AsciiDoc sections [1, 2, 3, 4, 5] (default 2)
|
||||
--output-file string File in module directory to insert output into (default "")
|
||||
--output-mode string Output to file method [inject, replace] (default "inject")
|
||||
--output-template string Output template (default "<!-- BEGIN_TF_DOCS -->\n{{ .Content }}\n<!-- END_TF_DOCS -->")
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs (default "")
|
||||
--required show Required column or section (default true)
|
||||
|
||||
@@ -35,6 +35,9 @@ terraform-docs asciidoc [PATH] [flags]
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--hide strings hide section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
--hide-all hide all sections (default false)
|
||||
--output-file string File in module directory to insert output into (default "")
|
||||
--output-mode string Output to file method [inject, replace] (default "inject")
|
||||
--output-template string Output template (default "<!-- BEGIN_TF_DOCS -->\n{{ .Content }}\n<!-- END_TF_DOCS -->")
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs (default "")
|
||||
--show strings show section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
|
||||
@@ -30,6 +30,9 @@ terraform-docs json [PATH] [flags]
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--hide strings hide section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
--hide-all hide all sections (default false)
|
||||
--output-file string File in module directory to insert output into (default "")
|
||||
--output-mode string Output to file method [inject, replace] (default "inject")
|
||||
--output-template string Output template (default "<!-- BEGIN_TF_DOCS -->\n{{ .Content }}\n<!-- END_TF_DOCS -->")
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs (default "")
|
||||
--show strings show section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
|
||||
@@ -33,6 +33,9 @@ terraform-docs markdown document [PATH] [flags]
|
||||
--hide strings hide section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
--hide-all hide all sections (default false)
|
||||
--indent int indention level of Markdown sections [1, 2, 3, 4, 5] (default 2)
|
||||
--output-file string File in module directory to insert output into (default "")
|
||||
--output-mode string Output to file method [inject, replace] (default "inject")
|
||||
--output-template string Output template (default "<!-- BEGIN_TF_DOCS -->\n{{ .Content }}\n<!-- END_TF_DOCS -->")
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs (default "")
|
||||
--required show Required column or section (default true)
|
||||
|
||||
@@ -33,6 +33,9 @@ terraform-docs markdown table [PATH] [flags]
|
||||
--hide strings hide section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
--hide-all hide all sections (default false)
|
||||
--indent int indention level of Markdown sections [1, 2, 3, 4, 5] (default 2)
|
||||
--output-file string File in module directory to insert output into (default "")
|
||||
--output-mode string Output to file method [inject, replace] (default "inject")
|
||||
--output-template string Output template (default "<!-- BEGIN_TF_DOCS -->\n{{ .Content }}\n<!-- END_TF_DOCS -->")
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs (default "")
|
||||
--required show Required column or section (default true)
|
||||
|
||||
@@ -36,6 +36,9 @@ terraform-docs markdown [PATH] [flags]
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--hide strings hide section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
--hide-all hide all sections (default false)
|
||||
--output-file string File in module directory to insert output into (default "")
|
||||
--output-mode string Output to file method [inject, replace] (default "inject")
|
||||
--output-template string Output template (default "<!-- BEGIN_TF_DOCS -->\n{{ .Content }}\n<!-- END_TF_DOCS -->")
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs (default "")
|
||||
--show strings show section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
|
||||
@@ -30,6 +30,9 @@ terraform-docs pretty [PATH] [flags]
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--hide strings hide section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
--hide-all hide all sections (default false)
|
||||
--output-file string File in module directory to insert output into (default "")
|
||||
--output-mode string Output to file method [inject, replace] (default "inject")
|
||||
--output-template string Output template (default "<!-- BEGIN_TF_DOCS -->\n{{ .Content }}\n<!-- END_TF_DOCS -->")
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs (default "")
|
||||
--show strings show section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
|
||||
@@ -24,6 +24,9 @@ terraform-docs [PATH] [flags]
|
||||
-h, --help help for terraform-docs
|
||||
--hide strings hide section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
--hide-all hide all sections (default false)
|
||||
--output-file string File in module directory to insert output into (default "")
|
||||
--output-mode string Output to file method [inject, replace] (default "inject")
|
||||
--output-template string Output template (default "<!-- BEGIN_TF_DOCS -->\n{{ .Content }}\n<!-- END_TF_DOCS -->")
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs (default "")
|
||||
--show strings show section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
|
||||
@@ -29,6 +29,9 @@ terraform-docs tfvars hcl [PATH] [flags]
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--hide strings hide section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
--hide-all hide all sections (default false)
|
||||
--output-file string File in module directory to insert output into (default "")
|
||||
--output-mode string Output to file method [inject, replace] (default "inject")
|
||||
--output-template string Output template (default "<!-- BEGIN_TF_DOCS -->\n{{ .Content }}\n<!-- END_TF_DOCS -->")
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs (default "")
|
||||
--show strings show section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
|
||||
@@ -29,6 +29,9 @@ terraform-docs tfvars json [PATH] [flags]
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--hide strings hide section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
--hide-all hide all sections (default false)
|
||||
--output-file string File in module directory to insert output into (default "")
|
||||
--output-mode string Output to file method [inject, replace] (default "inject")
|
||||
--output-template string Output template (default "<!-- BEGIN_TF_DOCS -->\n{{ .Content }}\n<!-- END_TF_DOCS -->")
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs (default "")
|
||||
--show strings show section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
|
||||
@@ -25,6 +25,9 @@ Generate terraform.tfvars of inputs.
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--hide strings hide section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
--hide-all hide all sections (default false)
|
||||
--output-file string File in module directory to insert output into (default "")
|
||||
--output-mode string Output to file method [inject, replace] (default "inject")
|
||||
--output-template string Output template (default "<!-- BEGIN_TF_DOCS -->\n{{ .Content }}\n<!-- END_TF_DOCS -->")
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs (default "")
|
||||
--show strings show section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
|
||||
@@ -29,6 +29,9 @@ terraform-docs toml [PATH] [flags]
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--hide strings hide section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
--hide-all hide all sections (default false)
|
||||
--output-file string File in module directory to insert output into (default "")
|
||||
--output-mode string Output to file method [inject, replace] (default "inject")
|
||||
--output-template string Output template (default "<!-- BEGIN_TF_DOCS -->\n{{ .Content }}\n<!-- END_TF_DOCS -->")
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs (default "")
|
||||
--show strings show section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
|
||||
@@ -29,6 +29,9 @@ terraform-docs xml [PATH] [flags]
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--hide strings hide section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
--hide-all hide all sections (default false)
|
||||
--output-file string File in module directory to insert output into (default "")
|
||||
--output-mode string Output to file method [inject, replace] (default "inject")
|
||||
--output-template string Output template (default "<!-- BEGIN_TF_DOCS -->\n{{ .Content }}\n<!-- END_TF_DOCS -->")
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs (default "")
|
||||
--show strings show section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
|
||||
@@ -29,6 +29,9 @@ terraform-docs yaml [PATH] [flags]
|
||||
--header-from string relative path of a file to read header from (default "main.tf")
|
||||
--hide strings hide section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
--hide-all hide all sections (default false)
|
||||
--output-file string File in module directory to insert output into (default "")
|
||||
--output-mode string Output to file method [inject, replace] (default "inject")
|
||||
--output-template string Output template (default "<!-- BEGIN_TF_DOCS -->\n{{ .Content }}\n<!-- END_TF_DOCS -->")
|
||||
--output-values inject output values into outputs (default false)
|
||||
--output-values-from string inject output values from file into outputs (default "")
|
||||
--show strings show section [header, inputs, modules, outputs, providers, requirements, resources]
|
||||
|
||||
Reference in New Issue
Block a user