Skip to main content
net6.0net7.0

A library for reading .NET XML documentation files.

Published
Dec 12, 2022
3y ago
Total Downloads
1.3K
1,277

Install

dotnet add package Grynwald.XmlDocs --version 1.0.6
ProductVersions
.NET
net6.0net7.0

README

Grynwald.XmlDocs

Table of Contents

Overview

C# source code can have structured comments to provide inline API documentation. These comments are saved by the compiler as an XML documentation file.

The Grynwald.XmlDocs package provides a library for parsing these comments into a .NET object model.

Usage

To parse an XML documentation file, first reference the Grynwald.XmlDocs package in your project.

Load the documentation file using the DocumentationFile class:

using Grynwald.XmlDocs;

// Load XML documentation file
var documentationFile = DocumentationFile.FromFile("./MyAssembly.xml");

Alternatively, you can parse individual elements directly, e.g. to parse a <member /> node from the documentation file, use

using Grynwald.XmlDocs;

var memberXml = """
    <member name="T:ExampleProject.ExampleClass">
        <summary>
            XML documentation file example
        </summary>            
    </member>
    """

var member = MemberElement.FromXml(memberXml);

To process the documentation file, the library provides support for the Visitor pattern. To create a visitor, either implement IDocumentationVisitor directly or derive from the default implementation DocumentationVisitor and override the Visit() method for the documentation element you want to process.

License

Grynwald.XmlDocs.MarkdownRenderer is licensed under the MIT License.

For details see https://github.com/ap0llo/xmldocs/blob/master/LICENSE

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

Compatibility metadata lists 2 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.