-
Notifications
You must be signed in to change notification settings - Fork 69
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
Example TF file is not rendered in index.md with custom template #191
Comments
using the latest version, a custom template is working fine for us.
you might need to incrementally add the parts and see what is not working. we don't use |
I cloned your repo and I tried it out. I did -{{ tffile "examples/provider/provider.tf" }}
+{{ printf "{{tffile %q}}" .ExampleFile }} and in generated file So this code So when I copied default ones, it wasn't working for me. |
The reason why it doesn't work is because of the level of indirection caused by the usage of
The result of this function is in fact expected:
There is no need to use -{{ printf "{{tffile %q}}" .ExampleFile }}
+{{ tffile .ExampleFile }} |
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. |
I have file
examples/provider/provider.tf
and I runtfplugindocs generate
. It works great and in filedocs/index.md
I see the content ofprovider.tf
file.However, when I create custom index template in file
templates/index.md.tmpl
with following content, it does not work. I see just path to the file instead of content of the file.Just to be clear, content of my template is the same as the default one here https://github.com/hashicorp/terraform-plugin-docs/blob/main/internal/provider/template.go#L246 so it is not issue with my template. Especially because it works well for
resources.md.tmpl
anddata-sources.md.tmpl
Source codes
The text was updated successfully, but these errors were encountered: