diff --git a/utils/fpdoc/dw_html.pp b/utils/fpdoc/dw_html.pp index 9ed22a01ec..5caf9a8bc8 100644 --- a/utils/fpdoc/dw_html.pp +++ b/utils/fpdoc/dw_html.pp @@ -89,6 +89,7 @@ type function GetPageCount: Integer; procedure SetOnTest(const AValue: TNotifyEvent); protected + FCSSFile: String; FAllocator: TFileAllocator; CurDirectory: String; // relative to curdir of process BaseDirectory: String; // relative path to package base directory @@ -722,6 +723,8 @@ var i: Integer; PageDoc: TXMLDocument; Filename: String; + TempStream: TMemoryStream; + begin if Engine.Output <> '' then Engine.Output := IncludeTrailingBackSlash(Engine.Output); @@ -742,6 +745,20 @@ begin PageDoc.Free; end; end; + + if FCSSFile <> '' then + begin + if not FileExists(FCSSFile) Then + begin + Writeln(stderr,'Can''t find CSS file "',FCSSFILE,'"'); + halt(1); + end; + TempStream := TMemoryStream.Create; + TempStream.LoadFromFile(FCSSFile); + TempStream.Position := 0; + TempStream.SaveToFile(Engine.output+ExtractFileName(FCSSFile)); + TempStream.Free; + end; end; procedure THTMLWriter.WriteXHTMLPages; @@ -3363,6 +3380,8 @@ begin IndexColCount := StrToIntDef(Arg,IndexColCount) else if Cmd = '--image-url' then FBaseImageURL := Arg + else if Cmd = '--css-file' then + FCSSFile := arg else if Cmd = '--footer-date' then begin FIDF:=True; diff --git a/utils/fpdoc/dw_htmlchm.inc b/utils/fpdoc/dw_htmlchm.inc index dc74d9d76b..a071ef6aba 100644 --- a/utils/fpdoc/dw_htmlchm.inc +++ b/utils/fpdoc/dw_htmlchm.inc @@ -13,7 +13,6 @@ type FTOCName, FIndexName, FDefaultPage: String; - FCSSFile: String; FMakeSearchable, FNoBinToc, FNoBinIndex, @@ -503,8 +502,6 @@ begin FDefaultPage := arg else if Cmd = '--other-files' then FOtherFiles := arg - else if Cmd = '--css-file' then - FCSSFile := arg else if Cmd = '--auto-index' then FAutoIndex := True else if Cmd = '--auto-toc' then