Windows Live Alerts
Welcome to MSDN Blogs Sign in | Join | Help

Sandcastle

Documentation compilers for managed class libraries
Supporting Custom tags in Sandcastle

Sandcastle supports C# (and VB) xml tags for developer documentation comments. The list of c# tags are available at http://msdn2.microsoft.com/en-us/library/5ast78ax.aspx. We added the following new custom nDoc tags in November CTP (http://www.microsoft.com/downloads/details.aspx?FamilyId=E82EA71D-DA89-42EE-A715-696E3A4873B2&displaylang=en):

 

1.            <overloads>

2.            <preliminary>

3.            <threadsafety>

4.            <note>

 

These custom tags are supported in nDoc and you can see the tags under tag reference section at http://ndoc.sourceforge.net/usersguide.html.

 

This blog provides details on how to define your custom tags. To support custom tags the user can modify the presentation transforms (XSLT) that are shipped with Sandcastle. The following steps provides details:

 

1)         Add the custom tag to the code in C# file [test.cs]:

 

 

            /// <customTag>This is a custom tag.</customTag>

            public class StoredNumber

            {

            }

 

2)         Compile the C# file and extract the /// comments to, say comments.xml.

 

           

            csc /t:library /doc:comments.xml test.cs

                       

            The custom tag will be included in the XML.

 

3)         Update main_sandcastle.xsl with the following:

 

            <xsl:template name="body">

  <!--Add this depending on where we want our custom tag to be displayed-->

  <xsl:apply-templates select="/document/comments/customTag" />

</xsl:template>

 

<xsl:template match="customTag">

  <!--Customstyle can be defined in Presentaion.css stylesheet-->

  <div class="CustomStyle">

    <xsl:apply-templates />

  </div>

</xsl:template>

 

            The resulting page for the topic would look like the following with custom tag at the top of the page:


Custom Tags


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Posted: Wednesday, November 22, 2006 1:28 AM by aram
Filed under: ,

Comments

Gael Fraiteur said:

Hi Anand,

This feature calls the following question: if I modify Sandcastle XSL files, can I distribute the modified version? The current answer is, I think, no, because the file is licensed as a part of the software, under  "don't modify" and "don't distribute" clauses. It would be necessary to release the XSL files under a more liberal license, or, the best, under the public domain.

Otherwise the 'custom tags' feature cannot be used legally...

Gael

# November 22, 2006 2:54 PM

aram said:

Good point Gael. I will check this with Microsoft legal contact and will let you know.

We cannot meet all the custom tags and this is the bext way to go. I will see if we can exclude the presentation tansforms from the license.

Anand..

# November 22, 2006 3:19 PM

CoqBlog said:

Un post sur le blog de Sandcastle explique comment gérer les tags personnalisés, en particulier la modification

# November 25, 2006 6:41 PM

Jan Schreuder on .Net said:

About two weeks ago, Microsoft have released a new CTP for Sandcastle . For those still in the dark,

# November 27, 2006 2:46 AM

CoqBlog said:

Un post sur le blog de Sandcastle explique comment gérer les tags personnalisés, en particulier la modification

# December 10, 2006 5:11 PM

Dave Sexton's Blog said:

The DocProject 1.9.0 Release Candidate is now available on CodePlex. I'm still working on updating the

# November 7, 2007 2:58 PM
Anonymous comments are disabled

Page view tracker