mirror of
https://github.com/terraform-docs/terraform-docs.git
synced 2026-03-27 04:48:33 +07:00
Include relative files into generated content
Local relative files can be included automatically in the generated
content with `{{ include "..." }} function. This can be very useful
for:
- inject arbitrary markdown files in between sections
- automatically include example usage
````yaml
content: |-
include any relative files
{{ include "relative/path/to/file" }}
or examples
```hcl
{{ include "examples/foo/main.tf" }}
```
````
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
This commit is contained in:
@@ -24,6 +24,12 @@ sections:
|
||||
#
|
||||
# and even in between sections
|
||||
#
|
||||
# ## Examples
|
||||
#
|
||||
# ```hcl
|
||||
# {{ include "relative/path/to/main.tf" }}
|
||||
# ```
|
||||
#
|
||||
# {{ .Providers }}
|
||||
#
|
||||
# and they don't even need to be in the default order
|
||||
|
||||
Reference in New Issue
Block a user