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

feat(cli): Add inline doc links to Terraform provider docs when generating provider bindings #576

Merged
merged 15 commits into from
May 27, 2021

Conversation

skorfmann
Copy link
Contributor

@skorfmann skorfmann commented Feb 19, 2021

This adds jsdoc links to generated resources / data sources for a provider.

Screenshot 2021-02-19 at 14 59 31

The url which we're using seems to be deprecated. There are redirects in place, so it's not a big issue right now. However, it should be addressed at some point. the new url structure expects the namespace to be present (something like hashicorp/aws).

This could be easily extend to attribute level anchor links to the Terraform registry. Something like https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/dynamodb_table#name

Todo:

  • Check Python
  • Check Dotnet
  • Check Java
  • Check Go (as soon as it is merged)

@danieldreier danieldreier added this to the v0.5 milestone May 20, 2021
@skorfmann skorfmann changed the title Add inline doc links to Terraform provider docs feat(cli): Add inline doc links to Terraform provider docs when generating provider bindings May 26, 2021
@skorfmann
Copy link
Contributor Author

For Python, it looks like this - the formatting is not properly transformed, but the link would be usable nevertheless. Not sure if there's a way to make appearance better.

Screenshot 2021-05-26 at 17 05 58

The wording for data sources doesn't really make sense. Gonna change that.

@skorfmann
Copy link
Contributor Author

For Python, it looks like this - the formatting is not properly transformed, but the link would be usable nevertheless.

That's the same for AWS CDK, hence I'm assuming there's no jsdoc transforming in jsii

This links to an anchor fragment, which are not properly set in all
provider docs (e.g. Docker). But it seems to work for the majority
of popular providers.
@skorfmann
Copy link
Contributor Author

a504733 adds direct links to the attribute of resource in the Terraform Registry. It seems to work for the majority of the popular providers. 🎉

Screenshot 2021-05-26 at 21 15 14

@skorfmann
Copy link
Contributor Author

The wording for data sources doesn't really make sense. Gonna change that.

Changed that slightly.

@skorfmann skorfmann marked this pull request as ready for review May 26, 2021 19:24
@skorfmann
Copy link
Contributor Author

Java looks pretty good as well

Screenshot 2021-05-26 at 21 48 59

@skorfmann
Copy link
Contributor Author

Go seems to pick up the resource level link, but not the attribute level ones. But that's close enough for now.

@skorfmann
Copy link
Contributor Author

csharp works as well 🎉

Screenshot 2021-05-26 at 21 55 32

@skorfmann skorfmann modified the milestones: v0.5, v0.4 May 26, 2021
@ansgarm
Copy link
Member

ansgarm commented May 27, 2021

This is awesome 💯

@skorfmann skorfmann merged commit 68ad515 into main May 27, 2021
@skorfmann skorfmann deleted the link-to-docs branch May 27, 2021 15:01
@github-actions
Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems related to this change, 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 Dec 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants