[codegen/docs] Link to Pulumi.Input-1.html when generating the doc link for the Pulumi.Input type. (#5187)

This commit is contained in:
Praneet Loke 2020-08-19 11:21:54 -07:00 committed by GitHub
parent 92c0d1dc30
commit e3b436211d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,7 +36,17 @@ var _ codegen.DocLanguageHelper = DocLanguageHelper{}
// GetDocLinkForPulumiType returns the .Net API doc link for a Pulumi type.
func (d DocLanguageHelper) GetDocLinkForPulumiType(pkg *schema.Package, typeName string) string {
return fmt.Sprintf("/docs/reference/pkg/dotnet/Pulumi/%s.html", typeName)
var filename string
switch typeName {
// We use docfx to generate the .NET language docs. docfx adds a suffix
// to generic classes. The suffix depends on the number of type args the class accepts,
// which in the case of the Pulumi.Input class is 1.
case "Pulumi.Input":
filename = "Pulumi.Input-1"
default:
filename = typeName
}
return fmt.Sprintf("/docs/reference/pkg/dotnet/Pulumi/%s.html", filename)
}
// GetDocLinkForResourceType returns the .NET API doc URL for a type belonging to a resource provider.