Powered by discountASP.NET
referal ID: sdtref
Why recommend discountASP.NET?

Archives
Steve Trefethen Steve's RSS Feed Subscribe or via email
What's this?
Contact me Send mail to the author(s)
About Me
View my LinkedIn profile

Add to Google
Subscribe with Bloglines
MCP Microsoft Certified Professional

Falafel Software
Online or OnSite TestComplete Training
Blogroll
Recent Comments
My Online Tools
Stats
Total Posts: 471
This Year: 76
This Month: 1
This Week: 0
Comments: 1660
Tags
Disclaimer
The posts on this weblog are provided �AS IS� with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer�s view in any way.
My most popular blog posts (Q1 2008)
# Sunday, May 11, 2008
« Borland completes the sale of CodeGear | Main | My answer to Apple's iPod Touch is it wo... »

Generating MSDN style documentation using Sandcastle

Posted @ 11:34PM

Categories: Tools

Tags:

ScrewTurn wiki with hosted MSDN style API documentation

To the right is a screenshot of MSDN style documentation created using Microsoft’s SandCastle and SandCastle Help File Builder (SHFB) which is generated as part of a Continuous Integration build running under CruiseControl.NET shown here hosted within a page on a ScrewTurn wiki at a client’s site.

The documentation was created for the EDI Invoicing system I developed. Originally, I’d simply followed the Thoughtworks style for documenting Tasks and Source Control providers but that proved rather time consuming and required a fair amount of hand editing. Using this mechanism the documentation on the wiki is always up-to-date and I don’t have to worry about maintaining lots of static content.

SandCastle Help File Builder to the Rescue

SandCastle Help File Builder GUI

Rather than using SandCastle, Microsoft’s oh-so-slowly-developing documentation tool for managed code, Eric Woodruff has created SHFB which gives SandCastle the user experience you’d expect from Microsoft itself. (btw, if you’re a Borland fan be sure to check out Eric’s Turbo Vision page for a trip down memory lane)

SHFB allows you to create a project, select the desired assemblies, and generated web based MSDN style documentation easily. In fact, SHFB allows you to select from three different web site styles. Be sure to read the Links to Resources section as there are a number of additional tools required. Of course, the same thing is possible with SandCastle itself and if you’re up for it check out this post for details.

Generating API Doc Under Continuous Integration

Since I didn’t want to have to manually regenerate the documentation I setup a CruiseControl.NET task to handle creating the documentation web site which also uses SHFB and looks like this:

<exec executable="C:\Program Files\EWSoftware\SHFB\SandcastleBuilderConsole.exe"> <baseDirectory>c:\work\utilities\edi\help</baseDirectory> <buildArgs>vtalk.shfb</buildArgs> <buildTimeoutSeconds>2400</buildTimeoutSeconds> </exec>

Adding this as a task ensures that the documentation is never out of date with the one minor downside being that the documentation isn’t available during the build but that’s really minor.

Conclusion

If you’ve been holding off using SandCastle or have been looking for tools to make it easier be sure to give SHFB a try as it worked like a charm for me.

What’s your experience with SandCastle been like? Have you tried it?

Monday, May 12, 2008 9:56:56 AM (Pacific Daylight Time, UTC-07:00)
I've used SandCastle to document an API that I did for an in-house project to provide our .NET developers access to some Win32 Delphi data structures. I tried to use the SandCastle binaries directly, but quickly gave up and quickly grabbed SandCastleGui. I want to look at SHFB and see if it has anything over SandCastleGui.

It would be great if SandCastle would work on Win 32 Delphi projects, but not I'm not holding my breath waiting for that to happen. But it is a great tool for generating .NET documentation.
Monday, May 12, 2008 10:35:06 AM (Pacific Daylight Time, UTC-07:00)
Hi Chris,
Thanks for the comment. Delphi's comment format isn't compatible with SandCastle. I work with Adam Markowitz who originally implemented the doc style commenting and there were some issues which lead to the incompatibility. Regardless, it's a very nice feature to have.

Thanks for the link to SandCastleGui I'll have to check that out.
Monday, May 12, 2008 2:48:55 PM (Pacific Daylight Time, UTC-07:00)
Steve,
Not to quibble, but I can't make out much at the resolution of those images. Being able to click for a larger view would be very nice....
Bill
Monday, May 12, 2008 3:17:56 PM (Pacific Daylight Time, UTC-07:00)
Hey Bill,
Yeah, the wiki image is intentionally vague. When I first posted you could click on the image and read the content however I realized after I posted that I don't have permission from the client to publish that content so I decided to immediate yank the larger image. As for SHFB, that could have a larger image and if I get the chance I'll update it.
OpenID
Please login with either your OpenID above, or your details below.
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, strong) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Live Comment Preview