Recently I was asked to customize the output that Sandcastle was compiling.  My requirement was as follows:

"I have a custom attribute that I have decorated on my classes. When I use SHFB, the attribute appears on the property's page. I would like the attribute to also appear in the table that is on the class level properties tab. Oh, BTW, I am using Hana style."

Many thanks to Eric Woodruff.  He responded to my post on the Sandcastle Help File Builder discussion.  He pointed me in the right direction initially.

Here are my steps to make the custom attribute appear in the table.

  1. Open the \Presentation\Hana\transforms\utilities_reference.xsl file in your favorite XML editor.  I used Visual Studio 2008.
  2. Find the <xsl:template match="element" mode="member">.  This template controls the member list (Around line 230~).
  3. In the third <td> tag, you will find two <xsl:if>'s.  After the second if, place the following xml (the xsl below the second if).
  4. image
  5. (Optional) You can remove the first set of <xsl:if test=position()...> if you don't want to hard code your parameter names into the output.
  6. Save the utilities_reference.xsl file.
  7. Run Sandcastle Help File Builder program for your project.
  8. The result will look like this.
  9. image

TIP:  If you are interested in all the nodes and attributes in the xml file that is used to produce this API document.  I suggest that you run the SHFB and grab the reflection.xml file.  You have to be quick, SHFB will delete the file once it is finished compiling the help file.

This concludes my customization of API documentation produced from Sandcastle using Sandcastle Help File Builder tool.

Until next time, Happy Coding!