Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/generate: allow HasExample and HasImport to function #155

Merged

Commits on Jun 20, 2022

  1. cmd/generate: allow HasExample and HasImport to function

    When building custom templates, we have `HasExample`[1] and
    `HasImport`[2] available that return a boolean value and allow templates
    to include conditionals. Some uses of this would be to only show either
    an example or import line should the files exist. However, when we are
    calling these for templates both data-sources and resources only pass in an
    empty string[3] resulting in the value always returning `false`[4].
    
    This appears to be an oversight as the non-customisable render template
    call site correctly passes in the values[5] of these paths and the template
    expression renders.
    
    [1]: https://github.com/hashicorp/terraform-plugin-docs/blob/6e1a3339859e55625941bcef8ab365552235ca3b/internal/provider/template.go#L137
    [2]: https://github.com/hashicorp/terraform-plugin-docs/blob/6e1a3339859e55625941bcef8ab365552235ca3b/internal/provider/template.go#L140
    [3]: https://github.com/hashicorp/terraform-plugin-docs/blob/6e1a3339859e55625941bcef8ab365552235ca3b/internal/provider/generate.go#L420
    [4]: https://github.com/hashicorp/terraform-plugin-docs/blob/e52e735a834db7cdbd980cc817989588c77d96d4/internal/provider/template.go#L198
    [5]: https://github.com/hashicorp/terraform-plugin-docs/blob/6e1a3339859e55625941bcef8ab365552235ca3b/internal/provider/generate.go##L258
    jacobbednarz committed Jun 20, 2022
    Copy the full SHA
    c3ba333 View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2022

  1. Copy the full SHA
    493f4ff View commit details
    Browse the repository at this point in the history
  2. add CHANGELOG entry

    jacobbednarz committed Jun 23, 2022
    Copy the full SHA
    df94c86 View commit details
    Browse the repository at this point in the history