<% var aTopicList: THndTopicsInfoArray; var nCurTopic, nCurParent, nCurKeyword, nTopicKind, nHeaderKind, nFooterKind: integer; var sTopicHeader, sTopicFooter, sTopicContent, sRelativeTopic: string; var aBreadCrumb: array of String; var aTopicKeywords: array of string; // Returns the description of the topic function GetTopicDescription: string; begin // Get value Result := HndTopics.GetTopicDescription(HndGeneratorInfo.CurrentTopic); // Empty ? Use project's description instead if (Result = '') then Result := HndProjects.GetProjectSummary; end; // Return the topic extension, starting with a dot function GetTopicExtension: string; begin Result := Trim(HndGeneratorInfo.TemplateInfo.TopicExtension); if ((Length(Result) > 0) and (Result[1] <> '.')) then Result := '.' + Result; end; begin // Need BOM for UTF8 files HndGeneratorInfo.BOMOutput := True; // Output global CSS content HndGeneratorInfo.CurrentFile := 'css\hnd.css'; print(HndProjects.GetProjectCssContent()); // Clear search data HndJsSearchEngine.ClearSearchData(); // Each individual topics... 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 := HndTopics.GetTopicKind(HndGeneratorInfo.CurrentTopic); if (nTopicKind = 1) then continue; // Empty topic: do not generate anything // Setup the file name HndGeneratorInfo.CurrentFile := aTopicList[nCurTopic].HelpId + GetTopicExtension(); // Topic header nHeaderKind := HndTopics.GetTopicHeaderKind(HndGeneratorInfo.CurrentTopic); sTopicHeader := HndTopics.GetTopicHeaderTextCalculated(HndGeneratorInfo.CurrentTopic); // Topic footer nFooterKind := HndTopics.GetTopicFooterKind(HndGeneratorInfo.CurrentTopic); sTopicFooter := HndTopics.GetTopicFooterTextCalculated(HndGeneratorInfo.CurrentTopic); // Topic content sTopicContent := HndTopics.GetTopicContentAsHtml(HndGeneratorInfo.CurrentTopic); // Add Search data HndJsSearchEngine.AddSearchData( sTopicHeader, HndGeneratorInfo.CurrentTopic ); HndJsSearchEngine.AddSearchData( HndUtils.HtmlToText(sTopicContent), HndGeneratorInfo.CurrentTopic ); HndJsSearchEngine.AddSearchData( sTopicFooter, HndGeneratorInfo.CurrentTopic ); // Create the breadcrumb aBreadCrumb.SetLength(0); if HndGeneratorInfo.GetCustomSettingValue('ShowBreadCrumbs') then begin sRelativeTopic := HndTopics.GetTopicParent(HndGeneratorInfo.CurrentTopic); while (sRelativeTopic <> '') and (sRelativeTopic <> HndTopics.GetProjectTopic()) do begin aBreadCrumb.SetLength(Length(aBreadCrumb) + 1); aBreadCrumb[Length(aBreadCrumb) - 1] := sRelativeTopic; sRelativeTopic := HndTopics.GetTopicParent(sRelativeTopic); end; end; // Associated Keywords aTopicKeywords := HndTopicsKeywords.GetKeywordsAssociatedWithTopic(HndGeneratorInfo.CurrentTopic); %> <% 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 begin // Empty topic if (HndTopics.GetTopicKind(aBreadCrumb[nCurParent]) = 1) then begin printf('%s ›› ', [HTMLEncode(HndTopics.GetTopicCaption(aBreadCrumb[nCurParent]))]); end // Normal topic else begin printf('%s ›› ', [HndTopics.GetTopicHelpId(aBreadCrumb[nCurParent]), GetTopicExtension(), HTMLEncode(HndTopics.GetTopicCaption(aBreadCrumb[nCurParent]))]); end; end; %>
<% end; %>
<% if HndGeneratorInfo.GetCustomSettingValue('ShowNavigation') then begin %>
<% sRelativeTopic := HndTopics.GetTopicParent(HndGeneratorInfo.CurrentTopic); if (sRelativeTopic <> '') and (sRelativeTopic <> HndTopics.GetProjectTopic()) then begin %> Parent <% end; sRelativeTopic := HndTopicsEx.GetTopicPreviousGenerated(HndGeneratorInfo.CurrentTopic, True); if (sRelativeTopic <> '') and (sRelativeTopic <> HndTopics.GetProjectTopic()) then begin %> Previous <% end; 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; // Output JS Search engine data HndGeneratorInfo.CurrentFile := 'js\hndsd.js'; print(HndJsSearchEngine.GetJsData()); // Clear the search engine HndJsSearchEngine.ClearSearchData(); end. %>