% 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); %>