* --css-file now also for html (Mantis 17542)

git-svn-id: trunk@16266 -
This commit is contained in:
marco 2010-10-30 16:52:37 +00:00
parent 38b90c987b
commit a5d7d58f47
2 changed files with 19 additions and 3 deletions

View File

@ -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;

View File

@ -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