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:
Khosrow Moossavi
2021-05-12 16:29:07 -04:00
parent 6777364257
commit ea34bce326
7 changed files with 97 additions and 4 deletions

View File

@@ -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