Browse Source

* Add side menu, many fixes after testing

Michaël Van Canneyt 2 weeks ago
parent
commit
dd15f3c3af

+ 2 - 6
utils/fpdoc/dglobals.pp

@@ -1212,18 +1212,14 @@ end;
 function TFPDocEngine.FindAbsoluteLink(const AName: String): String;
 function TFPDocEngine.FindAbsoluteLink(const AName: String): String;
 var
 var
   LinkNode: TLinkNode;
   LinkNode: TLinkNode;
-  P : String;
+
 begin
 begin
   // Writeln('Finding absolute link: ',aName);
   // Writeln('Finding absolute link: ',aName);
   LinkNode := RootLinkNode.FindChild(AName);
   LinkNode := RootLinkNode.FindChild(AName);
   if Assigned(LinkNode) then
   if Assigned(LinkNode) then
-    begin
-    Result := LinkNode.Link;
-    P:=LinkNode.Path;
-    end
+    Result := LinkNode.Link
   else
   else
     SetLength(Result, 0);
     SetLength(Result, 0);
-  // Writeln('Finding absolute link: ',aName,' (Node: ',P,') --> ',Result);
 end;
 end;
 
 
 function TFPDocEngine.ResolveLinkInPackages(AModule: TPasModule; const ALinkDest: String; Strict : Boolean = False): String;
 function TFPDocEngine.ResolveLinkInPackages(AModule: TPasModule; const ALinkDest: String; Strict : Boolean = False): String;

+ 9 - 2
utils/fpdoc/dw_basehtml.pp

@@ -126,6 +126,7 @@ type
     Procedure AppendSeeAlsoSection(AElement: TPasElement; DocNode: TDocNode); virtual;
     Procedure AppendSeeAlsoSection(AElement: TPasElement; DocNode: TDocNode); virtual;
     Procedure AppendSeeAlsoSection(AElement: TPasElement; aParent : TDOMElement; DocNode: TDocNode); virtual;
     Procedure AppendSeeAlsoSection(AElement: TPasElement; aParent : TDOMElement; DocNode: TDocNode); virtual;
     Procedure AppendExampleSection(AElement : TPasElement;DocNode : TDocNode); virtual;
     Procedure AppendExampleSection(AElement : TPasElement;DocNode : TDocNode); virtual;
+    Procedure AppendExampleSection(AElement : TPasElement;aParent : TDOMElement; DocNode : TDocNode); virtual;
     Procedure AppendShortDescr(Parent: TDOMNode; Element: TPasElement); virtual;
     Procedure AppendShortDescr(Parent: TDOMNode; Element: TPasElement); virtual;
     procedure AppendShortDescr(AContext: TPasElement; Parent: TDOMNode; DocNode: TDocNode); virtual;
     procedure AppendShortDescr(AContext: TPasElement; Parent: TDOMNode; DocNode: TDocNode); virtual;
     procedure AppendShortDescrCell(Parent: TDOMNode; Element: TPasElement); virtual;
     procedure AppendShortDescrCell(Parent: TDOMNode; Element: TPasElement); virtual;
@@ -961,6 +962,12 @@ end;
 
 
 procedure TBaseHTMLWriter.AppendExampleSection ( AElement: TPasElement; DocNode: TDocNode ) ;
 procedure TBaseHTMLWriter.AppendExampleSection ( AElement: TPasElement; DocNode: TDocNode ) ;
 
 
+begin
+  AppendExampleSection(AElement,ContentElement,DocNode);
+end;
+
+Procedure TBaseHTMLWriter.AppendExampleSection(AElement : TPasElement;aParent : TDOMElement; DocNode : TDocNode);
+
 var
 var
   Node: TDOMNode;
   Node: TDOMNode;
   fn,s: String;
   fn,s: String;
@@ -977,12 +984,12 @@ begin
       fn:=Engine.GetExampleFilename(TDOMElement(Node));
       fn:=Engine.GetExampleFilename(TDOMElement(Node));
       If (fn<>'') then
       If (fn<>'') then
         begin
         begin
-        AppendText(CreateH2(ContentElement), SDocExample);
+        AppendText(CreateH2(aParent), SDocExample);
         try
         try
           Assign(f, FN);
           Assign(f, FN);
           Reset(f);
           Reset(f);
           try
           try
-            PushOutputNode(ContentElement);
+            PushOutputNode(aParent);
             DescrBeginCode(False, UTF8Encode(TDOMElement(Node)['highlighter']));
             DescrBeginCode(False, UTF8Encode(TDOMElement(Node)['highlighter']));
             while not EOF(f) do
             while not EOF(f) do
               begin
               begin

+ 240 - 129
utils/fpdoc/dw_newhtml.pp

@@ -27,6 +27,7 @@ type
 
 
   TNewHTMLWriter = class(TBaseHTMLWriter)
   TNewHTMLWriter = class(TBaseHTMLWriter)
   private
   private
+    FCreateSideMenu: Boolean;
     FHeadElement: TDomElement;
     FHeadElement: TDomElement;
     FOnTest: TNotifyEvent;
     FOnTest: TNotifyEvent;
     FCSSFile: String;
     FCSSFile: String;
@@ -40,7 +41,10 @@ type
     FDateFormat: String;
     FDateFormat: String;
     FIndexColCount : Integer;
     FIndexColCount : Integer;
     FSearchPage : String;
     FSearchPage : String;
+    procedure AppendSideMenuScript(aHead : THTMLElement);
+    procedure AppendSideMenu(aMenu: THTMLElement);
     function GetVarDef(aElement: TPasVariable; aPrefixParent: Boolean): string;
     function GetVarDef(aElement: TPasVariable; aPrefixParent: Boolean): string;
+    procedure SetModuleInfo(aElement: TPasElement; ASubpageIndex: integer);
     procedure SetOnTest(const AValue: TNotifyEvent);
     procedure SetOnTest(const AValue: TNotifyEvent);
   protected
   protected
     function CreateAllocator : TFileAllocator; override;
     function CreateAllocator : TFileAllocator; override;
@@ -54,9 +58,11 @@ type
     function CreateListColumn2(aParent: THTMLElement): THTMLElement;
     function CreateListColumn2(aParent: THTMLElement): THTMLElement;
     function CreateListColumns(aParent: THTMLElement): THTMLElement;
     function CreateListColumns(aParent: THTMLElement): THTMLElement;
     function CreateSection(aParent : THTMLElement) : THTMLElement; virtual;
     function CreateSection(aParent : THTMLElement) : THTMLElement; virtual;
+    procedure DescrWriteFileEl(const AText: DOMString); override;
+    procedure DescrWriteVarEl(const AText: DOMString); override;
 
 
     function  AppendPasSHFragment(Parent: TDOMNode; const AText: String; AShFlags: Byte): Byte; override;
     function  AppendPasSHFragment(Parent: TDOMNode; const AText: String; AShFlags: Byte): Byte; override;
-    function  AppendPasSHFragment(Parent: TDOMNode; const AText: String; AShFlags: Byte; aLinkIdentifierMap : TLinkIdentifierMap): Byte; virtual;
+    function  AppendPasSHFragment(Parent: TDOMNode; const AText: String; AShFlags: Byte; aLinkIdentifierMap : TLinkIdentifierMap): Byte; override;
 
 
     procedure CreateCSSFile; virtual;
     procedure CreateCSSFile; virtual;
 
 
@@ -66,7 +72,7 @@ type
     function AppendProcType(CodeEl : TDOMElement;  Element: TPasProcedureType; Indent: Integer): TDOMElement; virtual;
     function AppendProcType(CodeEl : TDOMElement;  Element: TPasProcedureType; Indent: Integer): TDOMElement; virtual;
     procedure AppendProcExt(CodeEl: TDOMElement; Element: TPasProcedure); virtual;
     procedure AppendProcExt(CodeEl: TDOMElement; Element: TPasProcedure); virtual;
     procedure AppendProcDecl(CodeEl: TDOMElement; Element: TPasProcedureBase); virtual;
     procedure AppendProcDecl(CodeEl: TDOMElement; Element: TPasProcedureBase); virtual;
-    procedure AppendProcArgsSection(Parent: TDOMNode; Element: TPasProcedureType; SkipResult : Boolean = False); virtual;
+    procedure AppendProcArgsSection(Parent: THTMLElement; Element: TPasProcedureType; SkipResult : Boolean = False); virtual;
     procedure AppendShortDescrCell(Parent: TDOMNode; Element: TPasElement); override;
     procedure AppendShortDescrCell(Parent: TDOMNode; Element: TPasElement); override;
     procedure AppendDescrSection(AContext: TPasElement; Parent: TDOMNode; DescrNode: TDOMElement; const ATitle: DOMString); override;
     procedure AppendDescrSection(AContext: TPasElement; Parent: TDOMNode; DescrNode: TDOMElement; const ATitle: DOMString); override;
     Procedure AppendSeeAlsoSection(AElement: TPasElement; aParent : TDOMElement; DocNode: TDocNode); override;
     Procedure AppendSeeAlsoSection(AElement: TPasElement; aParent : TDOMElement; DocNode: TDocNode); override;
@@ -86,12 +92,13 @@ type
     procedure AppendInheritanceTree(aParent: THTMLELement; aClass: TPasClassType);
     procedure AppendInheritanceTree(aParent: THTMLELement; aClass: TPasClassType);
 
 
     // Package
     // Package
+
     procedure CreatePageBody(AElement: TPasElement; ASubpageIndex: Integer); virtual;
     procedure CreatePageBody(AElement: TPasElement; ASubpageIndex: Integer); virtual;
     procedure CreatePackagePageBody;virtual;
     procedure CreatePackagePageBody;virtual;
     procedure CreatePackageIndex;
     procedure CreatePackageIndex;
     procedure CreatePackageClassHierarchy;
     procedure CreatePackageClassHierarchy;
     procedure CreateClassHierarchyPage(AddUnit : Boolean);
     procedure CreateClassHierarchyPage(AddUnit : Boolean);
-    procedure CreateIndexPage(L : TStringList); virtual;
+    procedure CreateIndexPage(aParent : THTMLElement; L : TStringList); virtual;
     // Topic
     // Topic
     Procedure CreateTopicPageBody(AElement : TTopicElement);
     Procedure CreateTopicPageBody(AElement : TTopicElement);
     // Module
     // Module
@@ -151,7 +158,7 @@ type
     property OnTest: TNotifyEvent read FOnTest write SetOnTest;
     property OnTest: TNotifyEvent read FOnTest write SetOnTest;
     Property CharSet : String Read FCharSet Write FCharSet;
     Property CharSet : String Read FCharSet Write FCharSet;
     Property IndexColCount : Integer Read FIndexColCount write FIndexColCount;
     Property IndexColCount : Integer Read FIndexColCount write FIndexColCount;
-    Property UseMenuBrackets : Boolean Read FUseMenuBrackets write FUseMenuBrackets;
+    Property CreateSideMenu : Boolean Read FCreateSideMenu Write FCreateSideMenu;
   end;
   end;
 
 
 
 
@@ -166,20 +173,118 @@ constructor TNewHTMLWriter.Create(APackage: TPasPackage; AEngine: TFPDocEngine);
 begin
 begin
   inherited Create(APackage, AEngine);
   inherited Create(APackage, AEngine);
   // should default to true since this is the old behavior
   // should default to true since this is the old behavior
-  UseMenuBrackets:=True;
+  CreateSideMenu:=True;
   IndexColCount:=3;
   IndexColCount:=3;
   Charset:='iso-8859-1';
   Charset:='iso-8859-1';
   FCSSFile:='fpdocs.css';
   FCSSFile:='fpdocs.css';
 end;
 end;
 
 
+procedure TNewHTMLWriter.AppendSideMenuScript(aHead: THTMLElement);
+
+Const
+  SFunc =
+    '  document.addEventListener("DOMContentLoaded", () => {'+sLinebreak+
+    '       const toggleButton = document.getElementById("menu-toggle");'+sLinebreak+
+    '       const sideMenu = document.getElementById("side-menu");'+sLinebreak+
+    '       const mainContent = document.getElementById("main-content");'+sLinebreak+
+    '       if (toggleButton && sideMenu && mainContent) {'+sLinebreak+
+    '           toggleButton.addEventListener("click", () => {'+sLinebreak+
+    '               sideMenu.classList.toggle("is-expanded");'+sLinebreak+
+    '               mainContent.classList.toggle("is-shifted");'+sLinebreak+
+    '           });'+sLinebreak+
+    '       }'+sLinebreak+
+    '   });';
+
+Var
+  SE : THTMLElement;
+
+begin
+  SE:=Doc.CreateElement('script');
+  aHead.AppendChild(SE);
+  AppendText(SE,SFunc);
+end;
+
+
+procedure TNewHTMLWriter.AppendSideMenu(aMenu: THTMLElement);
+
+  function AddLink(aParent : THTMLElement; ALinkSubpageIndex: Integer; const AName: String) : THTMLElement;
+
+  begin
+    Result:=CreateLink(aParent, ResolveLinkWithinPackage(Module, ALinkSubpageIndex));
+    AppendText(Result,aName);
+  end;
+
+  function AddPackageLink(aParent: THTMLElement; ALinkSubpageIndex: Integer; const AName: String) : THTMLElement;
+  var
+    lURL : String;
+  begin
+    lURL:=ResolveLinkWithinPackage(Package, ALinkSubpageIndex);
+    Result:=CreateLink(aParent,lURL);
+    AppendText(Result,aName);
+  end;
+
+
+var
+  lPara,lList,lItem : THTMLElement;
+  lModule : TPasModule;
+  I : Integer;
+
+begin
+  lPara:=CreateEl(aMenu,'p','menu-label');
+  AppendText(lPara,SDocPackageLinkTitle);
+  lList:=CreateEl(aMenu,'ul','menu-list');
+  lItem:=CreateEl(lList,'li');
+  if Assigned(Module) then
+  AddPackageLink(lItem,0, SDocReference);
+  //El:=AppendHyperlink(lItem, Package) as THTMLELement;
+  lItem:=CreateEl(lList,'li');
+  AddPackageLink(lItem,IndexSubIndex, SDocIdentifierIndex);
+  lItem:=CreateEl(lList,'li');
+  AddPackageLink(lItem,ClassHierarchySubIndex, SDocPackageClassHierarchy);
+  lPara:=CreateEl(aMenu,'p','menu-label');
+  AppendText(lPara,SDocUnits);
+  lList:=CreateEl(aMenu,'ul','menu-list');
+  For I:=0 to Package.Modules.Count-1 do
+    begin
+    lModule:=TPasModule(Package.Modules[I]);
+    lItem:=CreateEl(lList,'li');
+    AppendHyperlink(lItem, lModule);
+    end;
+end;
+
+procedure TNewHTMLWriter.SetModuleInfo(aElement : TPasElement; ASubpageIndex : integer);
+
+var
+  i : integer;
+  Element : TPasElement;
+begin
+  CurDirectory := Allocator.GetFilename(AElement, ASubpageIndex);
+  i := Length(CurDirectory);
+  while (i > 0) and not (CurDirectory[i] in AllowDirectorySeparators) do
+    Dec(i);
+  CurDirectory := Copy(CurDirectory, 1, i);
+  BaseDirectory := Allocator.GetRelativePathToTop(AElement);
+  if aElement is TPasPackage then
+    Module:=Nil
+  else
+    begin
+    Element := AElement;
+    while (Element<>Nil) and (not (Element.ClassType.inheritsfrom(TPasModule))) do
+      Element := Element.Parent;
+    Module := TPasModule(Element);
+    end;
+end;
+
 function TNewHTMLWriter.CreateHTMLPage(AElement: TPasElement;
 function TNewHTMLWriter.CreateHTMLPage(AElement: TPasElement;
   ASubpageIndex: Integer): TXMLDocument;
   ASubpageIndex: Integer): TXMLDocument;
 var
 var
   HTMLEl: THTMLHtmlElement;
   HTMLEl: THTMLHtmlElement;
   HeadEl: THTMLHeadElement;
   HeadEl: THTMLHeadElement;
