Add 'since version' to docs for clarity

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
This commit is contained in:
Khosrow Moossavi
2021-04-26 20:16:37 -04:00
parent 2c00107d46
commit b4981a16a9
2 changed files with 33 additions and 6 deletions

View File

@@ -39,6 +39,8 @@ $ terraform-docs -c .tfdocs-config.yml .
## Options
Since `v0.10.0`
Below is a complete list of options that you can use with `terraform-docs`, with their
corresponding default values (if applicable).
@@ -119,6 +121,8 @@ Valid operators are as follow:
## Formatters
Since `v0.10.0`
The following options are supported out of the box by terraform-docs and can be
used for `FORMATTER_NAME`:
@@ -142,30 +146,39 @@ formatter name must be set to `foo`.
## header-from
Since `v0.10.0`
Relative path to a file to extract header for the generated output from. Supported
file formats are `.adoc`, `.md`, `.tf`, and `.txt`. Default value is `main.tf`.
## footer-from
Since `v0.12.0`
Relative path to a file to extract footer for the generated output from. Supported
file formats are `.adoc`, `.md`, `.tf`, and `.txt`. Default value is `""`.
## Sections
Since `v0.10.0`
The following options are supported and can be used for `sections.show` and
`sections.hide`:
- `data-sources`
- `data-sources` (since `v0.13.0`)
- `header`
- `footer` (since `v0.12.0`)
- `inputs`
- `modules`
- `modules` (since `v0.11.0`)
- `outputs`
- `providers`
- `requirements`
- `resources`
- `resources` (since `v0.11.0`)
## Output
Since `v0.12.0`
Insert generated output to file if `output.file` (or `--output-file string` CLI
flag) is not empty. Insersion behavior can be controlled by `output.mode` (or
`--output-mode string` CLI flag):
@@ -263,6 +276,8 @@ Markdown engine to properly process the comment line after the paragraph.
## Sort
Since `v0.10.0`
To enable sorting of elements `sort.enabled` (or `--sort bool` CLI flag) can be
used. This will indicate sorting is enabled or not, but consecutively type of
sorting can also be specified with `sort.by` (or `--sort-by string` CLI flag).

View File

@@ -20,6 +20,8 @@ Error: accepts 1 arg(s), received 2
## Visibility of Sections
Since `v0.10.0`
Output generated by `terraform-docs` consists of different [sections] which are
visible by default. The visibility of these can be controlled by one of the following
options:
@@ -68,6 +70,8 @@ $ terraform-docs --hide inputs --hide providers .
## Module Header
Since `v0.10.0`
Module header can be extracted from different sources. Default file to extract
header from is `main.tf`, otherwise you can specify the file with `--header-from FILE`
or corresponding `header-from` in configuration file. Supported file formats to
@@ -106,6 +110,8 @@ formatting to them (i.e. adding `<SPACE><SPACE>` at the end of lines for break,
## Module Footer
Since `v0.12.0`
Extracting module footer works exactly like header with one exception. There is no
default file to attempt extraction from, you need to explicitly specify desired file
to extract content from with `--footer-from FILE` or corresponding `footer-from` in
@@ -113,9 +119,11 @@ configuration file.
## Insert Output To File
Since `v0.12.0`, generated output can be insterted directly into the file. There
are two modes of insersion: `inject` (default) or `replace`. Take a look at [output]
configuration for all the details.
Since `v0.12.0`
Generated output can be insterted directly into the file. There are two modes of
insersion: `inject` (default) or `replace`. Take a look at [output] configuration
for all the details.
```console
terraform-docs markdown table --output-file README.md --output-mode inject /path/to/module
@@ -123,6 +131,8 @@ terraform-docs markdown table --output-file README.md --output-mode inject /path
## Generate terraform.tfvars
Since `v0.9.0`
You can generate `terraform.tfvars` in both `hcl` and `json` format by executing
the following, respectively:
@@ -167,6 +177,8 @@ examples.
## Pre-commit Hook
Since `v0.12.0`
With [`pre-commit`], you can ensure your Terraform module documentation is kept
up-to-date each time you make a commit.