Click here to Skip to main content
Click here to Skip to main content

SandCastle documentation cleaner.

By , 9 Sep 2006
 


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)

Objective:
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).

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

C. Bess
Web Developer
United States United States
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 9 Sep 2006
Article Copyright 2006 by C. Bess
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid