From ad18ccca04b3bef0b849fba258486a9f82dfd5ec Mon Sep 17 00:00:00 2001 From: andrew Date: Wed, 9 Sep 2009 00:50:52 +0000 Subject: [PATCH] * Fixed build_lcl_docs to include files in the lcl subfolders recursively * Added --make-searchable to default fpdoc options when the format is chm git-svn-id: trunk@21630 - --- docs/html/Makefile | 2 +- docs/html/build_chm.bat | 4 ++-- docs/html/build_lcl_docs.lpi | 45 ++++++------------------------------ docs/html/build_lcl_docs.lpr | 30 +++++++++++++++++------- 4 files changed, 32 insertions(+), 49 deletions(-) diff --git a/docs/html/Makefile b/docs/html/Makefile index e52eabbe77..57e7a46a9d 100644 --- a/docs/html/Makefile +++ b/docs/html/Makefile @@ -20,7 +20,7 @@ htmldocs: build_lcl_docs ./$< --outfmt html chmdocs: build_lcl_docs - ./$< --outfmt chm --arg --make-searchable + ./$< --outfmt chm build_lcl_docs: build_lcl_docs.lpi build_lcl_docs.lpr ifeq (${LAZBUILD},) diff --git a/docs/html/build_chm.bat b/docs/html/build_chm.bat index 3889ace78d..5f5f70957c 100644 --- a/docs/html/build_chm.bat +++ b/docs/html/build_chm.bat @@ -7,5 +7,5 @@ REM 1 - Please fix the path in this file for your installation REM 2 - Before running this file, first compile the project build_lcl_docs.lpi REM PATH=D:\programming\fpc\bin\i386-win32\ -build_lcl_docs.exe --outfmt chm --arg --make-searchable -pause \ No newline at end of file +build_lcl_docs.exe --outfmt chm +pause diff --git a/docs/html/build_lcl_docs.lpi b/docs/html/build_lcl_docs.lpi index 1a6fae046a..441af3e3eb 100644 --- a/docs/html/build_lcl_docs.lpi +++ b/docs/html/build_lcl_docs.lpi @@ -2,17 +2,18 @@ - + + + + + - <ActiveEditorIndexAtStart Value="0"/> </General> <VersionInfo> <ProjectVersion Value=""/> - <Language Value=""/> - <CharSet Value=""/> </VersionInfo> <PublishOptions> <Version Value="2"/> @@ -23,7 +24,7 @@ <RunParams> <local> <FormatVersion Value="1"/> - <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/> </local> </RunParams> <Units Count="1"> @@ -31,46 +32,14 @@ <Filename Value="build_lcl_docs.lpr"/> <IsPartOfProject Value="True"/> <UnitName Value="build_lcl_docs"/> - <CursorPos X="19" Y="258"/> - <TopLine Value="231"/> - <EditorIndex Value="0"/> - <UsageCount Value="20"/> - <Loaded Value="True"/> </Unit0> </Units> - <JumpHistory Count="3" HistoryIndex="2"> - <Position1> - <Filename Value="build_lcl_docs.lpr"/> - <Caret Line="10" Column="1" TopLine="1"/> - </Position1> - <Position2> - <Filename Value="build_lcl_docs.lpr"/> - <Caret Line="168" Column="12" TopLine="144"/> - </Position2> - <Position3> - <Filename Value="build_lcl_docs.lpr"/> - <Caret Line="11" Column="6" TopLine="1"/> - </Position3> - </JumpHistory> </ProjectOptions> <CompilerOptions> - <Version Value="5"/> + <Version Value="8"/> <PathDelim Value="\"/> - <CodeGeneration> - <Generate Value="Faster"/> - </CodeGeneration> <Other> <CompilerPath Value="$(CompPath)"/> </Other> </CompilerOptions> - <Debugging> - <Exceptions Count="2"> - <Item1> - <Name Value="ECodetoolError"/> - </Item1> - <Item2> - <Name Value="EFOpenError"/> - </Item2> - </Exceptions> - </Debugging> </CONFIG> diff --git a/docs/html/build_lcl_docs.lpr b/docs/html/build_lcl_docs.lpr index 0cc6e1433f..69200e05fc 100644 --- a/docs/html/build_lcl_docs.lpr +++ b/docs/html/build_lcl_docs.lpr @@ -145,21 +145,33 @@ begin if OutFormat='chm' then begin ArgParams:=ArgParams+' --output='+ ChangeFileExt(PackageName, '.chm') - +' --auto-toc --auto-index' + +' --auto-toc --auto-index --make-searchable' +' --css-file=..'+PathDelim+'fpdoc.css '; end; ArgParams:=ArgParams+' --format='+OutFormat+' '; end; -procedure AddFilesToList(Ext: String; List: TStrings); +procedure AddFilesToList(Dir: String; Ext: String; List: TStrings); var FRec: TSearchRec; Res: Longint; + SubDirs: String; // we dont want the PasSrcDir in this string but the subfolders only begin - Res := FindFirst(PasSrcDir+'*.'+Ext, faAnyFile, FRec); + Res := FindFirst(Dir+'*', faAnyFile, FRec); while Res = 0 do begin - List.Add(FRec.Name); + //WriteLn('Checking file ' +FRec.Name); + if ((FRec.Attr and faDirectory) <> 0) and (FRec.Name[1] <> '.')then + begin + AddFilesToList(IncludeTrailingPathDelimiter(Dir)+FRec.Name, Ext, List); + //WriteLn('Checking Subfolder ',Dir+ FRec.Name); + end + else if Lowercase(ExtractFileExt(FRec.Name)) = Ext then + begin + SubDirs := IncludeTrailingPathDelimiter(Copy(Dir, Length(PasSrcDir)+1, Length(Dir))); + List.Add(SubDirs+FRec.Name); + + end; Res := FindNext(FRec); end; FindClose(FRec); @@ -198,16 +210,18 @@ var begin FileList := TStringList.Create; InputList := TStringList.Create; - AddFilesToList('pas', FileList); - AddFilesToList('pp', FileList); + AddFilesToList(PasSrcDir, '.pas', FileList); + AddFilesToList(PasSrcDir, '.pp', FileList); FileList.Sort; for I := 0 to FileList.Count-1 do begin - InputList.Add('..'+PathDelim+PasSrcDir+FileList[I] + ' -Fi..'+PathDelim+PasSrcDir+'include'); XMLFile := XMLSrcDir+ChangeFileExt(FileList[I],'.xml'); if FileExists(PackageName+PathDelim+XMLFile) then - ArgParams:=ArgParams+' --descr='+XMLSrcDir+ChangeFileExt(FileList[I],'.xml') + begin + InputList.Add('..'+PathDelim+PasSrcDir+FileList[I] + ' -Fi..'+PathDelim+PasSrcDir+'include'); + ArgParams:=ArgParams+' --descr='+XMLSrcDir+ChangeFileExt(FileList[I],'.xml'); + end else WriteLn('Warning! No corresponding xml file for unit ' + FileList[I]); end;