C
C#5w ago
Treycos

✅ Including documentation of the STL in a custom override

Hey there 👋 We're building a library that acts as a limited superset of the C# Standard Library We'd have a method called FooMathMin that uses Math.Min internally with some post-processing. It should have its own documentation followed by Math.Min's original documentation if possible The most obvious way to do so seems to use the <include/> directive (https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/documentation-comments#d36-include) but the documentation is somewhat vague on which path & file to use Is there a simple way to do this ?
Documentation comments - C# language specification
This appendix describes XML comments that are used to document your program.
8 Replies
ero
ero5w ago
i don't believe you can mix documentation comments you either use include/inheritdoc or the other tags (someone can correct me)
SleepWellPupper
I can't verify this right now but could you try using <inheritdoc cref="foo"/> in a <remarks> section of your docs comment? Where foo is Math.Min I suppose
ero
ero4w ago
@Treycos it looks like exactly this is possible you can even refine it by specifying path="/summary so what you'd do is:
/// <summary>
/// My awesome summary.
/// <inheritdoc cref="Math.Min(byte, byte)" path="/summary" />
/// </summary>
/// <summary>
/// My awesome summary.
/// <inheritdoc cref="Math.Min(byte, byte)" path="/summary" />
/// </summary>
actually you don't even need to specify the path there cool
Treycos
TreycosOP4w ago
That would be perfect, thanks !
ero
ero4w ago
recommend adding breaks (<br/>) or a separate paragraph (<para>) for the inherited documentation $close
MODiX
MODiX4w ago
If you have no further questions, please use /close to mark the forum thread as answered
SleepWellPupper
Awesome
Treycos
TreycosOP4w ago
Works great !
Want results from more Discord servers?
Add your server