mirror of
https://github.com/terraform-docs/terraform-docs.git
synced 2026-03-27 04:48:33 +07:00
better md output
This commit is contained in:
10
main.go
10
main.go
@@ -97,9 +97,8 @@ func markdown(vals []Value) {
|
||||
} else {
|
||||
outputs.WriteString(fmt.Sprintf("| %s | %s |\n",
|
||||
v.Name,
|
||||
v.Description))
|
||||
strings.TrimSpace(v.Description)))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fmt.Println("## Inputs")
|
||||
@@ -163,9 +162,14 @@ func values(f *ast.File) (ret []Value) {
|
||||
func get(items []*ast.ObjectItem, key string) string {
|
||||
for _, item := range items {
|
||||
if is(item.Keys, key) {
|
||||
return item.Val.(*ast.LiteralType).Token.Text
|
||||
if lit, ok := item.Val.(*ast.LiteralType); ok {
|
||||
return lit.Token.Text
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user