GhostDoc - Generate documentation
In a previous post, I mentioned that I miss having a working version of NDoc for Visual Studio 2005. And I still do, but that doesn't stop me from documenting my code.
I recently installed Roland Weigelt's GhostDoc. It was featured in James Avery's MSDN article "10 Must-Have Add-Ins" and I thought I'd give it a go. A quote from the GhostDoc website:
GhostDoc is a free add-in for Visual Studio that automatically generates XML documentation comments. Either by using existing documentation inherited from base classes or implemented interfaces, or by deducing comments from name and type of e.g. methods, properties or parameters.
Take for example this method:
public SqlCommand BuildInsertCommand(DataTable dataTable)
{ // Build the SqlCommand
}
When you add XML documentation using the standard method (by typing ///) you would get this:
/// <summary>
///
/// </summary>
/// <param name="dataTable"></param>
/// <returns></returns>
public SqlCommand BuildInsertCommand(DataTable dataTable)
{ // Build the SqlCommand
}
But if you have GhostDoc installed, you simply right-click anywhere inside the method and you get this:
/// <summary>
/// Builds the insert command.
/// </summary>
/// <param name="dataTable">The data table.</param>
/// <returns></returns>
public SqlCommand BuildInsertCommand(DataTable dataTable)
{ // Build the SqlCommand
}
You will see that a lot of stuff is already there. Based on the method name, it already entered a short description. All you need to do is check (and possibly improve) that descrition, explain a bit more on what the parameters are for and add stuff that you think is missing. If this method implements an existing interface, or was used to override a member of an inherited class, GhostDoc would have retrieved the documentation for that member.
The version for Visual Studio 2003 only supports C# code, but the version for Visual Studio 2005 also works on VB.Net. Although Roland still say's that VB.Net support is experimental.
Here are some more links on GhostDoc I found at Roland's website:
All I need now is a working version of NDoc 2005. A Beta is available at SourceForge, but I can't get it to work. It claims it is missing xslt files. Guess I'll have to wait for the final version.