The JavaScriptDeclarationSyntaxGenerator is used to add a JavaScript Syntax section to each generated API topic. This version differs from the ScriptSharpDeclarationSyntaxGenerator in that it looks for a <scriptSharp /> element in the <api> node and, if found, only then will it apply the casing rules to the member name. If not present, no casing rules are applied to the member names thus it is suitable for use with regular JavaScript such as that used in AjaxDoc projects.
In order to use this script generator, you should modify the Sandcastle transformation file FixScriptSharp.xsl by adding the following template as the second one in the file. The help file builder uses a modified version of the transformation so that you do not need to apply the change when using it.
<!-- Add a "scriptSharp" element to each API node so that the JavaScript syntax generator will apply the casing rules to the member name. --> <xsl:template match="api"> <xsl:copy> <xsl:apply-templates select="node() | @*" /> <scriptSharp /> </xsl:copy> </xsl:template>
To use the syntax generator, add it to the SyntaxComponent configuration as in the following example:
<component type="Microsoft.Ddue.Tools.SyntaxComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll"> <syntax input="/document/reference" output="/document/syntax" /> <generators> <generator type="SandcastleBuilder.Components.JavaScriptDeclarationSyntaxGenerator" assembly="C:\SandcastleBuilder\SandcastleBuilder.Components.dll" /> </generators> </component>
When using the help file builder, the syntax generator is included automatically when you select the JavaScript option in the SyntaxFilters property.