Share via


Visual Studio: Creating Framework Documentation with Ghostdoc Extension

Introduction

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 see the difference see this reference.

Adding comments

One advantage about the GhostDoc Free is, if you follow good naming conventions in your code, then you will get very decent results on the summary GhostDoc generates.  When we see code that is not documented, it is as simple as hit 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 these tools there isn't a reason for not putting comments in your code.

GhostDoc Pro, has more feature about it, like:

  • XML Comment Preview
  • Document This
  • Document File
  • Document Type

and others….

Building Helper File

After the code is commented is great to have a helper for provide with the framework, and GhostDoc Pro has the Build Helper File feature for generate helper files based in 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

Output

The chm file is good for offline usage and the website is useful for publishing the framework online. In this case, in Xamarin-Forms-Labs** **project, there isn't any website and only exist the Github repository and for help to expose the helper online, was used the

GitHub & BitBucket HTML Preview

For see the results, see the following reference:

 

See also

If you want to see GhostDoc in practice, see this overview

Introduction to GhostDoc Pro

http://c.statcounter.com/10000073/0/823db7eb/1/