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

Resource / Data source examples not detected when a template is provided #9

Closed
OJFord opened this issue Dec 1, 2020 · 3 comments · Fixed by #300
Closed

Resource / Data source examples not detected when a template is provided #9

OJFord opened this issue Dec 1, 2020 · 3 comments · Fixed by #300
Labels
bug Something isn't working

Comments

@OJFord
Copy link
Contributor

OJFord commented Dec 1, 2020

The readme describes using resource examples in examples/resources/<name>/resource.tf, but if I template {{ printf "%s" .ExampleFile }} it seems just to be "" for resources.

After a quick look at the code, I think it's just not implemented rather than a bug. I'm sure you know this - a note here just might help anyone else confused by it.

To workaround, you can of course just change the template to remove the if .HasExample and .ExampleFile and replace with a tffile "examples/resources/wherever.tf". That is:

{{/* templates/resources/name.md.tmpl */}}

 ## Example Usage

{{ tffile "examples/resources/name/resource.tf" }}
@paultyng paultyng added the bug Something isn't working label Jan 26, 2021
@paultyng
Copy link
Contributor

Will need to investigate but I think this should be working so it may be an oversight at least if not a bug, going to mark it as a bug for now though since it was intended to work.

@detro detro changed the title Resource .ExampleFile Resource / Data source examples not detected when a template is provided Mar 15, 2022
@detro
Copy link
Contributor

detro commented Mar 15, 2022

The issue is real and a bit more generic: it has to do with the fact that the examples will not be picked up if a template for that resource/data source is detected.

byashimov added a commit to byashimov/terraform-plugin-docs that referenced this issue Sep 15, 2022
Printing tags just renders them as a string.
byashimov added a commit to byashimov/terraform-plugin-docs that referenced this issue Apr 11, 2023
Printing tags just renders them as a string.
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
3 participants