-  BodyElement : THTMLElement;
+  LMain,lMenu,LContent,BodyElement : THTMLElement;
   El: TDOMElement;
   El: TDOMElement;
+
 begin
 begin
+
   Result := THTMLDocument.Create;
   Result := THTMLDocument.Create;
   SetHTMLDocument(THTMLDocument(Result));
   SetHTMLDocument(THTMLDocument(Result));
   Doc.AppendChild(Doc.Impl.CreateDocumentType('html','',''));
   Doc.AppendChild(Doc.Impl.CreateDocumentType('html','',''));
@@ -208,7 +313,20 @@ begin
   BodyElement['class']:='has-navbar-fixed-top';
   BodyElement['class']:='has-navbar-fixed-top';
   ContentElement:=BodyElement;
   ContentElement:=BodyElement;
   HTMLEl.AppendChild(BodyElement);
   HTMLEl.AppendChild(BodyElement);
-
+  SetModuleInfo(aElement,ASubpageIndex);
+  AppendMenuBar(ASubpageIndex);
+  if CreateSideMenu then
+    begin
+    AppendSideMenuScript(HeadEl);
+    LMain:=CreateEl(ContentElement,'div');
+    LMain['id']:='main-layout';
+    lMenu:=CreateEl(lMain,'aside','is-expanded');
+    LMenu['id']:='side-menu';
+    AppendSideMenu(lMenu);
+    LContent:=CreateEl(lMain,'div','is-shifted');
+    LContent['id']:='main-content';
+    ContentElement:=lContent;
+    end;
   CreatePageBody(AElement, ASubpageIndex);
   CreatePageBody(AElement, ASubpageIndex);
 
 
   AppendFooter;
   AppendFooter;
@@ -436,33 +554,39 @@ begin
     WriteVariant(TPasProcedure(Element),False);
     WriteVariant(TPasProcedure(Element),False);
 end;
 end;
 
 
-procedure TNewHTMLWriter.AppendProcArgsSection(Parent: TDOMNode;
+procedure TNewHTMLWriter.AppendProcArgsSection(Parent: THTMLElement;
   Element: TPasProcedureType; SkipResult : Boolean = False);
   Element: TPasProcedureType; SkipResult : Boolean = False);
 var
 var
-  HasFullDescr, IsFirst: Boolean;
+  HasFullDescr, HaveArgDescr: Boolean;
   ResultEl: TPasResultElement;
   ResultEl: TPasResultElement;
-  ArgTableEl, TREl: TDOMElement;
+  lColumns, lColumn: THTMLElement;
   DocNode: TDocNode;
   DocNode: TDocNode;
   i: Integer;
   i: Integer;
   Arg: TPasArgument;
   Arg: TPasArgument;
 begin
 begin
-  IsFirst := True;
-  for i := 0 to Element.Args.Count - 1 do
-  begin
+  HaveArgDescr:=False;
+  I:=0;
+  While (I<Element.Args.Count) and not HaveArgDescr do
+    begin
     Arg := TPasArgument(Element.Args[i]);
     Arg := TPasArgument(Element.Args[i]);
-    if IsDescrNodeEmpty(Engine.FindShortDescr(Arg)) then
-      continue;
-    if IsFirst then
+    HaveArgDescr:=Not IsDescrNodeEmpty(Engine.FindShortDescr(Arg));
+    inc(i);
+    end;
+  if HaveArgDescr then
     begin
     begin
-      IsFirst := False;
-      AppendText(CreateH2(Parent), SDocArguments);
-      ArgTableEl := CreateTable(Parent);
+    AppendText(CreateH2(Parent), SDocArguments);
+    for i := 0 to Element.Args.Count - 1 do
+      begin
+      lColumns := CreateListColumns(Parent);
+      Arg := TPasArgument(Element.Args[i]);
+      if IsDescrNodeEmpty(Engine.FindShortDescr(Arg)) then
+        continue;
+      lColumn:=CreateListColumn1(lColumns);
+      AppendText(lColumn, Arg.Name);
+      lColumn:=CreateListColumn2(lColumns);
+      AppendShortDescrCell(lColumn, Arg);
+      end;
     end;
     end;
-    TREl := CreateTR(ArgTableEl);
-    AppendText(CreateCode(CreatePara(CreateTD_vtop(TREl))), Arg.Name);
-    AppendShortDescrCell(TREl, Arg);
-  end;
-
   if (Element.ClassType = TPasFunctionType) and not SkipResult then
   if (Element.ClassType = TPasFunctionType) and not SkipResult then
   begin
   begin
     ResultEl := TPasFunctionType(Element).ResultEl;
     ResultEl := TPasFunctionType(Element).ResultEl;
