<% // *** // * This template is described as a tutorial in HelpNDoc's help file // *** // Variable declarations var // List of topics available in the current project aTopicList: THndTopicsInfoArray; var // Current topic index nCurTopic: Integer; var // Topic level nTopicLevel: integer; // Main program begin // Output BOM for HTML UTF8 files HndGeneratorInfo.BOMOutput := True; // Instruct the generator to generate the desired output file HndGeneratorInfo.CurrentFile := ExtractFileName(HndGeneratorInfo.OutputFile); // Get the list of topics available aTopicList := HndTopicsEx.GetTopicListGenerated(False, False); %> <% print(HTMLEncode(HndProjects.GetProjectTitle())); %> <% if HndGeneratorInfo.GetCustomSettingValue('GenerateToc') then begin %>
<% // Loop through all the topics for nCurTopic := 0 to length(aTopicList) - 1 do begin // Get the topic level nTopicLevel := HndTopics.GetTopicLevel(aTopicList[nCurTopic].Id); // Add the topic title printf('%s', [aTopicList[nCurTopic].HelpId, nTopicLevel, aTopicList[nCurTopic].caption]); end; %>
<% end; %>
<% // Loop through all the topics for nCurTopic := 0 to length(aTopicList) - 1 do begin // Notify about the topic being generated HndGeneratorInfo.CurrentTopic := aTopicList[nCurTopic].id; // Add an anchor to be able to link to that topic printf('', [aTopicList[nCurTopic].helpid]); // Get the topic level nTopicLevel := HndTopics.GetTopicLevel(HndGeneratorInfo.CurrentTopic); // Add the topic title printf('%s', [nTopicLevel, HndTopics.GetTopicHeaderTextCalculated(HndGeneratorInfo.CurrentTopic), nTopicLevel]); // Output the topic content print(HndTopics.GetTopicContentAsHtml(HndGeneratorInfo.CurrentTopic)); end; %>
<% end. %>