Skip to content

Reconcile dotnet-api-docs descriptions with dotnet/runtime /// #10722

Open
2 of 6 issues completed
Open

Description

@gewarren

Copilot instructions for backporting docs to /// in dotnet/runtime:

XML Documentation Backport Process:

  1. Source: Extract XML from https://github.com/dotnet/dotnet-api-docs/blob/main/xml/[Namespace]/[Type].xml

  2. .NET Framework-specific remarks/docs/links: Remove any .NET Framework-specific remarks/docs/links. Already removed from this repo.

  3. Remarks for unsupported .NET versions: Remove and discard. Already removed from this repo.

  4. Remarks: Backport all <remarks> from XML, including notes and para elements. Convert XML entities (&lt; → <, &gt; → >).

  5. Code examples:

    • Create a separate .Examples.cs file in src/libraries/[Library]/tests/[Type].Examples.cs. Example file.
    • Use #region RegionName blocks for each example
    • Reference from docs: <code lang="cs" source="[relativepath]/[Type].Examples.cs" region="RegionName" /> (or, in Markdown, [!code-csharp[]([relativepath]/[Type].Examples.cs#[region])])
    • Use relative paths from source file to samples directory (e.g., ../../../../tests/...)
    • Use Assert to verify stated output of the code example, but place that code outside the region that will be included in the docs.
    • (Note: we still need to implement a solution for copying code files to the docs repo - see [Code snippet importer] Add tooling to import code snippet files docs-tools#805.)
  6. Avoid duplication: Only document in shared/CoreCLR files, not in Mono-specific partials unless behavior differs

  7. src vs. ref: Documentation should go in the source implementation files, not the ref assembly

  8. Multiple implementations: For assemblies with multiple runtime-specific, OS-specific, or architecture-specific implementations. Jan's suggestion is to add partial methods to the neutral file and keep the documentation there.

  9. XML syntax conventions:

    • Use <see langword="null"/> for keywords (null, true, false, void)
    • Use <see cref="Type"/> for types and members
    • Use <c>code</c> tags for inline code elements, NOT backticks
    • Use <note type="note"> for notes
    • Use <para> for paragraph breaks in remarks
  10. <xref:> API links, which is a Markdown syntax, don't render in IntelliSense. For Markdown sections, convert xref links to fully qualified HTML links to the API in the form https://learn.microsoft.com/dotnet/api/....

  11. Very lengthy remarks: If remarks are very long, still port them to the dotnet/runtime repo, but put them in a separate "docs" directory and then link there from the ///.

  12. Once all the public types in a given assembly have been documented, remove <UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile> from its .csproj file.

To be done separately:

  • Disable the Edit functionality on learn.microsoft.com by setting open_to_public_contributors to false for the namespace (or individual types if the assembly doesn't encompass the entire namespace) here.
  • Similarly to the previous bullet point, update the GitOps policy that aims to prevent any docs-repo edits to the namespace (or individual types if the assembly doesn't encompass the entire namespace) here.
  • If the assembly doesn't ship as part of the shared framework (it's part of the shared framework if it's listed here), i.e. it ships as a standalone NuGet package, remove the package name from this list.
  • If the assembly does ship as part of the shared framework, add it to the list of XML files to push to the binaries repo for docs CI pipeline ingestion.

Associated WorkItem - 97017

Sub-issues

Sub-issues

2 of 6 Issues completed
Loading 6 sub-issues

Activity

  1. self-assigned this
    on Jun 2, 2023
  2. added
    Pri3
    on Jun 2, 2023
  3. added
    Pri1
    doc-enhancement
    🗺️ reQUEST
    and removed
    Pri3
    on Jun 2, 2023
  4. added
    📌 seQUESTered
    and removed
    🗺️ reQUEST
    on Jun 3, 2023
  5. changed the title [-]Synchronize dotnet-api-docs descriptions to dotnet/runtime ///[/-] [+]Renconcile dotnet-api-docs descriptions with dotnet/runtime ///[/+] on Dec 7, 2023
  6. changed the title [-]Renconcile dotnet-api-docs descriptions with dotnet/runtime ///[/-] [+]Reconcile dotnet-api-docs descriptions with dotnet/runtime ///[/+] on Dec 8, 2023
  7. transferred this issue fromdotnet/docson Dec 4, 2024
  8. ghost added
    needs-area-label
    on Dec 4, 2024
  9. 25 remaining items

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

Metadata

Metadata

Assignees

Labels

📌 seQUESTered🗺️ mapQUESTPri1area-Metadoc-enhancementuntriaged

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions