Enhance XML doc rendering for NamespaceDoc and list elements - #32
Merged
Conversation
Two XML-doc rendering fixes for the .NET pipeline: * NamespaceDoc <remarks> and <example> are now surfaced for namespace descriptions (previously only <summary>). Introduces a NamespaceDescription record carrying summary/remarks/example, emitted by both the single-file and gradual-disclosure emitters. * XML doc <list> elements now render as Markdown: bullet, numbered, and table lists with <item>/<term>/<description>/<listheader>. Table cells escape literal pipe characters to keep tables well-formed. Adds fixtures and regression tests (255 tests pass on net8.0/net9.0/net10.0), and updates requirements, design, and verification artifacts with full reqstream traceability. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Enhances ApiMark’s .NET XML documentation pipeline by (1) promoting full namespace-level documentation from NamespaceDoc carrier types (summary + remarks + structured examples) into the parsed model and emitted Markdown, and (2) rendering XML <list> elements into Markdown list/table equivalents.
Changes:
- Extend
XmlDocReaderto render<list type="bullet|number|table">into Markdown (including term/description formatting and table cell escaping). - Replace namespace description strings with a structured
NamespaceDescriptionmodel, and emit summary/remarks/examples for namespaces in both gradual-disclosure and single-file formats. - Add fixtures, tests, and update design/verification/reqstream/user-guide docs to specify and validate the new behaviors.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/ApiMark.DotNet.Tests/XmlDocReaderTests.cs | Adds unit coverage for <list> rendering in <remarks> (bullet/number/table, escaping, nesting, spacing). |
| test/ApiMark.DotNet.Tests/DotNetGeneratorTests.cs | Adds end-to-end generator tests for NamespaceDoc remarks/examples and list rendering through emit. |
| test/ApiMark.DotNet.Tests/DotNetEmitterSingleFileTests.cs | Verifies single-file emitter outputs namespace remarks/examples and renders list tables. |
| test/ApiMark.DotNet.Tests/DotNetEmitterGradualDisclosureTests.cs | Verifies gradual-disclosure emitter outputs namespace remarks/examples and renders numbered lists. |
| test/ApiMark.DotNet.Fixtures/NamespaceDoc.cs | Extends NamespaceDoc fixture with <remarks> and <example><code>. |
| test/ApiMark.DotNet.Fixtures/ListDocClass.cs | Introduces fixture types containing <list> XML in remarks for integration testing. |
| src/ApiMark.DotNet/XmlDocReader.cs | Implements <list> element rendering to Markdown and integrates it into XML doc text dispatch. |
| src/ApiMark.DotNet/DotNetGenerator.cs | Extracts namespace summary/remarks/examples from NamespaceDoc carriers into a NamespaceDescription. |
| src/ApiMark.DotNet/DotNetEmitterSingleFile.cs | Emits namespace summary, remarks, and structured example parts in single-file output. |
| src/ApiMark.DotNet/DotNetEmitterGradualDisclosure.cs | Emits namespace summary, remarks, and structured example parts in namespace pages and uses summary in index tables. |
| src/ApiMark.DotNet/DotNetAstModel.cs | Adds NamespaceDescription record and updates model/context types to use it. |
| docs/verification/api-mark-dot-net/xml-doc-reader.md | Updates verification claims and scenarios for <list> rendering. |
| docs/verification/api-mark-dot-net/type-link-resolver.md | Updates verification bullets/scenarios (nullable/array behaviors) for the resolver doc. |
| docs/verification/api-mark-dot-net/dot-net-generator.md | Updates verification bullets/scenarios for NamespaceDoc remarks/examples and list rendering. |
| docs/verification/api-mark-dot-net/dot-net-emitter-single-file.md | Updates verification bullets/scenarios for namespace remarks/examples and list-table output. |
| docs/verification/api-mark-dot-net/dot-net-emitter-gradual-disclosure.md | Updates verification bullets/scenarios for namespace remarks/examples and numbered-list output. |
| docs/reqstream/api-mark-dot-net/xml-doc-reader.yaml | Adds requirement coverage for rendering <list> elements as Markdown. |
| docs/reqstream/api-mark-dot-net/dot-net-generator.yaml | Adds requirement coverage for extracting NamespaceDoc remarks/examples. |
| docs/reqstream/api-mark-dot-net/dot-net-emitter-single-file.yaml | Adds requirement coverage for emitting NamespaceDoc remarks/examples in single-file output. |
| docs/reqstream/api-mark-dot-net/dot-net-emitter-gradual-disclosure.yaml | Adds requirement coverage for emitting NamespaceDoc remarks/examples in gradual-disclosure output. |
| docs/reqstream/api-mark-dot-net.yaml | Wires new requirement IDs into the root .NET reqstream index. |
| docs/design/api-mark-dot-net/xml-doc-reader.md | Documents the new <list> rendering rules and limitations in the XML doc reader design. |
| docs/design/api-mark-dot-net/dot-net-generator.md | Documents the new namespace doc extraction into NamespaceDescription. |
| docs/design/api-mark-dot-net/dot-net-emitter-single-file.md | Documents namespace remarks/examples emission order in single-file output. |
| docs/design/api-mark-dot-net/dot-net-emitter-gradual-disclosure.md | Documents namespace remarks/examples emission order in gradual-disclosure output. |
| docs/design/api-mark-dot-net/dot-net-ast-model.md | Documents the new NamespaceDescription record and updated NamespaceDescriptions shape. |
| docs/design/api-mark-dot-net.md | Updates high-level design overview to mention NamespaceDoc remarks/examples promotion. |
| docs/user_guide/dotnet.md | Updates user guide for NamespaceDoc capabilities and documents <list> support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The <listheader> XML-doc element name is genuine project vocabulary introduced by the XML doc list rendering feature. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Skip empty <item> entries in bullet/numbered lists and fully-empty rows in table lists so no stray '- '/'1. ' markers or blank rows are emitted. * Fall back to <remarks> (collapsed to a single line) when a namespace's NamespaceDoc <summary> is absent, in both the all-namespaces index table and the child-namespace table, via a shared helper. * Correct the user guide to describe the namespace <example> as structured parts (prose paragraphs and fenced code blocks). Adds regression tests (259 tests pass on net8.0/net9.0/net10.0). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request significantly enhances namespace-level documentation in the API Markdown generator by extracting and emitting
<remarks>and<example>content fromNamespaceDoccarrier classes, not just<summary>. It also introduces support for rendering XML<list>elements as Markdown lists or tables, and updates the data model and requirements to reflect these capabilities.Namespace documentation improvements:
NamespaceDoccarrier classes now have their<remarks>and<example>content extracted and included in the namespace description dictionary, alongside<summary>. This ensures that all authored namespace documentation is available for output. [1] [2] [3] [4]DotNetAstModeldata structure replaces the namespace description value from a single summary string to aNamespaceDescriptionrecord, bundling summary, remarks, and structured example parts. [1] [2] [3]XML documentation rendering enhancements:
<list>elements (of type bullet, number, or table) as proper Markdown lists or tables, preserving the structure and formatting intended by the author. [1] [2] [3]Requirements and documentation updates:
These changes ensure that namespace documentation is comprehensive and that XML documentation features are faithfully represented in the generated Markdown.