diff options
Diffstat (limited to 'MCServer/Plugins/APIDump/main.lua')
-rw-r--r-- | MCServer/Plugins/APIDump/main.lua | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/MCServer/Plugins/APIDump/main.lua b/MCServer/Plugins/APIDump/main.lua index 73acd3e69..300a4d9ce 100644 --- a/MCServer/Plugins/APIDump/main.lua +++ b/MCServer/Plugins/APIDump/main.lua @@ -291,6 +291,19 @@ end function ReadDescriptions(a_API) + -- Returns true if the class of the specified name is to be ignored + local function IsClassIgnored(a_ClsName) + if (g_APIDesc.IgnoreClasses == nil) then + return false; + end + for i, name in ipairs(g_APIDesc.IgnoreClasses) do + if (a_ClsName:match(name)) then + return true; + end + end + return false; + end + -- Returns true if the function (specified by its fully qualified name) is to be ignored local function IsFunctionIgnored(a_FnName) if (g_APIDesc.IgnoreFunctions == nil) then @@ -317,6 +330,20 @@ function ReadDescriptions(a_API) return false; end + -- Remove ignored classes from a_API: + local APICopy = {}; + for i, cls in ipairs(a_API) do + if not(IsClassIgnored(cls.Name)) then + table.insert(APICopy, cls); + else + LOG("Ignoring class " .. cls.Name); + end + end + for i = 1, #a_API do + a_API[i] = APICopy[i]; + end; + + -- Process the documentation for each class: for i, cls in ipairs(a_API) do -- Rename special functions: for j, fn in ipairs(cls.Functions) do @@ -335,6 +362,9 @@ function ReadDescriptions(a_API) elseif (fn.Name == ".sub") then fn.DocID = "operator_sub"; fn.Name = "<i>operator -</i>"; + elseif (fn.Name == ".eq") then + fn.DocID = "operator_sub"; + fn.Name = "<i>operator ==</i>"; end end @@ -591,7 +621,7 @@ function WriteHtmlClass(a_ClassAPI, a_AllAPI) if (a_ClassAPI.AdditionalInfo ~= nil) then for i, additional in ipairs(a_ClassAPI.AdditionalInfo) do cf:write("<a name=\"additionalinfo_" .. i .. "\"><h1>" .. additional.Header .. "</h1></a>\n"); - cf:write(additional.Contents); + cf:write(LinkifyString(additional.Contents)); end end |