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

Rendered provider name not being picked up #173

Closed
posriniv opened this issue Aug 4, 2022 · 9 comments
Closed

Rendered provider name not being picked up #173

posriniv opened this issue Aug 4, 2022 · 9 comments

Comments

@posriniv
Copy link

posriniv commented Aug 4, 2022

The latest version of tfplugindocs doesn't use the --rendered-provider-name parameter while generating the documentation.

@jacobbednarz
Copy link
Contributor

can you provide more details on this? we are using the latest version with this flag and it is working as expected.

@posriniv
Copy link
Author

posriniv commented Aug 5, 2022

@jacobbednarz The value I pass in as --provider-name is being used in the place where --rendered-provider-name must be used. Can you please let me know what other information would help you?

@jacobbednarz
Copy link
Contributor

if you clone https://github.com/cloudflare/terraform-provider-cloudflare and run make docs, it should demonstrate this in use and working.

if you can provide a similar repro, I can take a look for you.

@posriniv
Copy link
Author

posriniv commented Aug 5, 2022

Our repository is not public yet. However, when I tried it on Cloudflare Terraform provider with a different name, I see that the rendered provider name got updated in the resources docs but it didn't get updated on index.md. Is this the expected behavior?

For example, I changed the rendered provider name to New Cloudflare and ran make docs
Here is the page for docs/resources/access_application.md

---                                                                                                  
page_title: "cloudflare_access_application Resource - New Cloudflare"                                
subcategory: ""                                                                                      
description: |-                                                                                      
  Provides a Cloudflare Access Application resource. Access                                          
  Applications are used to restrict access to a whole application using an                           
  authorisation gateway managed by Cloudflare. 
.
.

And, here is the page for docs/index.md

---                                                                                                  
layout: ""                                                                                           
page_title: "Provider: Cloudflare"                                                                   
description: |-                                                                                      
  The Cloudflare provider provides resources to interact with the Cloudflare API.                    
---  

@jacobbednarz
Copy link
Contributor

It uses a custom template that doesn't use the variable - https://github.com/cloudflare/terraform-provider-cloudflare/blob/master/templates/index.md.tmpl, so, yes.

@posriniv
Copy link
Author

posriniv commented Aug 5, 2022

@jacobbednarz I see. I didn't create any templates directory and it is not being created when I run generate either. That is the reason why rendered_provider_name is not working for me. Is there a way to automatically generate the templates directory and files? I fail to see it in the docs. Thanks a lot for the help.

@jacobbednarz
Copy link
Contributor

jacobbednarz commented Aug 6, 2022

you don't have to have a templates directory unless you want to customise it (like using the rendered provider name instead of the default provider name). out of the box, the default index and resource template don't use it so it is a noop.

see the default templates at internal/provider/template.go.

@posriniv
Copy link
Author

posriniv commented Aug 6, 2022

@jacobbednarz Thank you very much. Closing the issue.

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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants