SandCastle documentation cleaner.






1.80/5 (2 votes)
Sep 9, 2006
2 min read

18492

169
Cleans the "extra" documented text out of your SandCastle built documentation.

Introduction
It all started when I found out that the documentation generated by SandCastle was showing internal code (those members marked as 'internal' and 'internal protected'). Of course this was unwanted. So with my magic regular expression wand and an observant eye, I created some regex that would "clean" the comments. Then I went a step further and had it clean the MS stuff out also. I present to you the culminated version.
These are just the regular expressions used to match the xml that contains the unwanted code (multi-line mode should be used):
(\s*)<element api=\"F:(.*)/> (cleans any internal members)
(\s*)<element api(.*)System.Web.UI(.*)/> (cleans MS doc stuff)
(\s*)<element api=(.*)(EXTRA_STUFF_HERE)(.*)/> (takes any extra)
The CastleCleaner is designed to parse and remove all traces of members marked as internal, comments from the System.Web.UI namespace, and extra stuff you type into the "Remove" field.
The remove field uses the pipe ( | ) delimited case-sensitive text to "clean" any other code with that member name.
FYI: The output is written to the input file. Usage:
The only way that I have implemented the CastleCleaner has been via a 'PAUSE' after the MRefBuilder generates its output file. During the pause I find the generated MRegBuilder file and drop it into the CastleCleaner window. And in about two seconds (depending on the input) it rewrites the freshly baked and cleaned file.
So that is what I recommend you do. Batch File Example:
cd "c:\project\bin\Debug"
MRefBuilder "C:\project\bin\Debug\project.dll" /out:reflection.org
PAUSE
.... Remove Field Example:
InternalProtectedMember|AnyOtherMember|AnotherMember_I_WantCleaned License / Warranty:
License: Use it as you see fit, but please give credit to me (C. Bess).
Warranty: Be realistic... Its free for all. Side Notes:
The CastleCleaner (when used as directed) makes the documentation a lot more "personal" and it actually speeds up the generation (of course).