GhostDoc is a Visual Studio extension that automatically generates XML documentation comments for methods and properties based on their type, parameters, name and other contextual information.
GhostDoc has two versions: Free and Pro, for the differences see this reference.
One advantage of the GhostDoc Free version is, if you follow good naming conventions in your code, then you will get very decent results on the summary that GhostDoc generates. When we see code that is not documented, it is as simple as hitting Ctrl-Shift-D to have GhostDoc document it.
Let's see an example!
We will use an open source project, the Xamarin-Forms-Labs.
The PhoneService has a method without comments:
Using GhostDoc Free, we can use Ctrl-Shift-D to comment that method, here is the result:
With this tool there isn't reason to not have comments in our code.
GhostDoc Pro has more features, like:
- XML Comment Preview
- Document This
- Document File
- Document Type
And others....
After the code is commented, it is great to have a helper for provide with the framework and GhostDoc Pro has the Build Helper File feature for generating helper files based on the comments.
Here is the "Build Help File" for Xamarin-Forms-Labs:
Like we can see in the image, we can:
- Define the output folder
- Define the type of the helper file to be generate
- Scope
- Define the header and the footer
- Select the project we want to include in the project
The chm file is good for offline usage and the website is useful for publishing the framework online. In this case, in a Xamarin-Forms-Labs project, there isn´t any website, only the Github repository exists and for help to expose the helper online, was used the:
GitHub & BitBucket HTML Preview
To see the results, see the following references: