DoxyGen is a jack of all trades document generation tool, which does work with C# (and C++, C, Java, PHP, Fortran...) we tried this but for some reason it doesn't resonate with the developers that I work with and really when you think about it. Why doesn't Visual Studio (which we use for everything as we're a windows .Net development shop) have built in documentation tools?
C# is Microsoft's language and they added the ability to document your code with \\\ style comments. Unfortunately the ability to get comments out of the code into some form that is appropriate for documenting an API, has been ignored or rather, not yet standardized or implemented or whatever excuse MS wishes to use.
A bit of poking around reveals that MS has their own tool which they use to generate their MSDN API documentation, Sandcastle. Sandcastle is possibly the most poorly documented project in existence. (In fact I wondered if it was a deliberate attempt at irony but then just remembered how lazy developers are). Thankfully there are some other kind souls out there that have bludgeoned through figuring out how to use Sandcastle and they developed Sandcastle Help File Builder which is a GUI for running Sandcastle and also gives you the ability to generate .chm files if you so desire.
In my case we just want the HTML output as we're going to be hosting it on a webserver. Playing around a little but with SHFB (namely changing the HelpFileFormat) allows me to get output as a webpage instead of the default .chm output format. This is pretty good, but we needed to get it styled up so that it fitted in with the rest of our sites. No worries, I'll just read through the documentation on how to do it.
Creating New Presentation Styles
TODO - recommendations and examples on creating new presentation styles (generally inherit from an existing style)Ahhhhh, hmmm, did I tell you how awesome the documentation for this is?
It turns out that the best way to change the design and style is to copy and existing style and modify it with the additional complication that SHFB requires that the new style contain the name of the style that you have copied (go figure that one out....).
So after figuring it all out I found this post which pretty much explains everything and could have saved me a little bit of time. Anyway, the basic steps are as follows
- Install Sandcastle and SHFB and its prerequisites.
- Open up SHFB and start a new project.
- Select the sources you want to use by "Adding Documentation Sources"
- Tweak the settings as desired.
- Click build.
- The output will open in a new browser window.
Next step is to figure out how to customise the header fully, currently we seem to be only allowed to change the text and perhaps stick an image in using the Post-Transform Component perhaps that will be sufficient for us.
No comments:
Post a Comment