Skip to content

The XML doc section should move to language reference #23540

Closed

Description

@BillWagner

This section is more of a reference section than a programming guide section. So, it should move to the correct location.

As part of the move:

  • The overview section should be updated to include a typical workflow. It should also be more opinionated about its use.
  • The overview section may be one or two articles (Note that some articles are just link pointers, and the "recommended list" includes almost all tags. As such, it's not that helpful.:
    • Typical /// usage and recommended tags
    • Typical processing of the source, and the resulting XML file
  • The reference could be updated along one of two organizations:
    • Tags based on type (class, member, namespace, etc)
    • Alphabetical tags, and where they can be applied.
    • Tags based on scenarios:
      • Tags that describe a type, or member
      • Tags to include code
      • Tags for references
      • Tags for inheriting docs

I think that last organization is the most useful.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Activity

  1. changed the title [-]The XML doc section should move to reference[/-] [+]The XML doc section should move to language reference[/+] on Mar 29, 2021
  2. self-assigned this
    on Mar 29, 2021
  3. BillWagner commented on May 20, 2021

    @BillWagner
    MemberAuthor

    From reading all the issues referenced in the preceding comment, the following themes emerge:

    • Completing the reference tags: Visual Studio intellisense has support for a number of XML / HTML tags in XML comments. The introduction to the reference should list those tags validated by the compiler, those supported by intellisense, and point out that other tags are ignored, but legal.
    • General organization: There's a jumble of reference, recommended tags, how to create the XML file, how to process it. It's difficult for readers to address their scenarios quickly.
    • Examples based on language elements: The examples are tied to the XML tag, not the language elements were those tags would be used.
    • Nuances on parsing: < and > are valid XML, HTML, and C# (for generics). You can add CDATA sections to embed markdown in tags. These are all causes of annoyance for developers writing about their libraries. This theme could include attributes on tags, and XPath expressions for elements like inheritdoc.

    Overall, these issues express a need for more and better examples showing how to add XML comments to libraries. I think the new organization should be:

    • Overview: How to turn on XML file generation. What tags the compiler validates, and what tags are validated by Visual Studio intellisense. Finally, links to tools that generate docs from the XML (docfx, SandCastle, Doxygen).
    • Recommended tags: This page details which tags are recommended, which is largely driven by what tags are displayed in intellisense, and what tags are most common. This will largely map to the recommended tags from the C# spec appendix.
    • Examples: Examples should show how to write XML doc comments for:
      • a class or struct, and a positional record
      • a class that inherits docs from a base
      • a class that inherits some docs from a base or interface
      • generic methods
      • generic classes

    It's important for the examples to show different attributes and elements for links and cross-references, inheriting doc comments, and including external doc files. The examples also must highlight rules for where any of the child tags can and can't be used.

    I think each of the examples should be its own article, however that's something I'll decide based on how long the article is. Each of the examples should include at least one member of each type that could be documented (constructor, method, constant, property, event). In the case of inheriting from an interface, and explicit interface implementation should be included

  4. gewarren commented on May 25, 2021

    @gewarren
    Collaborator
  5. BillWagner commented on Jul 19, 2021

    @BillWagner
    MemberAuthor

    Fixed by #24705

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions