XML Docs to Markdown

2025-11-10 C# .NET documentation xml XmlDocMarkdown xmldocmd markdown gitlab

I wrote about C# xml documentation comments before. As we are using Gitlab for the workflow and documentation, I wanted to automatically generate markdown documentation for libraries and nuget packages.

Turns out there is several tools for this. After a trial and error I picked XmlDocMarkdown.

The installation is rather simple

dotnet tool install xmldocmd -g

Then in your project run

xmldocmd path_to_bin\library.dll doc

It generates a directory structure in doc directory with markdown files for the assembly, its namespaces, all classes and their members. It properly marks code blocks as C#, so they are nicely syntax-highlighted in Gitlab.