diff --git a/MCServer/Plugins/APIDump/main.lua b/MCServer/Plugins/APIDump/main.lua index 9865f4cf1..1ba9397f5 100644 --- a/MCServer/Plugins/APIDump/main.lua +++ b/MCServer/Plugins/APIDump/main.lua @@ -753,7 +753,8 @@ function WriteHtmlHook(a_Hook)
]]); f:write(LinkifyString(a_Hook.Desc)); - f:write("
function " .. a_Hook.DefaultFnName .. "("); + f:write("Callback function
The default name for the callback function is "); + f:write(a_Hook.DefaultFnName .. ". It has the following signature:
function " .. a_Hook.DefaultFnName .. "("); if (a_Hook.Params == nil) then a_Hook.Params = {}; end @@ -774,7 +775,12 @@ function WriteHtmlHook(a_Hook) cPluginManager.AddHook(cPluginManager.]] .. a_Hook.Name .. ", My" .. a_Hook.DefaultFnName .. [[);]]); - -- TODO: Other code examples + local Examples = a_Hook.CodeExamples or {}; + for i, example in ipairs(Examples) do + f:write("" .. example.Title .. "
\n"); + f:write("" .. example.Desc .. "
\n"); + f:write("" .. example.Code .. "\n"); + end f:close(); end