mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-26 03:41:36 +01:00
wikiconvert: started fpdoc project file
git-svn-id: trunk@47541 -
This commit is contained in:
parent
f93996caa6
commit
c1e57c70af
@ -111,6 +111,7 @@ type
|
|||||||
procedure SavePage(Page: TW2FPDocPage);
|
procedure SavePage(Page: TW2FPDocPage);
|
||||||
procedure SetPackageName(AValue: string);
|
procedure SetPackageName(AValue: string);
|
||||||
procedure SetRootName(AValue: string);
|
procedure SetRootName(AValue: string);
|
||||||
|
procedure SaveProject;
|
||||||
public
|
public
|
||||||
constructor Create; override;
|
constructor Create; override;
|
||||||
procedure Convert; override;
|
procedure Convert; override;
|
||||||
@ -285,6 +286,52 @@ begin
|
|||||||
FRootName:=AValue;
|
FRootName:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TWiki2FPDocConverter.SaveProject;
|
||||||
|
var
|
||||||
|
sl: TStringList;
|
||||||
|
Filename: String;
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
Filename:=AppendPathDelim(OutputDir)+PackageName+'.xml';
|
||||||
|
sl:=TStringList.Create;
|
||||||
|
try
|
||||||
|
sl.Add('<?xml version="1.0" encoding="utf-8"?>');
|
||||||
|
sl.Add('<docproject>');
|
||||||
|
sl.Add(' <options>');
|
||||||
|
sl.Add(' <option name="auto-index" value="1"/>');
|
||||||
|
sl.Add(' <option name="auto-toc" value="1"/>');
|
||||||
|
sl.Add(' <option name="make-searchable" value="1"/>');
|
||||||
|
sl.Add(' <option name="css-file" value="fpdoc.css"/>');
|
||||||
|
sl.Add(' <option name="charset" value="UTF8"/>');
|
||||||
|
// chm
|
||||||
|
//sl.Add(' <option name="format" value="chm"/>');
|
||||||
|
//sl.Add(' <option name="chm-title" value="Lazarus IDE Help"/>');
|
||||||
|
// html
|
||||||
|
//sl.Add(' <option name="format" value="html"/>');
|
||||||
|
|
||||||
|
sl.Add(' </options>');
|
||||||
|
sl.Add(' <packages>');
|
||||||
|
// chm
|
||||||
|
//sl.Add(' <package name="'+PackageName+'" output="'+PackageName+'.chm"/>');
|
||||||
|
// html
|
||||||
|
sl.Add(' <package name="'+PackageName+'" output="."/>');
|
||||||
|
sl.Add(' <units>');
|
||||||
|
sl.Add(' </units>');
|
||||||
|
sl.Add(' <descriptions>');
|
||||||
|
for i:=0 to Count-1 do
|
||||||
|
sl.Add(' <description file="'+TW2FPDocPage(Pages[i]).WikiFilename+'"/>');
|
||||||
|
sl.Add(' </descriptions>');
|
||||||
|
sl.Add(' </packages>');
|
||||||
|
sl.Add('</docproject>');
|
||||||
|
|
||||||
|
sl.SaveToFile(Filename);
|
||||||
|
if not Quiet then
|
||||||
|
debugln(['fpdoc project file: ',Filename]);
|
||||||
|
finally
|
||||||
|
sl.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TWiki2FPDocConverter.ConvertPage(Page: TW2FPDocPage);
|
procedure TWiki2FPDocConverter.ConvertPage(Page: TW2FPDocPage);
|
||||||
var
|
var
|
||||||
doc: TXMLDocument;
|
doc: TXMLDocument;
|
||||||
@ -371,6 +418,7 @@ begin
|
|||||||
// save
|
// save
|
||||||
for i:=0 to Count-1 do
|
for i:=0 to Count-1 do
|
||||||
SavePage(TW2FPDocPage(Pages[i]));
|
SavePage(TW2FPDocPage(Pages[i]));
|
||||||
|
SaveProject;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
@ -60,7 +60,9 @@ type
|
|||||||
FCodeTags: TKeyWordFunctionList;
|
FCodeTags: TKeyWordFunctionList;
|
||||||
FNoWarnBaseURLs: TStringToStringTree;
|
FNoWarnBaseURLs: TStringToStringTree;
|
||||||
FOnLog: TWikiOnLog;
|
FOnLog: TWikiOnLog;
|
||||||
|
FQuiet: boolean;
|
||||||
FTitle: string;
|
FTitle: string;
|
||||||
|
FVerbose: boolean;
|
||||||
FWarnMissingPageLinks: boolean;
|
FWarnMissingPageLinks: boolean;
|
||||||
procedure SetTitle(AValue: string);
|
procedure SetTitle(AValue: string);
|
||||||
protected
|
protected
|
||||||
@ -94,6 +96,8 @@ type
|
|||||||
property CodeTags: TKeyWordFunctionList read FCodeTags write FCodeTags;
|
property CodeTags: TKeyWordFunctionList read FCodeTags write FCodeTags;
|
||||||
function CollectAllLangCodes(Delimiter: char = ','): string;
|
function CollectAllLangCodes(Delimiter: char = ','): string;
|
||||||
procedure GetPageTranslations(DocumentName: string; out LangToPage: TStringToPointerTree);
|
procedure GetPageTranslations(DocumentName: string; out LangToPage: TStringToPointerTree);
|
||||||
|
property Verbose: boolean read FVerbose write FVerbose;
|
||||||
|
property Quiet: boolean read FQuiet write FQuiet;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function WikiPageToFilename(DocumentName: string; IsInternalLink, AppendCaseID: boolean): string;
|
function WikiPageToFilename(DocumentName: string; IsInternalLink, AppendCaseID: boolean): string;
|
||||||
|
|||||||
@ -37,7 +37,11 @@ type
|
|||||||
FFPDocConverter: TWiki2FPDocConverter;
|
FFPDocConverter: TWiki2FPDocConverter;
|
||||||
FHTMLConverter: TWiki2HTMLConverter;
|
FHTMLConverter: TWiki2HTMLConverter;
|
||||||
FLanguageTags: TKeyWordFunctionList;
|
FLanguageTags: TKeyWordFunctionList;
|
||||||
|
FQuiet: boolean;
|
||||||
|
FVerbose: boolean;
|
||||||
FXHTMLConverter: TWiki2XHTMLConverter;
|
FXHTMLConverter: TWiki2XHTMLConverter;
|
||||||
|
procedure SetQuiet(AValue: boolean);
|
||||||
|
procedure SetVerbose(AValue: boolean);
|
||||||
procedure Test;
|
procedure Test;
|
||||||
protected
|
protected
|
||||||
procedure DoRun; override;
|
procedure DoRun; override;
|
||||||
@ -53,6 +57,8 @@ type
|
|||||||
property CHMConverter: TWiki2CHMConverter read FCHMConverter;
|
property CHMConverter: TWiki2CHMConverter read FCHMConverter;
|
||||||
property Converter: TWiki2FormatConverter read FConverter;
|
property Converter: TWiki2FormatConverter read FConverter;
|
||||||
property LanguageTags: TKeyWordFunctionList read FLanguageTags;
|
property LanguageTags: TKeyWordFunctionList read FLanguageTags;
|
||||||
|
property Verbose: boolean read FVerbose write SetVerbose;
|
||||||
|
property Quiet: boolean read FQuiet write SetQuiet;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TMyApplication }
|
{ TMyApplication }
|
||||||
@ -253,6 +259,22 @@ begin
|
|||||||
Halt;
|
Halt;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TWiki2FPDocApplication.SetQuiet(AValue: boolean);
|
||||||
|
begin
|
||||||
|
if FQuiet=AValue then Exit;
|
||||||
|
FQuiet:=AValue;
|
||||||
|
if Converter<>nil then
|
||||||
|
Converter.Quiet:=Quiet;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TWiki2FPDocApplication.SetVerbose(AValue: boolean);
|
||||||
|
begin
|
||||||
|
if FVerbose=AValue then Exit;
|
||||||
|
FVerbose:=AValue;
|
||||||
|
if Converter<>nil then
|
||||||
|
Converter.Verbose:=Verbose;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TWiki2FPDocApplication.Create(TheOwner: TComponent);
|
constructor TWiki2FPDocApplication.Create(TheOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
inherited Create(TheOwner);
|
inherited Create(TheOwner);
|
||||||
@ -289,6 +311,8 @@ begin
|
|||||||
writeln(' --imagesdir=<images directory> : directory of image files. default: ',Converter.ImagesDir);
|
writeln(' --imagesdir=<images directory> : directory of image files. default: ',Converter.ImagesDir);
|
||||||
writeln(' --title=<string> : the title of the wiki. default: "',Converter.Title,'"');
|
writeln(' --title=<string> : the title of the wiki. default: "',Converter.Title,'"');
|
||||||
writeln(' --nowarnurl=<string> : do not warn for URLs starting with this. Can be given multiple times.');
|
writeln(' --nowarnurl=<string> : do not warn for URLs starting with this. Can be given multiple times.');
|
||||||
|
writeln(' --verbose');
|
||||||
|
writeln(' --quiet');
|
||||||
writeln(' <inputfile> : wiki page in xml format, can be given multiple times');
|
writeln(' <inputfile> : wiki page in xml format, can be given multiple times');
|
||||||
writeln(' Duplicates are ignored.');
|
writeln(' Duplicates are ignored.');
|
||||||
writeln(' You can use globbing, like "wikixml/*.xml". You must quote such parameters on console/shell.');
|
writeln(' You can use globbing, like "wikixml/*.xml". You must quote such parameters on console/shell.');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user