Skip to content

Commit

Permalink
Add 'since version' to docs for clarity
Browse files Browse the repository at this point in the history
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
  • Loading branch information
khos2ow committed Apr 27, 2021
1 parent 2c00107 commit b4981a1
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
21 changes: 18 additions & 3 deletions docs/user-guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down Expand Up @@ -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`:

Expand All @@ -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):
Expand Down Expand Up @@ -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).
Expand Down
18 changes: 15 additions & 3 deletions docs/user-guide/how-to.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -106,23 +110,29 @@ 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
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
```

## Generate terraform.tfvars

Since `v0.9.0`

You can generate `terraform.tfvars` in both `hcl` and `json` format by executing
the following, respectively:

Expand Down Expand Up @@ -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.

Expand Down

0 comments on commit b4981a1

Please sign in to comment.