Code templates are very similar to CHM and HTML templates except for the fact that they usually won't need access to the topic's contents and can't access to their HTML content. Here are the steps involved to create a code template:

  • Create a new folder under "My Documents\HelpNDoc\Templates\Code" with the name of the new template
  • Create a new file in that template folder and add the required name, category and extension
  • Create a new file containing the ".pas" text before the extension. As an example, we will create a "sample.pas.txt" file. Only files containing the ".pas" text will be interpreted by HelpNDoc
  • Add sample code to that template

In HelpNDoc, the new code template will appear in the "Code Generation" category of the "Generate help" popup menu in the "Project" section of the "Home" ribbon tab.