Push markdown documentation to NuGet.org

Viewed 800

A couple of months ago it was announced that NuGet supports markdown documentation.

I publish packages to NuGet from Appveyor using their deployment feature. Since publishing the package is already automated, I'm looking for a way to also set the markdown documentation automatically.

The repository which I pack already has a README.md. Is there a way to automatically have that md file pushed with the package to NuGet?

I'd like to avoid manually editing the package to add the markdown doc after pushing.

2 Answers

Thanks to this Stack overflow post this feature has been provided by NuGet, read about it here.

You can include it in the documentation tag: <documentation src="documentation.md" />

Last month (May 2021) the NuGet team announced:

Add a README to Your NuGet Package

Some headlights from the post:

This new capability is still in preview with support starting in .NET SDK 5.0.300 preview, NuGet 5.10 preview 2, and Visual Studio 16.10 preview 2. The easiest way to try this feature today is to install the latest .NET 6 preview or the latest Visual Studio preview.

If you already have a README.md file, including it in your package is as easy as adding a couple lines to your project file for SDK-style projects or nuspec for non-SDK-style projects. If you are new to creating NuGet packages, we recommend going with an SDK-style project.

Related