<% var aTopicList: THndTopicsInfoArray; nCurTopic, nCurParent, nTopicKind, nHeaderKind, nFooterKind: integer; sCharset, sTopicHeader, sTopicFooter, sRelativeTopic: string; aBreadCrumb: array of String; begin // UTF-8 or project charset ? if HndGeneratorInfo.GetCustomSettingValue('UseCharsetForTopics') then begin // Use project charset HndGeneratorInfo.BOMOutput := False; HndGeneratorInfo.ForceOutputEncoding := True; sCharset := HndProjects.GetProjectCharsetAsHtml(); end else begin // Need BOM for UTF8 files HndGeneratorInfo.BOMOutput := True; sCharset := 'UTF-8'; end; // Output global CSS content HndGeneratorInfo.CurrentFile := 'css\hnd.css'; print(HndProjects.GetProjectCssContent()); // Each individual topics generated... aTopicList := HndTopicsEx.GetTopicListGenerated(False, False); for nCurTopic := 0 to length(aTopicList) - 1 do begin // Notify about the topic being generated HndGeneratorInfo.CurrentTopic := aTopicList[nCurTopic].id; // Topic kind nTopicKind := aTopicList[nCurTopic].Kind; if (nTopicKind = 1) then continue; // Empty topic: do not generate anything // Setup the file name HndGeneratorInfo.CurrentFile := HndTopics.GetTopicHelpId(HndGeneratorInfo.CurrentTopic) + '.htm'; // Topic header nHeaderKind := HndTopics.GetTopicHeaderKind(HndGeneratorInfo.CurrentTopic); sTopicHeader := HndTopics.GetTopicHeaderTextCalculated(HndGeneratorInfo.CurrentTopic); // Topic footer nFooterKind := HndTopics.GetTopicFooterKind(HndGeneratorInfo.CurrentTopic); sTopicFooter := HndTopics.GetTopicFooterTextCalculated(HndGeneratorInfo.CurrentTopic); // Create the breadcrumb SetLength(aBreadCrumb, 0); if HndGeneratorInfo.GetCustomSettingValue('ShowBreadCrumbs') then begin sRelativeTopic := HndTopics.GetTopicParent(HndGeneratorInfo.CurrentTopic); while (sRelativeTopic <> '') and (sRelativeTopic <> HndTopics.GetProjectTopic()) do begin SetLength(aBreadCrumb, Length(aBreadCrumb) + 1); aBreadCrumb[Length(aBreadCrumb) - 1] := sRelativeTopic; sRelativeTopic := HndTopics.GetTopicParent(sRelativeTopic); end; end; %> <% print(HTMLEncode(HndTopics.GetTopicCaption(HndGeneratorInfo.CurrentTopic))); %> <% // Redirect for URL and Files topic if (nTopicKind = 2) then begin printf('', [HndTopics.GetTopicUrlLink(HndGeneratorInfo.CurrentTopic)]); end else begin %> <% end; %> <% // Redirect for URL and Files topic if (nTopicKind = 2) then begin printf('Redirecting... click here if nothing happens', [HndTopics.GetTopicUrlLink(HndGeneratorInfo.CurrentTopic)]); end else begin %> <% if nHeaderKind <> 2 then begin %>

<% print(HTMLEncode(sTopicHeader)); %>

<% if Length(aBreadCrumb) > 0 then begin %>
<% for nCurParent := Length(aBreadCrumb) - 1 downto 0 do printf('%s ›› ', [HndTopics.GetTopicHelpId(aBreadCrumb[nCurParent]), HTMLEncode(HndTopics.GetTopicCaption(aBreadCrumb[nCurParent]))]); %>
<% end; %>
<% if HndGeneratorInfo.GetCustomSettingValue('ShowNavigation') then begin %>
<% sRelativeTopic := HndTopics.GetTopicParent(HndGeneratorInfo.CurrentTopic); if (sRelativeTopic <> '') and (sRelativeTopic <> HndTopics.GetProjectTopic()) then begin %> Parent <% end; // Previous topic included in TOC sRelativeTopic := HndTopicsEx.GetTopicPreviousGenerated(HndGeneratorInfo.CurrentTopic, True); if (sRelativeTopic <> '') and (sRelativeTopic <> HndTopics.GetProjectTopic()) then begin %> Previous <% end; // Next topic included in TOC sRelativeTopic := HndTopicsEx.GetTopicNextGenerated(HndGeneratorInfo.CurrentTopic, True); if (sRelativeTopic <> '') and (sRelativeTopic <> HndTopics.GetProjectTopic()) then begin %> Next <% end; %>
<% end; %>
<% end; %>
<% print(HndTopics.GetTopicContentAsHtml(HndGeneratorInfo.CurrentTopic)); %>
<% if nFooterKind <> 2 then begin %> <% end; %> <% end; %> <% end; // for nCurTopic end. %>