Skip to content

Customizations of formatted text. #12

@randyt-responselink

Description

@randyt-responselink

I know it would take a bit of work, but is there any chance of adding support for configuring the templates used for the various parts that are documented?

For example, for the return value, where you have:

if (includeStartingWord)
{
return string.Format("{0} {1}", DetermineStartingWord(returnType), lowerReturnWord);
}

I'd love to be able to set it to something like:

if (includeStartingWord)
{
    return string.Format("An instance of {0} <see cref=\"{1}\"/>", DetermineStartingWord(returnType), lowerReturnWord);
}

If the customized template isn't compatible with the format needed (such as an incorrect number of replacement tokens), then you'd just default to the standard template.

I happen to like to format my documentation like:

/// <summary>
///   Convert an <paramref name="obj"/> to a <see cref="string"/>.
/// </summary>
/// <typeparam name="T">
///   The <see cref="System.Type">Type</see> of <paramref name="obj"/>.
/// </typeparam>
/// <param name="obj">
///   An instance of an implementation of <typeparamref name="T"/> that 
///   is used to represent the object to convert.
/// </param>
/// <returns>
///   An instance of a <see cref="string"/>.
/// </returns>
public static string? ToString<T>(
    [System.Diagnostics.CodeAnalysis.DisallowNull] this T obj 
) => obj.ToString( );

The ability to configure the templates would allow my to customize my documentation however I see fit, and would put the onus on the user instead of us needing to ask for support for indentations or multi-line format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions