|
@@ -69,6 +69,7 @@ type
|
|
|
|
|
|
TFPDocWriter = class
|
|
|
private
|
|
|
+ FEmitNotes: Boolean;
|
|
|
FEngine : TFPDocEngine;
|
|
|
FPackage : TPasPackage;
|
|
|
FTopics : TList;
|
|
@@ -88,6 +89,7 @@ type
|
|
|
function IsDescrNodeEmpty(Node: TDOMNode): Boolean;
|
|
|
function IsExtShort(Node: TDOMNode): Boolean;
|
|
|
function ConvertShort(AContext: TPasElement; El: TDOMElement): Boolean;
|
|
|
+ function ConvertNotes(AContext: TPasElement; El: TDOMElement): Boolean; virtual;
|
|
|
function ConvertBaseShort(AContext: TPasElement; Node: TDOMNode): Boolean;
|
|
|
procedure ConvertBaseShortList(AContext: TPasElement; Node: TDOMNode;
|
|
|
MayBeEmpty: Boolean);
|
|
@@ -102,7 +104,9 @@ type
|
|
|
function ConvertSimpleBlock(AContext: TPasElement; Node: TDOMNode): Boolean;
|
|
|
Function FindTopicElement(Node : TDocNode): TTopicElement;
|
|
|
Procedure ConvertImage(El : TDomElement);
|
|
|
-
|
|
|
+
|
|
|
+ Procedure DescrEmitNotesHeader(AContext : TPasElement); virtual;
|
|
|
+ Procedure DescrEmitNotesFooter(AContext : TPasElement); virtual;
|
|
|
procedure DescrWriteText(const AText: DOMString); virtual; abstract;
|
|
|
procedure DescrBeginBold; virtual; abstract;
|
|
|
procedure DescrEndBold; virtual; abstract;
|
|
@@ -170,6 +174,7 @@ type
|
|
|
Procedure FPDocError(Fmt : String; Args : Array of Const);
|
|
|
Function ShowMember(M : TPasElement) : boolean;
|
|
|
Procedure GetMethodList(ClassDecl: TPasClassType; List : TStringList);
|
|
|
+ Property EmitNotes : Boolean Read FEmitNotes Write FEmitNotes;
|
|
|
end;
|
|
|
|
|
|
TFPDocWriterClass = Class of TFPDocWriter;
|
|
@@ -346,7 +351,7 @@ begin
|
|
|
Inherited;
|
|
|
end;
|
|
|
|
|
|
-function TFPDocWriter.InterpretOption(Const Cmd,Arg : String): Boolean;
|
|
|
+function TFPDocWriter.InterpretOption(const Cmd, Arg: String): Boolean;
|
|
|
begin
|
|
|
Result:=False;
|
|
|
end;
|
|
@@ -357,7 +362,7 @@ begin
|
|
|
Result := ''; //Output must not contain an extension.
|
|
|
end;
|
|
|
|
|
|
-Class procedure TFPDocWriter.Usage(List: TStrings);
|
|
|
+class procedure TFPDocWriter.Usage(List: TStrings);
|
|
|
begin
|
|
|
// Do nothing.
|
|
|
end;
|
|
@@ -378,7 +383,8 @@ begin
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
-Procedure TFPDocWriter.DescrWriteImageEl(const AFileName, ACaption,ALinkName : DOMString);
|
|
|
+procedure TFPDocWriter.DescrWriteImageEl(const AFileName, ACaption,
|
|
|
+ ALinkName: DOMString);
|
|
|
|
|
|
begin
|
|
|
DoLog('%s : No support for images yet: %s (caption: "%s")',[ClassName,AFileName,ACaption]);
|
|
@@ -482,6 +488,45 @@ begin
|
|
|
Result := True;
|
|
|
end;
|
|
|
|
|
|
+function TFPDocWriter.ConvertNotes(AContext: TPasElement; El: TDOMElement
|
|
|
+ ): Boolean;
|
|
|
+
|
|
|
+Var
|
|
|
+ L : TFPList;
|
|
|
+ N : TDomNode;
|
|
|
+ I : Integer;
|
|
|
+
|
|
|
+begin
|
|
|
+ Result:=Assigned(El) and EmitNotes;
|
|
|
+ If Not Result then
|
|
|
+ exit;
|
|
|
+ L:=TFPList.Create;
|
|
|
+ try
|
|
|
+ N:=El.FirstChild;
|
|
|
+ While Assigned(N) do
|
|
|
+ begin
|
|
|
+ If (N.NodeType=ELEMENT_NODE) and (N.NodeName='note') then
|
|
|
+ L.Add(N);
|
|
|
+ N:=N.NextSibling;
|
|
|
+ end;
|
|
|
+ Result:=L.Count>0;
|
|
|
+ If Not Result then
|
|
|
+ exit;
|
|
|
+ DescrEmitNotesHeader(AContext);
|
|
|
+ DescrBeginUnorderedList;
|
|
|
+ For i:=0 to L.Count-1 do
|
|
|
+ begin
|
|
|
+ DescrBeginListItem;
|
|
|
+ ConvertExtShortOrNonSectionBlocks(AContext, TDOMNode(L[i]).FirstChild);
|
|
|
+ DescrEndListItem;
|
|
|
+ end;
|
|
|
+ DescrEndUnorderedList;
|
|
|
+ DescrEmitNotesFooter(AContext);
|
|
|
+ finally
|
|
|
+ L.Free;
|
|
|
+ end;
|
|
|
+end;
|
|
|
+
|
|
|
function TFPDocWriter.ConvertBaseShort(AContext: TPasElement;
|
|
|
Node: TDOMNode): Boolean;
|
|
|
|
|
@@ -1044,6 +1089,20 @@ begin
|
|
|
DescrWriteImageEl(FN,Cap,LinkName);
|
|
|
end;
|
|
|
|
|
|
+procedure TFPDocWriter.DescrEmitNotesHeader(AContext: TPasElement);
|
|
|
+begin
|
|
|
+ DescrWriteLinebreak;
|
|
|
+ DescrBeginBold;
|
|
|
+ DescrWriteText(SDocNotes);
|
|
|
+ DescrEndBold;
|
|
|
+ DescrWriteLinebreak;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TFPDocWriter.DescrEmitNotesFooter(AContext: TPasElement);
|
|
|
+begin
|
|
|
+ DescrWriteLinebreak;
|
|
|
+end;
|
|
|
+
|
|
|
|
|
|
Constructor TTopicElement.Create(const AName: String; AParent: TPasElement);
|
|
|
|