Sfoglia il codice sorgente

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

git-svn-id: trunk@16266 -
marco 14 anni fa
parent
commit
a5d7d58f47
2 ha cambiato i file con 19 aggiunte e 3 eliminazioni
  1. 19 0
      utils/fpdoc/dw_html.pp
  2. 0 3
      utils/fpdoc/dw_htmlchm.inc

+ 19 - 0
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;

+ 0 - 3
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