The Version Information Component is used to extract version information from the reflection information file and pass it on to the PostTransformComponent so that it can be inserted into the help topic. The functionality in this component used to be integrated with the PostTranformComponent itself. However, looking up the version information after transformation of the topic proved to be too slow. Moving the lookup so that it occurs before transformation allows for an optimized lookup of the version information and the whole reflection file does not need to be loaded thus reducing memory usage for large builds and speeding up the searches for version information.
This component must be paired with the PostTransformComponent as it is used to insert the version information into the topic after the transformation to HTML. |
The following is the default configuration for the version information component. It should be inserted into the configuration file before the TransformComponent.
<!-- Version information component configuration. This must appear before the TransformComponent. See also: PostTransformComponent --> <component type="SandcastleBuilder.Components.VersionInfoComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll"> <!-- Reflection information file for version info (required) --> <reflectionFile filename="reflection.xml" /> </component>
The example given above is taken from the Sandcastle Help File Builder's configuration file. When used with it, the replacement tag {@SHFBFolder} is used to insert the help file builder's folder in the file path. This is replaced at build time with the appropriate value. If using the component in your own build scripts, replace the tag with a relative or absolute path to the component assembly. The reflectionFile element is required and should contain the path to the reflection information file.
The help file builder contains the necessary overrides in its shared content files to add version information. If you use this component in your own scripts or build tools, you will need to make a copy of the help file builder's shared content file or modify the Sandcastle reference content files in order to add the version parameter. To do so, add the text "Version: {2}" to the locationInformation entry in the reference_content.xml file for the Prototype, VS2005, and Hana styles and "Version: {3}" to the assemblyNameAndModule entry in the reference_content.xml file for the VS2005 and Hana styles.