mirror of
https://github.com/terraform-docs/terraform-docs.git
synced 2026-03-27 12:58:35 +07:00
Merge pull request #13 from jbussdieker/jbb-fix-heredoc-description
Fix heredoc descriptions
This commit is contained in:
@@ -77,7 +77,7 @@ func inputs(list *ast.ObjectList) []Input {
|
||||
if is(item, "variable") {
|
||||
name, _ := strconv.Unquote(item.Keys[1].Token.Text)
|
||||
items := item.Val.(*ast.ObjectType).List.Items
|
||||
desc, _ := strconv.Unquote(description(items))
|
||||
desc := description(items)
|
||||
def := get(items, "default")
|
||||
ret = append(ret, Input{
|
||||
Name: name,
|
||||
@@ -120,7 +120,11 @@ func get(items []*ast.ObjectItem, key string) *Value {
|
||||
v := new(Value)
|
||||
|
||||
if lit, ok := item.Val.(*ast.LiteralType); ok {
|
||||
v.Literal = lit.Token.Text
|
||||
if value, ok := lit.Token.Value().(string); ok {
|
||||
v.Literal = value
|
||||
} else {
|
||||
v.Literal = lit.Token.Text
|
||||
}
|
||||
v.Type = "string"
|
||||
return v
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ func Markdown(d *doc.Doc) (string, error) {
|
||||
|
||||
buf.WriteString(fmt.Sprintf("| %s | %s | %s | %v |\n",
|
||||
v.Name,
|
||||
v.Description,
|
||||
strings.TrimSpace(v.Description),
|
||||
def,
|
||||
humanize(v.Default)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user