This project has moved and is read-only. For the latest updates, please go here.

Conditional inclusion of files and file content

Topics: Developer Forum, User Forum
Jun 15, 2012 at 2:47 PM

I have sandcastle documentation set up in my project and it's all working without issue. I'd now like to be able to do the following two things but can't find seem to find a foothold:

1. I'd like to be able to produce documentation with developer remarks and notations shown (for internal use) but conditionally omit such information for public documentation. Is there a way to do achieve this?

2. Along similar lines I'd like to have internal-only topics as well as public ones. So .aml files that aren't included in the public build.

Any ideas would be greatly appreciated

Jun 15, 2012 at 8:11 PM

There currently isn't any way to conditionally include or exclude comments or topic files.  Regarding #1, that would most likely require a build component that could modify the comments based on a condition of some sort at build time and you may have to wrap the unwanted elements in a parent element or tag them with an attribute of some sort.

Regarding #2, you could probably use MSBuild Condition attributes to include or exclude files in the project but you'd have to manage them by hand as there is no way to set conditions on individual project files either in the standalone GUI or within Visual Studio.  That may be possible by exposing the condition via the file properties but I'd have to check.  The other issue would be propagating those conditions into supporting files such as the content layout file.