Skip to content

Improve documentation on default value forms #9057

@glopesdev

Description

@glopesdev

The article https://github.com/dotnet/templating/wiki/Naming-and-default-value-forms is misleading in at least two ways:

  1. The convention on the naming of sourceName is much more rigid than what is implied by the wording in the article. Specifically, using uppercase, lowercase, the . character and the numeric character 1 are all absolutely critical for controlling which exact value form is applied (as discussed in Documentation Improvements #2532 (comment)).

The article states "A good choice for sourceName is the value that produces distinct values under the below transformations, for example Template.1". This is more than just a "good choice", it is actually the exact way you need to use it! The above linked issue was closed as not planned but I have validated all recommendations still hold today and the number of open issues and past discussions suggests confusion still prevails around default value forms, e.g. #6853

  1. Although it describes the convention and the possible default value forms, the article fails to mention they are all actually accessible as built-in value transforms in the templating engine! There is a link for the article on creating new value transforms, but even more useful would be to know which ones exist in the first place.

For example, one option would be using the actual form identifiers in the table, or add an explicit column with the identifiers, e.g.:

  • identity
  • safe_namespace
  • safe_name
  • lower_safe_namespace
  • lower_safe_name

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions