<% var aTopicList: THndTopicsInfoArray; sTopicUrl: string; nCurTopic, nBlocLevel, nTopicKind, nCurTopicLevel, nCurTopicChildrenCnt: Integer; nDif, nClose: Integer; begin // Need BOM for UTF8 files HndGeneratorInfo.BOMOutput := True; // Change current file HndGeneratorInfo.CurrentFile := 'OEBPS\_toc.html'; // Lists aTopicList := HndTopicsEx.GetTopicListGenerated(True, False); // Avoid syntax error println(''); %> <% print(HTMLEncode(HndGeneratorInfo.GetCustomSettingValue('TocTitle'))); %>

<% print(HTMLEncode(HndGeneratorInfo.GetCustomSettingValue('TocTitle'))); %>

<% // Topics nBlocLevel := 0; for nCurTopic := 0 to length(aTopicList) - 1 do begin HndGeneratorInfo.CurrentTopic := aTopicList[nCurTopic].id; nTopicKind := aTopicList[nCurTopic].Kind; nCurTopicLevel := HndTopics.GetTopicLevel(HndGeneratorInfo.CurrentTopic); nCurTopicChildrenCnt := HndTopicsEx.GetTopicDirectChildrenCountGenerated(HndGeneratorInfo.CurrentTopic, True); // Topic URL if nTopicKind = 1 then sTopicUrl := '_empty.html' // Empty else sTopicUrl := format('%s.html', [aTopicList[nCurTopic].HelpId]); // Normal topic // Close the previous topics if ((nCurTopic > 0) and (nCurTopicLevel < HndTopics.GetTopicLevel(aTopicList[nCurTopic - 1].id))) then begin nDif := HndTopics.GetTopicLevel(aTopicList[nCurTopic - 1].id) - nCurTopicLevel; for nClose := 0 to nDif - 1 do begin print('
'); nBlocLevel := nBlocLevel - 1; end; end; printfln('
', [nBlocLevel]); printfln('%s', [sTopicUrl, HTMLEscape(aTopicList[nCurTopic].caption)]); if (nCurTopicChildrenCnt > 0) then nBlocLevel := nBlocLevel + 1 else println('
'); // Close the last topic if (HndTopicsEx.GetTopicNextGenerated(HndGeneratorInfo.CurrentTopic, True) = '') then begin while nBlocLevel > 0 do begin print(''); nBlocLevel := nBlocLevel - 1; end; end; end; %> <% end. %>