Skip to content

Commit

Permalink
Remove website prefix from generated docs (#2028)
Browse files Browse the repository at this point in the history
Website has linting that errors when links have the
developer.hashicorp.com prefix.
  • Loading branch information
lkysow authored Mar 21, 2023
1 parent 9de3ff9 commit 7d098bd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hack/helm-reference-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,14 @@ func GenerateDocs(yamlStr string) (string, error) {
return "", err
}

enterpriseSubst := strings.ReplaceAll(strings.Join(children, "\n\n"), "[Enterprise Only]", "<EnterpriseAlert inline />")
docsStr := strings.Join(children, "\n\n")
docsStr = strings.ReplaceAll(docsStr, "[Enterprise Only]", "<EnterpriseAlert inline />")
// Remove https://developer.hashicorp.com prefix from links because docs linting requires it.
docsStr = strings.ReplaceAll(docsStr, "https://developer.hashicorp.com/", "/")

// Add table of contents.
toc := generateTOC(node)
return toc + "\n\n" + enterpriseSubst + "\n", nil
return toc + "\n\n" + docsStr + "\n", nil
}

// Parse parses yamlStr into a tree of DocNode's.
Expand Down

0 comments on commit 7d098bd

Please sign in to comment.