@@ -602,17 +726,27 @@ begin
   NavBrand:=CreateEl(NavEl,'div');
   NavBrand:=CreateEl(NavEl,'div');
   // We use the brand for the link to the overview
   // We use the brand for the link to the overview
   NavBrand['class']:='navbar-brand';
   NavBrand['class']:='navbar-brand';
+  if CreateSideMenu then
+    begin
+    NavItem:=CreateEl(NavBrand,'a','navbar-item');
+    NavItem['role']:='button';
+    NavItem['id']:='menu-toggle';
+    NavItem['aria-label']:='menu';
+    NavItem['aria-expanded']:='false';
+    El:=CreateEl(NavItem,'span','burger-icon');
+    AppendText(El,#$2261); //
+    end;
   NavItem:=CreateEl(NavBrand,'a');
   NavItem:=CreateEl(NavBrand,'a');
   NavItem['class']:='navbar-item';
   NavItem['class']:='navbar-item';
   if Assigned(Module) then
   if Assigned(Module) then
     begin
     begin
     NavItem['href']:=UTF8Decode(ResolveLinkWithinPackage(Module, 0));
     NavItem['href']:=UTF8Decode(ResolveLinkWithinPackage(Module, 0));
-    AppendText(NavItem,UTF8Decode(Module.Name));
+    AppendText(NavItem, UTF8Decode(Format(SDocUnitMenuTitle,[Module.Name])));
     end
     end
   else
   else
     begin
     begin
     NavItem['href']:=UTF8Decode(ResolveLinkWithinPackage(Package, IndexSubIndex));
     NavItem['href']:=UTF8Decode(ResolveLinkWithinPackage(Package, IndexSubIndex));
-    AppendText(NavItem,UTF8Decode(Package.Name));
+    AppendText(NavItem,UTF8Decode(Format(SDocPackageMenuTitle,[Package.Name])));
     end;
     end;
   // Now the other items follow
   // Now the other items follow
   NavMenu:=CreateEl(NavEl,'div');
   NavMenu:=CreateEl(NavEl,'div');
@@ -692,6 +826,24 @@ begin
   Result:=CreateEl(aParent,'section','section');
   Result:=CreateEl(aParent,'section','section');
 end;
 end;
 
 
+procedure TNewHTMLWriter.DescrWriteFileEl(const AText: DOMString);
+var
+  NewEl: TDOMElement;
+begin
+  NewEl := CreateEl(CurOutputNode, 'span');
+  NewEl['class'] := 'fileref';
+  AppendText(NewEl, AText);
+end;
+
+procedure TNewHTMLWriter.DescrWriteVarEl(const AText: DOMString);
+var
+  NewEl: TDOMElement;
+begin
+  NewEl := CreateEl(CurOutputNode, 'span');
+  NewEl['class'] := 'identifier';
+  AppendText(NewEl, AText);
+end;
+
 function TNewHTMLWriter.AppendPasSHFragment(Parent: TDOMNode; const AText: String; AShFlags: Byte): Byte;
 function TNewHTMLWriter.AppendPasSHFragment(Parent: TDOMNode; const AText: String; AShFlags: Byte): Byte;
 begin
 begin
   Result:=AppendPasSHFragment(Parent, AText, AShFlags,Nil);
   Result:=AppendPasSHFragment(Parent, AText, AShFlags,Nil);
@@ -773,14 +925,15 @@ end;
 procedure TNewHTMLWriter.AppendDescrSection(AContext: TPasElement; Parent: TDOMNode; DescrNode: TDOMElement; const ATitle: DOMString);
 procedure TNewHTMLWriter.AppendDescrSection(AContext: TPasElement; Parent: TDOMNode; DescrNode: TDOMElement; const ATitle: DOMString);
 
 
 var
 var
-  lSection : THTMLElement;
+  lContent,lSection : THTMLElement;
 begin
 begin
   if not IsDescrNodeEmpty(DescrNode) then
   if not IsDescrNodeEmpty(DescrNode) then
   begin
   begin
     lSection:=CreateSection(Parent as THTMLElement);
     lSection:=CreateSection(Parent as THTMLElement);
+    lContent:=CreateEl(lSection,'div','content');
     If (ATitle<>'') then // Can be empty for topic.
     If (ATitle<>'') then // Can be empty for topic.
-      AppendText(CreateH2(lSection), ATitle);
-    AppendDescr(AContext, lSection, DescrNode, True);
+      AppendText(CreateH2(lContent), ATitle);
+    AppendDescr(AContext, lContent, DescrNode, True);
   end;
   end;
 end;
 end;
 
 
@@ -896,7 +1049,7 @@ procedure TNewHTMLWriter.FinishElementPage(AElement: TPasElement; aDescription :
 
 
 var
 var
   DocNode: TDocNode;
   DocNode: TDocNode;
-
+  lSection : THTMLElement;
 begin
 begin
   DocNode := Engine.FindDocNode(AElement);
   DocNode := Engine.FindDocNode(AElement);
   If Not Assigned(DocNode) then
   If Not Assigned(DocNode) then
@@ -918,7 +1071,8 @@ begin
   AppendSeeAlsoSection(AElement,ContentElement,DocNode);
   AppendSeeAlsoSection(AElement,ContentElement,DocNode);
 
 
   // Append examples, if present
   // Append examples, if present
-  AppendExampleSection(AElement,DocNode);
+  lSection:=CreateSection(ContentElement);
+  AppendExampleSection(AElement,lSection, DocNode);
   // Append notes, if present
   // Append notes, if present
   ConvertNotes(AElement,DocNode.Notes);
   ConvertNotes(AElement,DocNode.Notes);
 end;
 end;
@@ -1044,7 +1198,6 @@ begin
   SE := Doc.CreateElement('script');
   SE := Doc.CreateElement('script');
   AppendText(SE,SFunc);
   AppendText(SE,SFunc);
   HeadElement.AppendChild(SE);
   HeadElement.AppendChild(SE);
-  AppendMenuBar(ClassHierarchySubIndex);
   S:=Package.Name;
   S:=Package.Name;
   If Length(S)>0 then
   If Length(S)>0 then
     Delete(S,1,1);
     Delete(S,1,1);
@@ -1054,20 +1207,9 @@ end;
 
 
 procedure TNewHTMLWriter.CreatePageBody(AElement: TPasElement; ASubpageIndex: Integer);
 procedure TNewHTMLWriter.CreatePageBody(AElement: TPasElement; ASubpageIndex: Integer);
 
 
-var
-  i: Integer;
-  Element: TPasElement;
-
 begin
 begin
-  CurDirectory := Allocator.GetFilename(AElement, ASubpageIndex);
-  i := Length(CurDirectory);
-  while (i > 0) and not (CurDirectory[i] in AllowDirectorySeparators) do
-    Dec(i);
-  CurDirectory := Copy(CurDirectory, 1, i);
-  BaseDirectory := Allocator.GetRelativePathToTop(AElement);
-  if AElement.ClassType = TPasPackage then
+  if Module=nil then
     begin
     begin
-    Module:=Nil;
     If (ASubPageIndex=0) then
     If (ASubPageIndex=0) then
       CreatePackagePageBody
       CreatePackagePageBody
     else if ASubPageIndex=IndexSubIndex then
     else if ASubPageIndex=IndexSubIndex then
@@ -1077,11 +1219,6 @@ begin
     end
     end
   else
   else
     begin
     begin
-    Element := AElement;
-    while (Element<>Nil) and (not (Element.ClassType.inheritsfrom(TPasModule))) do
-      Element := Element.Parent;
-    Module := TPasModule(Element);
-
     if AElement.ClassType.inheritsfrom(TPasModule) then
     if AElement.ClassType.inheritsfrom(TPasModule) then
       CreateModulePageBody(TPasModule(AElement), ASubpageIndex)
       CreateModulePageBody(TPasModule(AElement), ASubpageIndex)
     else if AElement.Parent.InheritsFrom(TPasClassType) then
     else if AElement.Parent.InheritsFrom(TPasClassType) then
@@ -1105,13 +1242,13 @@ begin
   end;
   end;
 end;
 end;
 
 
-procedure TNewHTMLWriter.CreateIndexPage(L : TStringList);
+procedure TNewHTMLWriter.CreateIndexPage(aParent: THTMLElement; L: TStringList);
 Var
 Var
   Lists  : Array['A'..'Z'] of TStringList;
   Lists  : Array['A'..'Z'] of TStringList;
   CL : TStringList;
   CL : TStringList;
-  TableEl, TREl, EL: TDOMElement;
+  lColumns, lColumn,  EL, el2: TDOMElement;
   E : TPasElement;
   E : TPasElement;
-  I,Rows,J,Index : Integer;
+  I : Integer;
   S : String;
   S : String;
   C : Char;
   C : Char;
 
 
@@ -1142,50 +1279,35 @@ begin
         CL.AddObject(S,E);
         CL.AddObject(S,E);
       end;  
       end;  
     end;  
     end;  
-  Try  
-  // Create a quick jump table to all available letters.    
-  TableEl := CreateEl(ContentElement,'div','columns');
+  Try
+  // Create a quick jump table to all available letters.
+  lColumns := CreateEl(aParent,'div','columns is-multiline');
   for C:='A' to 'Z' do
   for C:='A' to 'Z' do
     If (Lists[C]<>Nil) then
     If (Lists[C]<>Nil) then
       begin
       begin
-      El:=CreateEl(TableEl,'div','column is-1');
-      EL:=CreateLink(El,UTF8Decode('#SECTION'+C));
-      EL['class']:='button is-link';
-      AppendText(EL,UTF8Decode(C));
-      If C<>'Z' then
-       AppendNBsp(El,1);
+      lColumn:=CreateEl(lColumns,'div','column is-narrow');
+      lColumn:=CreateLink(lColumn,UTF8Decode('#SECTION'+C));
+      lColumn['class']:='button is-link';
+      AppendText(lColumn,UTF8Decode(C));
       end;
       end;
   // Now emit all identifiers.    
   // Now emit all identifiers.    
-  TableEl:=Nil;
   For C:='A' to 'Z' do
   For C:='A' to 'Z' do
     begin
     begin
     CL:=Lists[C];
     CL:=Lists[C];
     If CL<>Nil then
     If CL<>Nil then
       begin
       begin
-      AppendText(CreateH2(ContentElement),UTF8Decode(C));
+      El:=CreateH2(aParent);
+      AppendText(El,UTF8Decode(C));
       CreateAnchor(El,UTF8Decode('SECTION'+C));
       CreateAnchor(El,UTF8Decode('SECTION'+C));
-      TableEl := CreateTable(ContentElement);
-      TableEl['Width']:='80%';
-      // Determine number of rows needed
-      Rows:=(CL.Count div IndexColCount);
-      If ((CL.Count Mod IndexColCount)<>0) then
-        Inc(Rows);
-      // Fill rows  
-      For I:=0 to Rows-1 do
+      El:=CreateEl(aParent,'div');
+      EL['style']:='display: block; column-count: 3';
+      for I:=0 to CL.Count-1 do
         begin
         begin
-        TREl := CreateTR(TableEl);
-        For J:=0 to IndexColCount-1 do 
-          begin
-          El:=CreateTD_vtop(TREl);
-          Index:=(J*Rows)+I;
-          If (Index<CL.Count) then
-            begin
-            S:=CL[Index];
-            E:=TPasElement(CL.Objects[Index]);
-            AppendHyperlink(El,E);
-            end;
-          end;  
-        end;  
+        E:=TPasElement(CL.Objects[I]);
+        El2:=AppendHyperlink(El,E);
+        if assigned(EL2) then
+          EL2['style']:='display: block;';
+        end;
       end; // have List
       end; // have List
     end;  // For C:=
     end;  // For C:=
   Finally
   Finally
@@ -1201,7 +1323,7 @@ Var
   I : Integer;
   I : Integer;
   M : TPasModule;
   M : TPasModule;
   S : String;
   S : String;
-  
+  lSection : THTMLElement;
 begin
 begin
   L:=TStringList.Create;
   L:=TStringList.Create;
   try
   try
@@ -1212,12 +1334,12 @@ begin
       L.AddObject(M.Name,M);
       L.AddObject(M.Name,M);
       AddModuleIdentifiers(M,L);
       AddModuleIdentifiers(M,L);
       end;
       end;
-    AppendMenuBar(IndexSubIndex);
     S:=Package.Name;
     S:=Package.Name;
     If Length(S)>0 then
     If Length(S)>0 then
       Delete(S,1,1);
       Delete(S,1,1);
-    AppendTitle(ContentElement,UTF8Decode(Format(SDocPackageIndex, [S])));
-    CreateIndexPage(L);
+    lSection:=CreateSection(ContentElement);
+    AppendTitle(lSection,UTF8Decode(Format(SDocPackageIndex, [S])));
+    CreateIndexPage(lSection,L);
   Finally
   Finally
     L.Free;
     L.Free;
   end;
   end;
@@ -1227,14 +1349,13 @@ procedure TNewHTMLWriter.CreatePackagePageBody;
 
 
 var
 var
   DocNode: TDocNode;
   DocNode: TDocNode;
-  lSection : THTMLElement;
+  lSection, lColumns, lColumn : THTMLElement;
   TableEl, TREl: TDOMElement;
   TableEl, TREl: TDOMElement;
   i: Integer;
   i: Integer;
   ThisModule: TPasModule;
   ThisModule: TPasModule;
   L : TStringList;
   L : TStringList;
 
 
 begin
 begin
-  AppendMenuBar(0);
   lSection:=CreateSection(ContentElement);
   lSection:=CreateSection(ContentElement);
   AppendTitle(lSection,Format(SDocPackageTitle, [Copy(Package.Name, 2, 256)]));
   AppendTitle(lSection,Format(SDocPackageTitle, [Copy(Package.Name, 2, 256)]));
   AppendShortDescr(CreatePara(lSection), Package);
   AppendShortDescr(CreatePara(lSection), Package);
@@ -1250,9 +1371,11 @@ begin
     for i:=0 to L.Count - 1 do
     for i:=0 to L.Count - 1 do
       begin
       begin
       ThisModule := TPasModule(L.Objects[i]);
       ThisModule := TPasModule(L.Objects[i]);
-      TREl := CreateTR(TableEl);
-      AppendHyperlink(CreateCode(CreatePara(CreateTD_vtop(TREl))), ThisModule);
-      AppendShortDescrCell(TREl, ThisModule);
+      lColumns:=CreateListColumns(lSection);
+      lColumn:=CreateListColumn1(lColumns);
+      AppendHyperlink(lColumn, ThisModule);
+      lColumn:=CreateListColumn2(lColumns);
+      AppendShortDescrCell(lColumn, ThisModule);
       end;
       end;
   Finally
   Finally
     L.Free;
     L.Free;
@@ -1357,11 +1480,10 @@ begin
   L:=TStringList.Create;
   L:=TStringList.Create;
   try
   try
     AddModuleIdentifiers(AModule,L);
     AddModuleIdentifiers(AModule,L);
-    AppendMenuBar(IndexSubIndex);
     lSection:=CreateSection(ContentElement);
     lSection:=CreateSection(ContentElement);
     AppendTitle(lSection,Format(SDocModuleIndex, [AModule.Name]));
     AppendTitle(lSection,Format(SDocModuleIndex, [AModule.Name]));
     PushContentElement(lSection);
     PushContentElement(lSection);
-    CreateIndexPage(L);
+    CreateIndexPage(lSection,L);
     PopContentElement;
     PopContentElement;
   Finally
   Finally
     L.Free;
     L.Free;
@@ -1371,38 +1493,32 @@ end;
 procedure TNewHTMLWriter.CreateModuleMainPage(aModule : TPasModule);
 procedure TNewHTMLWriter.CreateModuleMainPage(aModule : TPasModule);
 
 
 var
 var
-  lSection,TableEl, TREl, TDEl, CodeEl: TDOMElement;
+  lContent,lSection,lColumns,lColumn: THTMLElement;
   i: Integer;
   i: Integer;
   UnitRef: TPasType;
   UnitRef: TPasType;
   DocNode: TDocNode;
   DocNode: TDocNode;
 
 
+
 begin
 begin
-  AppendMenuBar(0);
   lSection:=CreateSection(ContentElement);
   lSection:=CreateSection(ContentElement);
   AppendTitle(lSection,Format(SDocUnitTitle, [AModule.Name]),AModule.Hints);
   AppendTitle(lSection,Format(SDocUnitTitle, [AModule.Name]),AModule.Hints);
-  AppendShortDescr(CreatePara(lSection), AModule);
+  lContent:=CreateEl(lSection,'div','content');
+  AppendShortDescr(lContent, AModule);
 
 
   if AModule.InterfaceSection.UsesList.Count > 0 then
   if AModule.InterfaceSection.UsesList.Count > 0 then
   begin
   begin
-    TableEl := CreateTable(lSection);
-    AppendKw(CreateCode(CreatePara(CreateTD(CreateTR(TableEl)))), 'uses');
+    AppendKw(CreateCode(CreatePara(lContent)), 'uses');
     for i := 0 to AModule.InterfaceSection.UsesList.Count - 1 do
     for i := 0 to AModule.InterfaceSection.UsesList.Count - 1 do
     begin
     begin
+      lColumns:=CreateListColumns(lSection);
       UnitRef := TPasType(AModule.InterfaceSection.UsesList[i]);
       UnitRef := TPasType(AModule.InterfaceSection.UsesList[i]);
       DocNode := Engine.FindDocNode(UnitRef);
       DocNode := Engine.FindDocNode(UnitRef);
       if Assigned(DocNode) and DocNode.IsSkipped then
       if Assigned(DocNode) and DocNode.IsSkipped then
         continue;
         continue;
-      TREl := CreateTR(TableEl);
-      TDEl := CreateTD_vtop(TREl);
-      CodeEl := CreateCode(CreatePara(TDEl));
-      AppendNbSp(CodeEl, 2);
-      AppendHyperlink(CodeEl, UnitRef);
-      if i < AModule.InterfaceSection.UsesList.Count - 1 then
-        AppendSym(CodeEl, ',')
-      else
-        AppendSym(CodeEl, ';');
-      AppendText(CodeEl, '  ');               // Space for descriptions
-      AppendShortDescrCell(TREl, UnitRef);
+      lColumn:=CreateListColumn1(lColumns);
+      AppendHyperlink(lColumn, UnitRef);
+      lColumn:=CreateListColumn2(lColumns);
+      AppendShortDescrCell(lColumn, UnitRef);
     end;
     end;
   end;
   end;
 
 
@@ -1428,7 +1544,6 @@ var
   S : String;
   S : String;
 
 
 begin
 begin
-  AppendMenuBar(ASubpageIndex);
   S:=UTF8Encode(ATitle);
   S:=UTF8Encode(ATitle);
   lSection:=CreateSection(ContentElement);
   lSection:=CreateSection(ContentElement);
   AppendTitle(lSection,Format(SDocUnitTitle + ': %s', [AModule.Name, S]));
   AppendTitle(lSection,Format(SDocUnitTitle + ': %s', [AModule.Name, S]));
@@ -1471,7 +1586,6 @@ var
   Decl: TPasResString;
   Decl: TPasResString;
 
 
 begin
 begin
-  AppendMenuBar(ResstrSubindex);
   lSection:=CreateSection(ContentElement);
   lSection:=CreateSection(ContentElement);
   AppendTitle(lSection,Format(SDocUnitTitle + ': %s', [AModule.Name, SDocResStrings]));
   AppendTitle(lSection,Format(SDocUnitTitle + ': %s', [AModule.Name, SDocResStrings]));
 
 
@@ -1517,7 +1631,6 @@ var
   Section,CodeEl: THTMLElement;
   Section,CodeEl: THTMLElement;
 
 
 begin
 begin
-  AppendMenuBar(-1);
   Section:=CreateSection(ContentElement);
   Section:=CreateSection(ContentElement);
   AppendTitle(Section,AConst.Name,AConst.Hints);
   AppendTitle(Section,AConst.Name,AConst.Hints);
   AppendShortDescr(CreatePara(Section), AConst);
   AppendShortDescr(CreatePara(Section), AConst);
@@ -1636,7 +1749,7 @@ procedure TNewHTMLWriter.AppendProcedureTypeDecl(aType: TPasProcedureType);
 
 
 begin
 begin
   AppendHighlightedCode(ContentElement,CreateCodeLines(['type','  '+aType.GetDeclaration(True)+';']));
   AppendHighlightedCode(ContentElement,CreateCodeLines(['type','  '+aType.GetDeclaration(True)+';']));
-//  AppendProcArgsSection(ContentElement, AType);
+  AppendProcArgsSection(ContentElement, AType);
 end;
 end;
 
 
 
 
@@ -1717,7 +1830,6 @@ var
   Section,CodeEl: THTMLElement;
   Section,CodeEl: THTMLElement;
   DocNode: TDocNode;
   DocNode: TDocNode;
 begin
 begin
-  AppendMenuBar(-1);
   Section:=CreateSection(ContentElement);
   Section:=CreateSection(ContentElement);
   AppendTitle(Section,AType.Name,AType.Hints);
   AppendTitle(Section,AType.Name,AType.Hints);
   AppendShortDescr(CreatePara(section), AType);
   AppendShortDescr(CreatePara(section), AType);
@@ -1862,7 +1974,6 @@ var
   DocNode: TDocNode;
   DocNode: TDocNode;
 begin
 begin
   // Menu bar
   // Menu bar
-  AppendMenuBar(-1);
   // Title, short description & navs
   // Title, short description & navs
   lSection:=CreateSection(ContentElement);
   lSection:=CreateSection(ContentElement);
   AppendTitle(lSection,AClass.Name,AClass.Hints);
   AppendTitle(lSection,AClass.Name,AClass.Hints);
@@ -2003,7 +2114,6 @@ var
   lSection,TitleEl, linkEl: THTMLElement;
   lSection,TitleEl, linkEl: THTMLElement;
 
 
 begin
 begin
-  AppendMenuBar(-1);
   lSection:=CreateSection(ContentElement);
   lSection:=CreateSection(ContentElement);
   TitleEl:=CreateH1(lSection);
   TitleEl:=CreateH1(lSection);
   AppendText(TitleEl, GetMemberOverviewTitle(aType));
   AppendText(TitleEl, GetMemberOverviewTitle(aType));
@@ -2017,7 +2127,6 @@ procedure TNewHTMLWriter.CreateClassInheritedSubpage(AClass: TPasClassType; aTyp
 var
 var
   lSection,TitleEl, linkEl: THTMLElement;
   lSection,TitleEl, linkEl: THTMLElement;
 begin
 begin
-  AppendMenuBar(-1);
   lSection:=CreateSection(ContentElement);
   lSection:=CreateSection(ContentElement);
   TitleEl:=CreateH1(lSection);
   TitleEl:=CreateH1(lSection);
   AppendText(TitleEl, GetMemberOverviewTitle(aType));
   AppendText(TitleEl, GetMemberOverviewTitle(aType));
@@ -2101,7 +2210,6 @@ var
   s: String;
   s: String;
 
 
 begin
 begin
-  AppendMenuBar(-1);
   AppendTitle(ContentElement,AElement.FullName,AElement.Hints);
   AppendTitle(ContentElement,AElement.FullName,AElement.Hints);
   AppendShortDescr(CreatePara(ContentElement), AElement);
   AppendShortDescr(CreatePara(ContentElement), AElement);
 
 
@@ -2133,14 +2241,15 @@ end;
 
 
 procedure TNewHTMLWriter.CreateVarPageBody(AVar: TPasVariable);
 procedure TNewHTMLWriter.CreateVarPageBody(AVar: TPasVariable);
 var
 var
-  CodeEl: TDOMElement;
+  lSection,CodeEl: TDOMElement;
+
 begin
 begin
-  AppendMenuBar(-1);
-  AppendTitle(ContentElement,AVar.FullName,AVar.Hints);
-  AppendShortDescr(CreatePara(ContentElement), AVar);
-  AppendText(CreateH2(ContentElement), SDocDeclaration);
-  AppendSourceRef(ContentElement,AVar);
-  CodeEl := AppendCodeBlock(ContentElement);
+  lSection:=CreateSection(ContentElement);
+  AppendTitle(lSection,AVar.FullName,AVar.Hints);
+  AppendShortDescr(CreatePara(lSection), AVar);
+  AppendText(CreateH2(lSection), SDocDeclaration);
+  AppendSourceRef(lSection,AVar);
+  CodeEl := AppendCodeBlock(lSection);
   AppendPasSHFragment(CodeEl, GetElementCode(aVar,False),0);
   AppendPasSHFragment(CodeEl, GetElementCode(aVar,False),0);
   FinishElementPage(AVar);
   FinishElementPage(AVar);
 end;
 end;
@@ -2148,10 +2257,9 @@ end;
 procedure TNewHTMLWriter.CreateProcPageBody(AProc: TPasProcedureBase);
 procedure TNewHTMLWriter.CreateProcPageBody(AProc: TPasProcedureBase);
 
 
 var
 var
-  lSection,CodeEl: TDOMElement;
+  lSection,CodeEl: THTMLElement;
 
 
 begin
 begin
-  AppendMenuBar(-1);
   lSection:=CreateSection(ContentElement);
   lSection:=CreateSection(ContentElement);
   AppendTitle(lSection,AProc.Name,AProc.Hints);
   AppendTitle(lSection,AProc.Name,AProc.Hints);
   AppendShortDescr(CreatePara(lSection), AProc);
   AppendShortDescr(CreatePara(lSection), AProc);
@@ -2160,6 +2268,9 @@ begin
   AppendSourceRef(lSection,AProc);
   AppendSourceRef(lSection,AProc);
   CodeEl := CreateCode(lSection);
   CodeEl := CreateCode(lSection);
   AppendProcDecl(CodeEl, AProc);
   AppendProcDecl(CodeEl, AProc);
+  if aProc is TPasProcedure then
+    if Assigned(TPasProcedure(aProc).ProcType) then
+      AppendProcArgsSection(lSection, TPasProcedure(aProc).ProcType);
   FinishElementPage(AProc);
   FinishElementPage(AProc);
 end;
 end;
 
 

+ 8 - 1
utils/fpdoc/dwriter.pp

@@ -264,6 +264,7 @@ Type
     function GetOutputPageNames: TStrings;
     function GetOutputPageNames: TStrings;
     function GetPageCount: Integer;
     function GetPageCount: Integer;
     function LinkFix(ALink:String):String;
     function LinkFix(ALink:String):String;
+    procedure SetModule(AValue: TPasModule);
   Protected
   Protected
     FAllocator: TFileAllocator;
     FAllocator: TFileAllocator;
     Procedure LinkUnresolvedInc();
     Procedure LinkUnresolvedInc();
@@ -302,7 +303,7 @@ Type
     function InterpretOption(const Cmd, Arg: String): boolean; override;
     function InterpretOption(const Cmd, Arg: String): boolean; override;
     property PageCount: Integer read GetPageCount;
     property PageCount: Integer read GetPageCount;
     Property Allocator : TFileAllocator Read FAllocator;
     Property Allocator : TFileAllocator Read FAllocator;
-    Property Module: TPasModule  Read FModule Write FModule;
+    Property Module: TPasModule  Read FModule Write SetModule;
     Property CurDirectory: String Read FCurDirectory Write FCurDirectory;    // relative to curdir of process
     Property CurDirectory: String Read FCurDirectory Write FCurDirectory;    // relative to curdir of process
     property BaseDirectory: String read FBaseDirectory Write FBaseDirectory; // relative path to package base directory
     property BaseDirectory: String read FBaseDirectory Write FBaseDirectory; // relative path to package base directory
     Property OutputPageNames : TStrings Read GetOutputPageNames;
     Property OutputPageNames : TStrings Read GetOutputPageNames;
@@ -562,6 +563,12 @@ begin
   Result:= res;
   Result:= res;
 end;
 end;
 
 
+procedure TMultiFileDocWriter.SetModule(AValue: TPasModule);
+begin
+  if FModule=AValue then Exit;
+  FModule:=AValue;
+end;
+
 { Used for:
 { Used for:
   - <link> elements in descriptions
   - <link> elements in descriptions
   - "see also" entries
   - "see also" entries

+ 124 - 63
utils/fpdoc/fpdocs.css

@@ -95,67 +95,128 @@ span.toggletreeopen {
     padding-left: 20px;
     padding-left: 20px;
 }
 }
 
 
-ul.classtreelist li { padding-left: 0px; }
-
-ul.classtreelist { list-style-type:none; }
-
-li.classtree ul { display: block; }
- 
-li.classtreeclosed ul { display: none; }
-
-        /* --- Base Structure Styling --- */
-        .treeview, .treeview ul {
-            list-style: none; /* Remove default bullets */
-            padding-left: 15px;
-            margin: 0;
-        }
-
-        .treeview li {
-            line-height: 1.5;
-            cursor: pointer;
-            position: relative; /* Needed for positioning the pseudo-element */
-            padding-left: 5px; /* Add some space for the icon */
-        }
-
-        /* --- Nested List Visibility --- */
-
-        /* Hide all nested ULs by default */
-        .treeview ul {
-            display: none;
-        }
-
-        /* Show the nested UL when the parent LI has the 'expanded' class */
-        .treeview li.expanded > ul {
-            display: block;
-        }
-
-        /* --- Icon Logic using ::before Pseudo-Element --- */
-        
-        /* 1. Default/Collapsed State for Parent Nodes */
-        .treeview li.parent::before {
-            /* Right-pointing triangle: &#9656; or \25B8 */
-            content: '\25B8'; 
-            margin-right: 5px;
-            color: #007bff;
-            display: inline-block;
-            font-weight: bold;
-            font-size: 18px; /* Adjust size to look neat */
-        }
-
-        /* 2. Expanded State for Parent Nodes */
-        .treeview li.expanded.parent::before {
-            /* Down-pointing triangle: &#9662; or \25BE */
-            content: '\25BE';
-        }
-
-        /* 3. Styling for Leaf Nodes (No Expansion) */
-        /* The element without the 'parent' class is a leaf node */
-        .treeview li:not(.parent)::before {
-            /* Black circle/dot for a simple leaf icon: &#9679; or \25CF */
-            content: '\25CF'; 
-            margin-right: 5px;
-            color: gray;
-            font-size: 0.8em;
-            cursor: default; 
-        }
+span.identifier {
+  font-style: italic;
+}
+
+
+
+/*  --------------------------------------------------------------------
+ *  Side menu styling 
+ *  -------------------------------------------------------------------- */
+
+.burger-icon {
+    font-size: 1.5rem; 
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    line-height: 1; 
+}
+
+/* Ensure the main container accounts for the navbar height */
+#main-layout {
+    display: flex;
+    min-height: calc(100vh - 52px); /* 52px is the standard Bulma navbar height */
+    position: relative;
+}
+
+/* 2. Side Menu (Off-Canvas/Collapsed State) */
+#side-menu {
+    /* Position the menu absolutely so it doesn't displace content in the flow */
+    position: absolute; 
+    top: 0;
+    left: 0;
+    height: 100%; /* Full height of the main-layout container */
+    width: 10em; 
+    padding: 10px;
+    background-color: #f5f5f5; /* Bulma's 'bis' color for contrast */
+    box-shadow: 2px 0 3px rgba(0, 0, 0, 0.1);
+    
+    /* Hidden off-screen */
+    transform: translateX(-10em); 
+    transition: transform 0.3s ease-in-out;
+    z-index: 100; /* Ensure it is above the main content */
+}
+
+/* 3. Side Menu (Expanded State) */
+#side-menu.is-expanded {
+    /* Slide it into view */
+    transform: translateX(0);
+}
+
+/* 4. Main Content Area (Initial/Collapsed State) */
+#main-content {
+    flex-grow: 1; 
+    width: 100%; /* Ensures it fills the remaining space */
+    
+    /* Start with no padding on the left */
+    padding-left: 0 !important; 
+    transition: padding-left 0.3s ease-in-out; 
+}
+
+/* 5. Main Content Area (Shifted State) */
+#main-content.is-shifted {
+    /* When the menu is open, shift the content to the right to reveal the menu */
+    padding-left: 200px !important;
+}
+
+
+/*  --------------------------------------------------------------------
+ *  Class inheritance tree styling 
+ *  -------------------------------------------------------------------- */
+   
+.treeview, .treeview ul {
+    list-style: none; /* Remove default bullets */
+    padding-left: 15px;
+    margin: 0;
+}
+
+.treeview li {
+    line-height: 1.5;
+    cursor: pointer;
+    position: relative; /* Needed for positioning the pseudo-element */
+    padding-left: 5px; /* Add some space for the icon */
+}
+
+/* --- Nested List Visibility --- */
+
+/* Hide all nested ULs by default */
+.treeview ul {
+    display: none;
+}
+
+/* Show the nested UL when the parent LI has the 'expanded' class */
+.treeview li.expanded > ul {
+    display: block;
+}
+
+/* --- Icon Logic using ::before Pseudo-Element --- */
+
+/* 1. Default/Collapsed State for Parent Nodes */
+.treeview li.parent::before {
+    /* Right-pointing triangle: &#9656; or \25B8 */
+    content: '\25B8'; 
+    margin-right: 5px;
+    color: #007bff;
+    display: inline-block;
+    font-weight: bold;
+    font-size: 18px; /* Adjust size to look neat */
+}
+
+/* 2. Expanded State for Parent Nodes */
+.treeview li.expanded.parent::before {
+    /* Down-pointing triangle: &#9662; or \25BE */
+    content: '\25BE';
+}
+
+/* 3. Styling for Leaf Nodes (No Expansion) */
+/* The element without the 'parent' class is a leaf node */
+.treeview li:not(.parent)::before {
+    /* Black circle/dot for a simple leaf icon: &#9679; or \25CF */
+    content: '\25CF'; 
+    margin-right: 5px;
+    color: gray;
+    font-size: 0.8em;
+    cursor: default; 
+}
 
 

+ 1 - 0
utils/fpdoc/fpdocstrs.pp

@@ -6,6 +6,7 @@ interface
 
 
 resourcestring
 resourcestring
   // Output strings
   // Output strings
+  SDocReference              = 'Reference';
   SDocPackageTitle           = 'Reference for package ''%s''';
   SDocPackageTitle           = 'Reference for package ''%s''';
   SDocPackageMenuTitle       = 'Package ''%s''';
   SDocPackageMenuTitle       = 'Package ''%s''';
   SDocPackageLinkTitle       = 'Package';
   SDocPackageLinkTitle       = 'Package';