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

expose RenderedProviderName to templating #149

Merged

Conversation

jacobbednarz
Copy link
Contributor

Updates the templating variables to include RenderedProviderName which is the
value from --rendered-provider-name when invoking generate.

Allows doing the following in templates resulting in a nicer docs experience.

page_title: "{{.Name}} {{.Type}} - {{.RenderedProviderName}}"

Output:

# old
page_title: "Example Resource - terraform-provider-cloudflare"

# proposed
page_title: "Example Resource - Cloudflare"

@jacobbednarz jacobbednarz requested a review from a team as a code owner June 13, 2022 06:31
Updates the templating variables to include `RenderedProviderName` which is the
value from `--rendered-provider-name` when invoking `generate`.
@jacobbednarz jacobbednarz force-pushed the expose-rendered-provider-name-to-templating branch from 8150d95 to a4c3a9b Compare June 13, 2022 06:33
@detro detro merged commit e52e735 into hashicorp:main Jun 13, 2022
@detro
Copy link
Contributor

detro commented Jun 13, 2022

Hey @jacobbednarz - I really appreciate the effort you are putting in to fix the RenderedProviderName issue and also bring this feature end-2-end.

Can you confirm this is now working as expected, and that RenderedProviderName is optional only (i.e. existing setups won't see any change)? I'll try to do the verification myself too, but another pair of eyes would help.

Then we can cut 0.9.1.

@jacobbednarz
Copy link
Contributor Author

from my debugging and test cases, this is now looking complete as a new optional field that is:

  • available with individual custom templates; and
  • rendered in templates when the variable is used.

if you'd like to run some tests yourself, check out https://github.com/cloudflare/terraform-provider-cloudflare where I have a make target (make docs using a custom provider name) working on my fork with both of these patches that will eventually land in 0.9.1.

@jacobbednarz
Copy link
Contributor Author

note: I couldn't see any of the other customisation flags needing to be exposed to the generation process so I left them. that may be the only thing potentially missing if someone has a use for them.

@jacobbednarz jacobbednarz deleted the expose-rendered-provider-name-to-templating branch June 13, 2022 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants