Files
terraform-docs/docs/how-to/include-examples.md
Khosrow Moossavi f33826c5df Cleanup documentations
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-09-13 18:07:57 -04:00

726 B

title, description, menu, weight, toc
title description menu weight toc
Include Examples How to include example in terraform-docs generated output
docs
parent
how-to
205 false

Since v0.14.0

Example can be automatically included into README by using content in configuration file. For example:

$ tree
.
├── examples
│   ├── example-1
│   │   ├── main.tf
│   └── example-2
│       └── main.tf
├── ...
├── main.tf
├── variables.tf
├── ...
└── .terraform-docs.yml

and

# .terraform-docs.yml
content: |-
  {{ .Header }}

  ## Example

  ```hcl
  {{ include "examples/example-1/main.tf" }}
  ```

  {{ .Inputs }}

  {{ .Outputs }}