Add '--html bool' flag and config to Markdown

This is 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 converted 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": [] }
```

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
This commit is contained in:
Khosrow Moossavi
2021-05-20 13:58:43 -04:00
parent 2cb5fdb840
commit 2f088f2544
34 changed files with 1437 additions and 113 deletions

View File

@@ -23,6 +23,7 @@ terraform-docs markdown [PATH] [flags]
--default show Default column or section (default true)
--escape escape special characters (default true)
-h, --help help for markdown
--html use HTML tags in genereted output (default true)
--indent int indention level of Markdown sections [1, 2, 3, 4, 5] (default 2)
--required show Required column or section (default true)
--sensitive show Sensitive column or section (default true)