From 81274b6ee95d463e25c8a5b15dd471ca914f5584 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Sat, 2 May 2015 12:26:19 +0200 Subject: APIDump: Added an "apishow" command. Launches the webbrowser to show the locally exported API docs. --- MCServer/Plugins/APIDump/main_APIDump.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MCServer/Plugins/APIDump/main_APIDump.lua b/MCServer/Plugins/APIDump/main_APIDump.lua index 239bec69c..013ec7bef 100644 --- a/MCServer/Plugins/APIDump/main_APIDump.lua +++ b/MCServer/Plugins/APIDump/main_APIDump.lua @@ -1643,6 +1643,15 @@ end +local function HandleCmdApiShow(a_Split, a_EntireCmd) + os.execute("API" .. cFile:GetPathSeparator() .. "index.html") + return true, "Launching the browser to show the API docs..." +end + + + + + function Initialize(Plugin) g_Plugin = Plugin; g_PluginFolder = Plugin:GetLocalFolder(); @@ -1651,6 +1660,7 @@ function Initialize(Plugin) -- Bind a console command to dump the API: cPluginManager:BindConsoleCommand("api", HandleCmdApi, "Dumps the Lua API docs into the API/ subfolder") + cPluginManager:BindConsoleCommand("apishow", HandleCmdApiShow, "Runs the default browser to show the API docs") -- Add a WebAdmin tab that has a Dump button g_Plugin:AddWebTab("APIDump", HandleWebAdminDump) -- cgit v1.2.3