DocToolkit is a .NET library that builds structured documentation models from assemblies and their XML comments. It separates metadata extraction, XML processing, and output generation, enabling you to create custom documentation formats with full control over rendering and presentation.
DocToolkit separates metadata extraction from output generation, giving you full control over the final documentation format:
- Metadata Extraction: Uses reflection-only assemblies via MetadataLoadContext to discover types, members, and relationships
- XML Processing: Parses XML documentation files and transforms them using XSLT stylesheets
- Output Generation: Passes structured models to your custom renderer for final output
- Specialized TextWriters: Built-in HTML and Markdown TextWriter wrappers with minification support
- Customizable URL Management: Built-in support for Azure DevOps Wiki, Microsoft Docs, and DocFx
- Conceptual Topics: Support for standalone documentation topics beyond API reference
- Extensible: Add custom URL schemes, XML transformations, and output formats
Explore the API documentation to learn about all available features of DocToolkit.
Install via NuGet:
dotnet add package Kampute.DocToolkitBasic usage:
// 1. Create a documentation renderer
public class MyDocumentRenderer : DocumentPageRenderer
{
protected override void Render(TextWriter writer, PageCategory category, IModel model)
{
// Your custom rendering logic here
}
}
// 2. Configure the documentation context
using var context = DocumentationContextBuilder
.DevOpsWiki()
.AddAssembly("path/to/MyLibrary.dll")
.AddXmlDoc("path/to/MyLibrary.xml")
.Build();
// 3. Generate documentation
var renderer = new MyDocumentRenderer();
var composer = new FileSystemDocumentationComposer(renderer);
composer.GenerateDocumentation(context, "/output/directory");Contributions welcome! Please follow the existing coding and documentation conventions to maintain consistency across the codebase.
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit changes:
git commit -m 'Add feature' - Push branch:
git push origin feature-name - Open a pull request
Licensed under the MIT License.