From 9b388cd239062ad35c9bf480ef896f37a6cf1c4c Mon Sep 17 00:00:00 2001 From: Mattes D Date: Tue, 31 May 2016 23:57:53 +0200 Subject: [PATCH] APIDump: Changed not to use globals, added more doxycomments. --- Server/Plugins/APIDump/APIDesc.lua | 2 +- Server/Plugins/APIDump/main_APIDump.lua | 104 ++++++++++++++---------- 2 files changed, 64 insertions(+), 42 deletions(-) diff --git a/Server/Plugins/APIDump/APIDesc.lua b/Server/Plugins/APIDump/APIDesc.lua index a09d4b37d..13c2389f1 100644 --- a/Server/Plugins/APIDump/APIDesc.lua +++ b/Server/Plugins/APIDump/APIDesc.lua @@ -5,7 +5,7 @@ -g_APIDesc = +return { Classes = { diff --git a/Server/Plugins/APIDump/main_APIDump.lua b/Server/Plugins/APIDump/main_APIDump.lua index 4d8f58483..1129a24ec 100644 --- a/Server/Plugins/APIDump/main_APIDump.lua +++ b/Server/Plugins/APIDump/main_APIDump.lua @@ -47,6 +47,7 @@ end +--- Returns the API currently detected from the global environment local function CreateAPITables() --[[ We want an API table of the following shape: @@ -133,8 +134,7 @@ local function CreateAPITables() if ( (v ~= _G) and -- don't want the global namespace (v ~= _G.packages) and -- don't want any packages - (v ~= _G[".get"]) and - (v ~= g_APIDesc) + (v ~= _G[".get"]) ) then if (type(v) == "table") then local cls = ParseClass(i, v) @@ -166,13 +166,16 @@ end -local function WriteArticles(f) +--- Writes links to articles in a bullet format into the output HTML file +-- f is the output file stream +-- a_APIDesc is the API description as read from APIDesc.lua +local function WriteArticles(f, a_APIDesc) f:write([[

Articles

The following articles provide various extra information on plugin development