Article

Generate .NET XML Documentation With NDoc

Page: 1 2

NDoc in Action

Now that we have those two files, we can fire up NDoc. You can use NDoc from the command line; however, in order to illustrate the features of NDoc, we will use the GUI in this case.

1289_Fig1

In order to get your documentation, click on the "Add" button. This brings up the "Add Assembly Filename and XML Documentation Filename" dialog. Click on each ellipses button, navigating to the bin directory to select the NDocSample.dll, and to the root directory to select the NDocSample.xml files, respectively.

1289_Fig2

Once you click "OK", NDocSample.dll will be listed under the header "Selected Assemblies to Document".

Moving on, we can now look at the "Select and Configure Documenter" section, which is where most of your work will occur. Under the Documentation Type, you are given the option of creating documentation in the following types: MSDN, JavaDoc, XML, LaTeX (Alpha), Linear HTML (Alpha). I'll choose MSDN, as this is a widely accepted format for my work environment. For information on the other options, refer to the NDoc Website.

For the rest of the "Select and Configure Documenter" section, you can choose a series of properties that you may or may not wish to assign. Of special note are OutputDirectory and OutputTarget. You should set the OutputDirectory to the "docs" directory, which should be created under the root of the project. When you select OutputTarget, you're given three choices:

  1. HtmlHelp - generates a .chm file, as well as the supporting html files

  2. Web - generates a series of html files, index.html being the starting file

  3. HtmlHelpAndWeb – generate both sets of documentation listed above


Below, you can see that we have filled in some of our properties. Now, we're ready to build.

1289_Fig3

Simply click the "Build" button or Ctrl+Shift+B. You can watch the bottom of the NDocGui for feedback about what's going on. When it's complete, you will see "Ready" in the lower left corner.

Now, go into your docs directory to see the files that were generated. As I opted for the HtmlHelp version, I will locate the .chm file and fire it up.

1289_Fig4

Professional systems documentation in a matter of seconds!

Conclusions


You're now ready to try documenting some existing projects. I will leave all the properties for you to investigate, as there are several, and providing a treatment for each is well beyond the scope of this article.

Systems documentation has never been so easy! This is one of those tools that will go a long way in providing professional solutions for your clients, as well as other in-house developers.

Happy documenting!

If you liked this article, share the love:
Print-Friendly Version Suggest an Article

Sponsored Links

Rate This Article

  • 1
    Poor
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
    Great

Comment on This Article

Have something to say?

Post A Comment

You need to be a member of the SitePoint Forums to comment on this post. Sign Up

Already a member? Post using your SitePoint Forums account: