Proposal: allow 'href' attributes (particularly in <see> and <seealso> elements) #8978
Replies: 7 comments 2 replies
-
I wish we could invest in markdown doc comments instead. XML is not a great format for in-code documentation. |
Beta Was this translation helpful? Give feedback.
-
I saw someone writing their documentation in yaml instead of xml, which is also a bit more human-readable than xml. |
Beta Was this translation helpful? Give feedback.
-
@sharwell this has been open for a while and is labeled |
Beta Was this translation helpful? Give feedback.
-
@michael-hawker IIRC, the language team concluded they are more interested in reviewing a complete proposal that addresses many outstanding usability issues related to documentation comments, as opposed to trying to review a bunch of small changes. |
Beta Was this translation helpful? Give feedback.
-
@sharwell isn't this more of a bug than a proposal since other well-known tools in the xmldoc ecosystem support have supported this syntax for a while now? Like DocFX: https://dotnet.github.io/docfx/api/Microsoft.DocAsCode.DataContracts.ManagedReference.LinkType.html It's also called out in our docs here: https://docs.microsoft.com/dotnet/csharp/programming-guide/xmldoc/see It also seems to be supported in Roslyn: https://github.com/dotnet/roslyn/blob/main/src/Features/Core/Portable/DocumentationComments/AbstractDocumentationCommentFormattingService.cs#L324-L345 So I'm even more confused about what's what. |
Beta Was this translation helpful? Give feedback.
-
see/@href, see/@langword, and seealso/@href were added to the C# 6 standard draft in dotnet/csharpstandard@ffa424a. |
Beta Was this translation helpful? Give feedback.
-
For projects with API documentation such as projects using I wish there was a standard xml node like
|
Beta Was this translation helpful? Give feedback.
-
Champion issue: #8979
Motivation
Currently, the C# language does not provide clear facilities for referencing external content addressable by a URI. This leads to confusion among developers regarding the best plan to include such content in documentation:
Detailed design
This proposal involves three components, each of which should be formalized for inclusion in the language specification.
The
href
attribute of documentation comment elements is defined, with the value as a URI. The compiler MAY report a warning if the value is not a valid URI.The
see
andseealso
elements are updated to allow for the use ofhref
attribute. The compiler MAY report a warning if both thecref
andhref
attributes are used for the same reference. The following shows examples of how this may appear:The
see
andseealso
elements are updated to indicate the content of the element, if provided, should be used as the display text of the reference.This change is likely to not require any core changes in the behavior of the compiler. However, tools (including the IDE component of dotnet/roslyn) are likely to require updates to ensure correct presentation of these references.
Beta Was this translation helpful? Give feedback.
All reactions