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

Customizations of formatted text. #12

Open
randyt-responselink opened this issue Nov 23, 2022 · 0 comments
Open

Customizations of formatted text. #12

randyt-responselink opened this issue Nov 23, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@randyt-responselink
Copy link

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.

@d1820 d1820 added the enhancement New feature or request label Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants