18 Commits

Author SHA1 Message Date
Khosrow Moossavi
8f74fd4453 feat: ignore outputs, providers, resources with comments
Prepend any type of resource, including `resource`, `data`, `module`,
`variable`, and `output` with a comment including "terraform-docs-ignore"
to exclude it from the generated output.

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2024-05-30 12:33:14 -04:00
Khosrow Moossavi
f3c92384a1 Extract leading comments for resources and modules
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-09-29 13:55:50 -04:00
Khosrow Moossavi
61cc005548 Render resources without URL correctly in Markdown and Asciidoc
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-06-17 18:17:43 -04:00
Edgar R. Sandi
0284283bd1 Separate the module version from module source when using ?ref=
Signed-off-by: Edgar R. Sandi <edgar.r.sandi@gmail.com>
2021-05-18 20:51:50 -03:00
Khosrow Moossavi
ac5a29c6f6 Implement module sort by position (no sort)
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-03-15 18:26:54 -04:00
Heiko Neblung
2575a40e78 added output section for modulecalls
Signed-off-by: Heiko Neblung <Heiko.Neblung@t-systems.com>
2021-02-10 05:40:50 +01:00
Khosrow Moossavi
8f930437fa fix: Make sure requirements section is sorted (#233)
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2020-04-01 17:25:52 -04:00
Khosrow Moossavi
b6241751d9 feat: Add section for module requirements (#222)
* Add section for module requirements

* cleanup

* reorder items logically
2020-03-24 14:20:13 -04:00
Khosrow Moossavi
bf07706947 fix: Do not escape markdown table inside module header (#186) 2020-02-01 14:21:54 -05:00
Khosrow Moossavi
43f69d337f fix: Preserve asterisk list in header and fix escaping (#179) 2020-01-30 18:47:32 -05:00
Khosrow Moossavi
bf38a75fe3 fix: Add newline between code block and trailing lines (#184) 2020-01-30 18:09:45 -05:00
Khosrow Moossavi
82e87aa264 fix: Do not escape strings inside code blocks (#155) 2020-01-12 15:20:12 -05:00
Khosrow Moossavi
b3112d135a fix: Read leading module header from main.tf (#154)
Supported comment formats is:
- jsdoc, c or java-like multi-line comment `/** **/`

BREAKING CHANGE: - In the JSON format respone, module "Comment" has been renamed to module `header`.
2020-01-10 16:40:48 -05:00
Khosrow Moossavi
a6193849c4 fix: Read leading comment lines if description is not provided (#151)
Supported comment formats are:

- multi-lines start with `#` comment format
- multi-lines start with `//` comment format

Unsupported comments formats is:

- jsdoc, c or java-like multi-line comment `/** **/`
2020-01-07 21:49:56 -05:00
Khosrow Moossavi
ce32bf10a9 feat: Show 'providers' information (#140)
* Show 'providers' information

* Fix for unsorted providers list

BREAKING CHANGE: - With Terraform 0.12 the information about `providers` being used in the module will be generated by default. This will cause the first generation of documents with the latest release of `terraform-docs` binary be slightly different than before, now there will be `Providers` section in Markdown and `providers` block in JSON. You can ignore this by using new `--no-providers` flag if you choose to.

Originally-Authored-By: Thomas Alton <thomas.alton@gmail.com>
Original-Pull-Request: #113
2020-01-03 18:33:08 -05:00
Thomas Alton
b8da8c5020 feat: Support Terraform 0.12.x configuration (#113)
* Support 0.12 configuration

* Move code out of GOPATH for CircleCI

* cleanup

* Rename 'variables' back to 'input' just for now

* Normalizing 'print.s.Settings' usage

* Normalize settings continued

* Remove '--providers' functionality for now

* Adjust 'commands' based on moarta's changes

* Adjust 'pkg/doc' based on moarta's changes

* Adjust 'pkg/print/json' based on moarta's changes

* Fix json tests

* don't trim whitespaces from .tf files

* Adjust 'pkg/print/pretty' based on moarta's changes

* Fix pretty tests

* don't trim whitespaces from .golden files

* Show 'n/a' for empty description for 'pretty'

* Show 'any' if type of input variable is missing

* Adjust 'pkg/print/markdown/document' based on moarta's changes

* Fix document tests

* move back vendor files

* Adjust 'pkg/print/markdown/table' based on moarta's changes

* fix lint issue

* Fix table tests

* figure out input type based on default value if tpye not explicitly defined

* don't escape ( ) [ ] { }, as they don't cause any issue

Authored-by: Thomas Alton <thomas.alton@gmail.com>
Co-authored-by: Khosrow Moossavi <khos2ow@gmail.com>
2019-12-20 15:07:29 -05:00
Khosrow Moossavi
f0a7d374a5 Enhance Makefile and add editorconfig (#115) 2019-09-23 20:27:11 +02:00
Martin Etmajer
750d500622 Move Terraform test configuration to folder 'examples'. 2018-12-02 19:44:21 +01:00