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:

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.