Here is the solution:
- The template is an XML document. When documenting an object/method or property the focus is on the content rather than on formatting the text. There is one XML file for each object/method/property.
- A WSH script written in jscript parses the XML document and adds syntax highlighting to sample code in the documentation page. Regular expression are used for parsing.
- cross references are added automatically by the same script.
- then a XSL transformation is applied to convert XML source to a HTML document that will be eventually written to disk.
- The whole process is optimized by removing unnecessary operations like generating the HTML when it already exists and is newer than its XML source.
- Finally the HTML documents refers a CSS style sheet to easily change the look.
It goes like this:
XML + JScript-> XML with color syntax and cross references + XSL -> HTML + CSS -> CHM
For local help, the CHM compiler is invoked as a final step and a CHM Help File is generated. All you have to do is launching Build.js script you may find in the archive below.
Prerequisites: In order to build the CHM file you'll need HTML Help Workshop from Microsoft.