var
	aTopicList: THndTopicsInfoArray;
	nCurTopic: integer;

begin
	
	HndGeneratorInfo.CurrentFile := ExtractFileName(HndGeneratorInfo.OutputFile);

	aTopicList := HndTopics.GetTopicList(False);
	
	printfln('// Project: %s', [HndProjects.GetProjectTitle()]);
	println ('// Generated by HelpNDoc - http://www.helpndoc.com');
	println ('');
	printfln ('unit %s;', [ChangeFileExt(ExtractFileName(HndGeneratorInfo.OutputFile), '')]);
	println ('');
	println ('interface');
	println ('');
	println ('const');
	println ('  // Format: HELP_help-id = help-context');
	for nCurTopic := 0 to length(aTopicList) - 1 do
	begin
		printfln('  HELP_%s = %d; %s // Topic: "%s"', [aTopicList[nCurTopic].HelpId, aTopicList[nCurTopic].HelpContext, #09#09#09#09, aTopicList[nCurTopic].Caption]);
	end;
	println ('');
	println ('implementation');
	println ('');
	println ('end.');
	
end.