diff --git a/utils/fpdoc/dw_basemd.pp b/utils/fpdoc/dw_basemd.pp index 46de0ee314..6ab3e04c39 100644 --- a/utils/fpdoc/dw_basemd.pp +++ b/utils/fpdoc/dw_basemd.pp @@ -21,8 +21,8 @@ uses Classes, SysUtils, dwriter, DOM, pastree, dglobals; Const - MaxIndents = 10; - MaxLists = 10; + MaxIndents = 32; + MaxLists = 32; Type THeaderLevel = 1..6; @@ -842,6 +842,7 @@ end; destructor TBaseMarkdownWriter.Destroy; begin FreeAndNil(FMarkDown); + FreeAndNil(FMetadata); inherited Destroy; end; diff --git a/utils/fpdoc/dw_markdown.pp b/utils/fpdoc/dw_markdown.pp index 85cc29ba17..4bc770a6b9 100644 --- a/utils/fpdoc/dw_markdown.pp +++ b/utils/fpdoc/dw_markdown.pp @@ -124,7 +124,6 @@ type procedure WriteDocPage(const aFileName: String; aElement: TPasElement; aSubPageIndex: Integer); override; // Start producing html complete package documentation - function ModuleForElement(AnElement:TPasElement):TPasModule; Function InterPretOption(Const Cmd,Arg : String) : boolean; override; Procedure WriteDoc; override; @@ -326,18 +325,6 @@ begin Result:=FHeaderMarkDown; end; - - -function TMarkdownWriter.ModuleForElement(AnElement:TPasElement):TPasModule; - -begin - result:=TPasModule(AnElement); - while assigned(result) and not (result is TPasModule) do - result:=TPasModule(result.parent); - if not (result is TPasModule) then - result:=nil; -end; - procedure TMarkdownWriter.AppendShortDescr(AContext: TPasElement; DocNode: TDocNode) ; Var @@ -715,7 +702,7 @@ begin DescrEndTableCell; DescrBeginTableCell; - DescrEl:=Engine.FindShortDescr(ModuleForElement(AElement),UTF8Encode(aList[i])); + DescrEl:=Engine.FindShortDescr(AElement.GetModule(),UTF8Encode(aList[i])); if Assigned(DescrEl) then ConvertShort(AElement, DescrEl) else @@ -882,7 +869,7 @@ type PE:=EN.Element; DescrBeginListItem; AppendHyperLink(PE); - PM:=ModuleForElement(PE); + PM:=PE.GetModule(); if (PM<>Nil) then begin AppendText(' ('); diff --git a/utils/fpdoc/dwriter.pp b/utils/fpdoc/dwriter.pp index 06d372f799..fc0783e51c 100644 --- a/utils/fpdoc/dwriter.pp +++ b/utils/fpdoc/dwriter.pp @@ -282,7 +282,7 @@ Type procedure AllocateClassMemberPages(AModule: TPasModule; LinkList: TObjectList); virtual; procedure AllocateModulePages(AModule: TPasModule; LinkList: TObjectList); virtual; procedure AllocatePackagePages; virtual; - // Prefix every filename generated with the eesult of this. + // Prefix every filename generated with the result of this. function GetFileBaseDir(aOutput: String): String; virtual; function ModuleHasClasses(AModule: TPasModule): Boolean;