From e8c84519daea1d7bb3659118a860e7aad56f6e9b Mon Sep 17 00:00:00 2001 From: Mattes D Date: Tue, 6 Sep 2016 21:03:18 +0200 Subject: APIDoc: Allow to create a link to an object. (#3371) --- Server/Plugins/APIDump/main_APIDump.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Server/Plugins') diff --git a/Server/Plugins/APIDump/main_APIDump.lua b/Server/Plugins/APIDump/main_APIDump.lua index 32de2890e..47848c26a 100644 --- a/Server/Plugins/APIDump/main_APIDump.lua +++ b/Server/Plugins/APIDump/main_APIDump.lua @@ -778,12 +778,17 @@ local function WriteHtmlClass(a_ClassAPI, a_ClassMenu) cf:write("

Functions inherited from ", a_InheritedName, "

\n"); end cf:write("\n\n"); + -- Store all function names, to create unique anchor names for all functions + local TableOverloadedFunctions = {} for _, func in ipairs(a_Functions) do local StaticClause = "" if (func.IsStatic) then StaticClause = "(STATIC) " end - cf:write("\n"); + -- Increase number by one + TableOverloadedFunctions[func.Name] = (TableOverloadedFunctions[func.Name] or 0) + 1 + -- Add the anchor names as a title + cf:write("\n"); cf:write("\n"); cf:write("\n"); cf:write("\n"); @@ -794,7 +799,7 @@ local function WriteHtmlClass(a_ClassAPI, a_ClassMenu) local function WriteConstantTable(a_Constants, a_Source) cf:write("
NameParametersReturn valueNotes
", func.Name, "
", func.Name, "", LinkifyString(func.Params or "", (a_InheritedName or a_ClassAPI.Name)), "", LinkifyString(func.Return or "", (a_InheritedName or a_ClassAPI.Name)), "", StaticClause .. LinkifyString(func.Notes or "(undocumented)", (a_InheritedName or a_ClassAPI.Name)), "
\n\n"); for _, cons in ipairs(a_Constants) do - cf:write("\n"); + cf:write("\n"); cf:write("\n"); cf:write("\n"); end @@ -837,7 +842,7 @@ local function WriteHtmlClass(a_ClassAPI, a_ClassMenu) cf:write("
NameValueNotes
", cons.Name, "
", cons.Name, "", cons.Value, "", LinkifyString(cons.Notes or "", a_Source), "
\n"); for _, var in ipairs(a_Variables) do - cf:write("\n"); + cf:write("\n"); cf:write("\n"); cf:write("\n \n"); end -- cgit v1.2.3
NameTypeNotes
", var.Name, "
", var.Name, "", LinkifyString(var.Type or "(undocumented)", a_InheritedName or a_ClassAPI.Name), "", LinkifyString(var.Notes or "", a_InheritedName or a_ClassAPI.Name), "