-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Proposal: allow 'href' attributes (particularly in <see> and <seealso> elements) #1764
Comments
I wish we could invest in markdown doc comments instead. XML is not a great format for in-code documentation. |
I saw someone writing their documentation in yaml instead of xml, which is also a bit more human-readable than xml. |
@sharwell this has been open for a while and is labeled |
@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. |
@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. |
see/@href, see/@langword, and seealso/@href were added to the C# 6 standard draft in dotnet/csharpstandard@ffa424a. |
For projects with API documentation such as projects using I wish there was a standard xml node like
|
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.
The text was updated successfully, but these errors were encountered: