mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 04:18:48 +02: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 SetPackageName(AValue: string);
|
||||
procedure SetRootName(AValue: string);
|
||||
procedure SaveProject;
|
||||
public
|
||||
constructor Create; override;
|
||||
procedure Convert; override;
|
||||
@ -285,6 +286,52 @@ begin
|
||||
FRootName:=AValue;
|
||||
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);
|
||||
var
|
||||
doc: TXMLDocument;
|
||||
@ -371,6 +418,7 @@ begin
|
||||
// save
|
||||
for i:=0 to Count-1 do
|
||||
SavePage(TW2FPDocPage(Pages[i]));
|
||||
SaveProject;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -60,7 +60,9 @@ type
|
||||
FCodeTags: TKeyWordFunctionList;
|
||||
FNoWarnBaseURLs: TStringToStringTree;
|
||||
FOnLog: TWikiOnLog;
|
||||
FQuiet: boolean;
|
||||
FTitle: string;
|
||||
FVerbose: boolean;
|
||||
FWarnMissingPageLinks: boolean;
|
||||
procedure SetTitle(AValue: string);
|
||||
protected
|
||||
@ -94,6 +96,8 @@ type
|
||||
property CodeTags: TKeyWordFunctionList read FCodeTags write FCodeTags;
|
||||
function CollectAllLangCodes(Delimiter: char = ','): string;
|
||||
procedure GetPageTranslations(DocumentName: string; out LangToPage: TStringToPointerTree);
|
||||
property Verbose: boolean read FVerbose write FVerbose;
|
||||
property Quiet: boolean read FQuiet write FQuiet;
|
||||
end;
|
||||
|
||||
function WikiPageToFilename(DocumentName: string; IsInternalLink, AppendCaseID: boolean): string;
|
||||
|
@ -37,7 +37,11 @@ type
|
||||
FFPDocConverter: TWiki2FPDocConverter;
|
||||
FHTMLConverter: TWiki2HTMLConverter;
|
||||
FLanguageTags: TKeyWordFunctionList;
|
||||
FQuiet: boolean;
|
||||
FVerbose: boolean;
|
||||
FXHTMLConverter: TWiki2XHTMLConverter;
|
||||
procedure SetQuiet(AValue: boolean);
|
||||
procedure SetVerbose(AValue: boolean);
|
||||
procedure Test;
|
||||
protected
|
||||
procedure DoRun; override;
|
||||
@ -53,6 +57,8 @@ type
|
||||
property CHMConverter: TWiki2CHMConverter read FCHMConverter;
|
||||
property Converter: TWiki2FormatConverter read FConverter;
|
||||
property LanguageTags: TKeyWordFunctionList read FLanguageTags;
|
||||
property Verbose: boolean read FVerbose write SetVerbose;
|
||||
property Quiet: boolean read FQuiet write SetQuiet;
|
||||
end;
|
||||
|
||||
{ TMyApplication }
|
||||
@ -253,6 +259,22 @@ begin
|
||||
Halt;
|
||||
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);
|
||||
begin
|
||||
inherited Create(TheOwner);
|
||||
@ -289,6 +311,8 @@ begin
|
||||
writeln(' --imagesdir=<images directory> : directory of image files. default: ',Converter.ImagesDir);
|
||||
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(' --verbose');
|
||||
writeln(' --quiet');
|
||||
writeln(' <inputfile> : wiki page in xml format, can be given multiple times');
|
||||
writeln(' Duplicates are ignored.');
|
||||
writeln(' You can use globbing, like "wikixml/*.xml". You must quote such parameters on console/shell.');
|
||||
|
Loading…
Reference in New Issue
Block a user