mirror of
https://github.com/terraform-docs/terraform-docs.git
synced 2026-03-27 12:58:35 +07:00
952 B
952 B
title, description, menu, weight, toc
| title | description | menu | weight | toc | ||||
|---|---|---|---|---|---|---|---|---|
| Insert Output To File | How to insert generated terraform-docs output to file |
|
205 | false |
Since v0.12.0
Generated output can be inserted directly into the file. There are two modes of
insertion: inject (default) or replace. Take a look at [output] configuration
for all the details.
terraform-docs markdown table --output-file README.md --output-mode inject /path/to/module
{{< alert type="info" >}}
--output-file can be relative to module path or an absolute path in filesystem.
{{< /alert>}}
$ pwd
/path/to/module
$ tree .
.
├── docs
│ └── README.md
├── ...
└── main.tf
# this works, relative path
$ terraform-docs markdown table --output-file ./docs/README.md .
# so does this, absolute path
$ terraform-docs markdown table --output-file /path/to/module/docs/README.md .
[output]: {{< ref "output" >}}