This project has moved. For the latest updates, please go here.

A More Useful RootNameSpaceContainer

Topics: Developer Forum, User Forum
Oct 15, 2007 at 3:39 PM

I've got a question and I'm sorry if it's obvious to people who have been working with Sandcastle for a while. I'm trying to document some rather long namespaces, and I'd like to use the root namespace to make the names a bit shorter. For example, given the namespaces:


I could just have Company.Division.Group as the root namespace and then Common and Data would be in the expanded tree. As I see it now, it'll give me Company.Division.Group as the root namespace, but it doesn't print the shorter namespaces. Is there currently a way to accomplish this?

Thanks in advance.
Oct 15, 2007 at 5:18 PM
Sandcastle doesn't support a hierarchical namespace structure in the TOC. You'd could write a help file builder plug-in that modifies the TOC structure to suit your needs.

Oct 16, 2007 at 7:14 PM
Sorry, I don't really have the time to write a plugin at this point. However, I was able to get a decent workaround.

I only have one namespace that I want to shortcut, and it's the root of everything. Also, I'm only interested in publishing to a website, so this isn't going to apply to everyone. However, with some simple regex replacements on WebTOC.xml, I got exactly what I wanted. For anyone interested, here's the regex I used:


Replace that with String.Empty, set the RootNameSpaceContainer to "Company.Division" and you're good to go.

Again, not exactly applicable for everyone, but I hope that someone finds it useful.