summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/APIDump/main.lua
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-12 18:31:55 +0200
committermadmaxoft <github@xoft.cz>2013-10-12 18:31:55 +0200
commit82834ee1ed17ba542049d583ad3ebde2ace22025 (patch)
tree3031dde5c998805c1b4ce0f88bc33f46f866cd12 /MCServer/Plugins/APIDump/main.lua
parentAPIDump: Added an OnBlockToPickups() code example. (diff)
downloadcuberite-82834ee1ed17ba542049d583ad3ebde2ace22025.tar
cuberite-82834ee1ed17ba542049d583ad3ebde2ace22025.tar.gz
cuberite-82834ee1ed17ba542049d583ad3ebde2ace22025.tar.bz2
cuberite-82834ee1ed17ba542049d583ad3ebde2ace22025.tar.lz
cuberite-82834ee1ed17ba542049d583ad3ebde2ace22025.tar.xz
cuberite-82834ee1ed17ba542049d583ad3ebde2ace22025.tar.zst
cuberite-82834ee1ed17ba542049d583ad3ebde2ace22025.zip
Diffstat (limited to '')
-rw-r--r--MCServer/Plugins/APIDump/main.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/MCServer/Plugins/APIDump/main.lua b/MCServer/Plugins/APIDump/main.lua
index 1ba9397f5..3827668e3 100644
--- a/MCServer/Plugins/APIDump/main.lua
+++ b/MCServer/Plugins/APIDump/main.lua
@@ -661,6 +661,8 @@ function WriteHtmlClass(a_ClassAPI, a_AllAPI)
cf:write([[<html><head><title>MCServer API - ]] .. a_ClassAPI.Name .. [[ class</title>
<link rel="stylesheet" type="text/css" href="main.css" />
+ <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
+ <script src="http://google-code-prettify.googlecode.com/svn/trunk/src/lang-lua.js"></script>
</head><body>
<h1>Contents</h1>
<ul>
@@ -748,13 +750,16 @@ function WriteHtmlHook(a_Hook)
end
f:write([[<html><head><title>MCServer API - ]] .. a_Hook.DefaultFnName .. [[ hook</title>
<link rel="stylesheet" type="text/css" href="main.css" />
+ <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
+ <script src="http://google-code-prettify.googlecode.com/svn/trunk/src/lang-lua.js"></script>
</head><body>
<h1>]] .. a_Hook.Name .. [[ hook</h1>
<p>
]]);
f:write(LinkifyString(a_Hook.Desc));
f:write("</p><h1>Callback function</h1><p>The default name for the callback function is ");
- f:write(a_Hook.DefaultFnName .. ". It has the following signature:<pre>function " .. a_Hook.DefaultFnName .. "(");
+ f:write(a_Hook.DefaultFnName .. ". It has the following signature:");
+ f:write("<pre class=\"prettyprint lang-lua\">function " .. a_Hook.DefaultFnName .. "(");
if (a_Hook.Params == nil) then
a_Hook.Params = {};
end
@@ -771,7 +776,7 @@ function WriteHtmlHook(a_Hook)
f:write("</table></p>\n<p>" .. (a_Hook.Returns or "") .. "</p>\n");
f:write([[<h1>Code examples</h1>
<h2>Registering the callback</h2>
-<pre>
+<pre class=\"prettyprint lang-lua\">
cPluginManager.AddHook(cPluginManager.]] .. a_Hook.Name .. ", My" .. a_Hook.DefaultFnName .. [[);
</pre>
]]);
@@ -779,7 +784,7 @@ cPluginManager.AddHook(cPluginManager.]] .. a_Hook.Name .. ", My" .. a_Hook.Defa
for i, example in ipairs(Examples) do
f:write("<h2>" .. example.Title .. "</h2>\n");
f:write("<p>" .. example.Desc .. "</p>\n");
- f:write("<pre>" .. example.Code .. "</pre>\n");
+ f:write("<pre class=\"prettyprint lang-lua\">" .. example.Code .. "</pre>\n");
end
f:close();
end