In this blog on generating builds using Powershell, I provided details on generating a single command wrapper to build CHM and HxS files regardless of where the source assemblies and comments are located. This powershell script provided the following features:
The build script has the following dependencies:
Running the Script
The scbuild.ps1 script can now be used to build a website, in addition to .chm and .hxs files. To build a website use the –BuildWebsite option. For example, to build a website with API documentation for an assembly named test.dll, with comments in comments.xml, use the following command:
scbuild –framework 2.0 –sources test.dll,comments.xml –BuildWebsite
The build result will be in test website. You can use the –name option to specify an output location and root name for the website.
Currently scbuild supports only the default presentation style: -style vs2005. Future versions may support other output styles.
Also note the contents of the web.config file, specifically the <globalization/> element. Make sure to copy the sample definition to your own website, to ensure that non breaking spaces get displayed properly.
The “api” directory contains one ASP.NET content file for each topic and a sitemap that you can merge into the sitemap of an existing website, as shown in the example. At runtime, the sample master page uses a tree view to display the sitemap and a simple content placeholder to display the topics.
To merge the output into your own website, you can copy the api, icons, and styles directories to the target website and include the sitemap into the master sitemap file as appropriate. Or you can use the –WebTemplate option to specify a user defined template that will be copied to the output directory, instead of the Sandcastle sample.
If you want to use the generated sitemap, include the following reference to the API topics in your own sitemap:
Further customization is possible through the –WebBuildConfig option, to specify a custom BuildAssembler config file.
For more information, please refer to the header of the scbuild.ps1 script, which shows a list of all available build options and short descriptions. Hope this helps.