Notable Updates
The most notable changes in this release are:
-
Generated content can be customized further away with
content
in configuration. If thecontent
is empty the default orders of section is used.content
is a Go template with following additional variables:{{ .Header }}
{{ .Footer }}
{{ .Inputs }}
{{ .Modules }}
{{ .Outputs }}
{{ .Providers }}
{{ .Requirements }}
{{ .Resources }}
content: |- Any arbitrary text can be placed anywhere in the content {{ .Header }} and even in between sections {{ .Providers }} and they don't even need to be in the default order {{ .Outputs }} {{ .Inputs }}
These variables are the generated output of individual sections in the selected formatter. For example
{{ .Inputs }}
is Markdown Table representation of inputs when formatter is set tomarkdown table
and AsciiDoc Document representation when formatter is set toasciidoc document
and so on.Compatible formats for customized content are:
asciidoc document
asciidoc table
markdown document
markdown table
-
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
content: |- include any relative files {{ include "relative/path/to/file" }} or examples ```hcl {{ include "examples/foo/main.tf" }} ```
-
Add
--html bool
flag and config to Markdown to control the generated HTML tags inside markdown output. If set to false no html tags (e.g.<br>
,<pre>
) will be generated. And as a workaround the multi-line codeblock will be converted to single line with linebreak onverted to<SPACE>
.For example:
{ "bar": { "bar": "bar", "foo": "bar" }, "buzz": [ "fizz", "buzz" ], "fizz": [] }
will be converted to:
{ "bar": { "bar": "bar", "foo": "bar" }, "buzz": [ "fizz", "buzz" ], "fizz": [] }
Changelog
Features
2f088f2 Add '--html bool' flag and config to Markdown
6777364 Customize content with individual sections output
ea34bce Include relative files into generated content
57cf3db Extract provider version from .terraform.lock.hcl
0284283 Separate the module version from module source when using ?ref=
Bug Fixes
90ccb84 Add missing Resource.Mode to plugin-sdk (#493)
6820b4c Normalize version to prevent malformed error
Chores
bd32f8c Bump action-homebrew-bump-formula action to v3.8.0
7327de1 Clarify deprecated settings in the docs (#499)
d79abf0 Documentation cosmetic cleanup
2706df0 Enable CodeQL scanning
5df7ff2 Improve Makefile help message
23436be Update release scripts
7f63260 Update to go1.16.4
4397fac Validate license header on files on CI
Docker images
docker pull quay.io/terraform-docs/terraform-docs:latest
docker pull quay.io/terraform-docs/terraform-docs:0.14.0
Contributors
Very special thanks to the contributors.