Skip to content

Commit baf23d8

Browse files
author
Retype GitHub Action
committed
Refreshes Retype-generated documentation.
Process triggered by Grabsky.
1 parent ee2bedb commit baf23d8

11 files changed

Lines changed: 183 additions & 103 deletions

File tree

404.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width,initial-scale=1">
6-
<meta name="turbo-cache-control" content="no-cache" data-turbo-track="reload" data-track-token="3.7.0.797543019182">
6+
<meta name="turbo-cache-control" content="no-cache" data-turbo-track="reload" data-track-token="3.7.0.797801949918">
77

88
<!-- See retype.com -->
99
<meta name="generator" content="Retype 3.7.0">
@@ -28,11 +28,11 @@
2828
<script data-cfasync="false">(function () { var el = document.documentElement, m = localStorage.getItem("doc_theme"), wm = window.matchMedia; if (m === "dark" || (!m && wm && wm("(prefers-color-scheme: dark)").matches)) { el.classList.add("dark") } else { el.classList.remove("dark") } })();</script>
2929

3030
<link href="/assets/favicon.png" rel="icon">
31-
<link href="/resources/css/retype.css?v=3.7.0.797543019182" rel="stylesheet">
31+
<link href="/resources/css/retype.css?v=3.7.0.797801949918" rel="stylesheet">
3232

33-
<script data-cfasync="false" src="/resources/js/config.js?v=3.7.0.797543019182" data-turbo-eval="false" defer></script>
33+
<script data-cfasync="false" src="/resources/js/config.js?v=3.7.0.797801949918" data-turbo-eval="false" defer></script>
3434
<script data-cfasync="false" src="/resources/js/retype.js?v=3.7.0" data-turbo-eval="false" defer></script>
35-
<script id="lunr-js" data-cfasync="false" src="/resources/js/lunr.js?v=3.7.0.797543019182" data-turbo-eval="false" defer></script>
35+
<script id="lunr-js" data-cfasync="false" src="/resources/js/lunr.js?v=3.7.0.797801949918" data-turbo-eval="false" defer></script>
3636

3737
<style>
3838

commands/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width,initial-scale=1">
6-
<meta name="turbo-cache-control" content="no-cache" data-turbo-track="reload" data-track-token="3.7.0.797543019182">
6+
<meta name="turbo-cache-control" content="no-cache" data-turbo-track="reload" data-track-token="3.7.0.797801949918">
77

88
<!-- See retype.com -->
99
<meta name="generator" content="Retype 3.7.0">
@@ -31,11 +31,11 @@
3131
<script data-cfasync="false">(function () { var el = document.documentElement, m = localStorage.getItem("doc_theme"), wm = window.matchMedia; if (m === "dark" || (!m && wm && wm("(prefers-color-scheme: dark)").matches)) { el.classList.add("dark") } else { el.classList.remove("dark") } })();</script>
3232

3333
<link href="../assets/favicon.png" rel="icon">
34-
<link href="../resources/css/retype.css?v=3.7.0.797543019182" rel="stylesheet">
34+
<link href="../resources/css/retype.css?v=3.7.0.797801949918" rel="stylesheet">
3535

36-
<script data-cfasync="false" src="../resources/js/config.js?v=3.7.0.797543019182" data-turbo-eval="false" defer></script>
36+
<script data-cfasync="false" src="../resources/js/config.js?v=3.7.0.797801949918" data-turbo-eval="false" defer></script>
3737
<script data-cfasync="false" src="../resources/js/retype.js?v=3.7.0" data-turbo-eval="false" defer></script>
38-
<script id="lunr-js" data-cfasync="false" src="../resources/js/lunr.js?v=3.7.0.797543019182" data-turbo-eval="false" defer></script>
38+
<script id="lunr-js" data-cfasync="false" src="../resources/js/lunr.js?v=3.7.0.797801949918" data-turbo-eval="false" defer></script>
3939

4040
<style>
4141

dependencies/index.html

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width,initial-scale=1">
6-
<meta name="turbo-cache-control" content="no-cache" data-turbo-track="reload" data-track-token="3.7.0.797543019182">
6+
<meta name="turbo-cache-control" content="no-cache" data-turbo-track="reload" data-track-token="3.7.0.797801949918">
77

88
<!-- See retype.com -->
99
<meta name="generator" content="Retype 3.7.0">
1010

1111
<!-- Primary Meta Tags -->
1212
<title>Dependencies</title>
1313
<meta name="title" content="Dependencies">
14-
<meta name="description" content="TO-DO">
14+
<meta name="description" content="LuaLink provides a way to access and use plugins' APIs in your scripts.">
1515

1616
<!-- Canonical -->
1717
<link rel="canonical" href="/dependencies/">
@@ -20,22 +20,23 @@
2020
<meta property="og:type" content="website">
2121
<meta property="og:url" content="/dependencies/">
2222
<meta property="og:title" content="Dependencies">
23-
<meta property="og:description" content="TO-DO">
23+
<meta property="og:description" content="LuaLink provides a way to access and use plugins' APIs in your scripts.">
2424

2525
<!-- Twitter -->
2626
<meta property="twitter:card" content="summary_large_image">
2727
<meta property="twitter:url" content="/dependencies/">
2828
<meta property="twitter:title" content="Dependencies">
29-
<meta property="twitter:description" content="TO-DO">
29+
<meta property="twitter:description" content="LuaLink provides a way to access and use plugins' APIs in your scripts.">
3030

3131
<script data-cfasync="false">(function () { var el = document.documentElement, m = localStorage.getItem("doc_theme"), wm = window.matchMedia; if (m === "dark" || (!m && wm && wm("(prefers-color-scheme: dark)").matches)) { el.classList.add("dark") } else { el.classList.remove("dark") } })();</script>
3232

3333
<link href="../assets/favicon.png" rel="icon">
34-
<link href="../resources/css/retype.css?v=3.7.0.797543019182" rel="stylesheet">
34+
<link href="../resources/css/retype.css?v=3.7.0.797801949918" rel="stylesheet">
3535

36-
<script data-cfasync="false" src="../resources/js/config.js?v=3.7.0.797543019182" data-turbo-eval="false" defer></script>
36+
<script data-cfasync="false" src="../resources/js/config.js?v=3.7.0.797801949918" data-turbo-eval="false" defer></script>
3737
<script data-cfasync="false" src="../resources/js/retype.js?v=3.7.0" data-turbo-eval="false" defer></script>
38-
<script id="lunr-js" data-cfasync="false" src="../resources/js/lunr.js?v=3.7.0.797543019182" data-turbo-eval="false" defer></script>
38+
<script id="lunr-js" data-cfasync="false" src="../resources/js/lunr.js?v=3.7.0.797801949918" data-turbo-eval="false" defer></script>
39+
<script id="prism-js" data-cfasync="false" src="../resources/js/prism.js?v=3.7.0.797801949918" defer></script>
3940

4041
<style>
4142

@@ -244,7 +245,57 @@ <h1>
244245
<span>Dependencies</span>
245246
</h1>
246247
</doc-anchor-target>
247-
<p>TO-DO</p>
248+
<p>LuaLink provides a way to access and use plugins&#x27; APIs in your scripts. This feature is very powerful and makes it easy to integrate scripts with other plugins. It must be noted this has not been thoroughly tested yet and some issues may arise. Please be cautious when using this feature.</p>
249+
<div class="flex mb-6">
250+
<div class="shrink-0 w-1 rounded-tl rounded-bl bg-yellow-500"></div>
251+
<div class="flex w-full py-4 border border-l-0 border-gray-300 rounded-tr rounded-br doc-alert bg-white dark:bg-dark-700 dark:border-dark-700" role="alert">
252+
<div class="flex items-center ml-4 h-7">
253+
<svg xmlns="http://www.w3.org/2000/svg" class="mb-px text-yellow-500" width="22" height="22" viewBox="0 0 24 24" role="presentation">
254+
<g fill="currentColor"><g>
255+
<path d="M22.48 15.59L14.01 1.45A2.968 2.968 0 0012.16.09c-.78-.19-1.58-.07-2.27.35-.41.25-.76.6-1.01 1.01v.01L.4 15.6c-.83 1.43-.33 3.27 1.1 4.1.45.26.95.4 1.48.4h16.95c.8-.01 1.55-.33 2.11-.9.56-.57.87-1.33.86-2.13a3.04 3.04 0 00-.42-1.48zm-1.87 2.21c-.19.19-.44.3-.69.3H2.99c-.17 0-.34-.05-.49-.13a.992.992 0 01-.37-1.35L10.6 2.48c.08-.14.2-.25.34-.33a.992.992 0 011.37.33l8.46 14.13c.09.15.13.32.13.49 0 .26-.1.51-.29.7z"></path>
256+
<path d="M11.45 12.1c.55 0 1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .56.45 1 1 1zM11.46 14.1c-.56 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1z"></path>
257+
</g></g>
258+
</svg>
259+
</div>
260+
<div class="pr-5 ml-3 w-full">
261+
<h5>EXPERIMENTAL</h5>
262+
<p>Current implementation, despite being relatively simple and fully functional, is still marked as experimental.
263+
We may introuduce breaking changes to the way dependencies are declared and exposed to scripts.</p>
264+
</div>
265+
</div>
266+
</div>
267+
<br />
268+
<!--
269+
## Declaring Dependencies
270+
To declare a dependency, you must create an `init.lua` file in your script's folder. In this example we will use **[PlaceholderAPI](https://www.spigotmc.org/resources/placeholderapi.19978/)**.
271+
272+
```lua /plugins/LuaLink/scripts/example_script/init.lua
273+
depends {
274+
"PlaceholderAPI"
275+
}
276+
```
277+
278+
**Why is that important?** Declaring dependency will ensure that script will not be loaded if **PlaceholderAPI** plugin is missing.
279+
-->
280+
<doc-anchor-target id="using-dependencies">
281+
<h2>
282+
<doc-anchor-trigger class="header-anchor-trigger" to="#using-dependencies">#</doc-anchor-trigger>
283+
<span>Using Dependencies</span>
284+
</h2>
285+
</doc-anchor-target>
286+
<p>Importing any class that belongs to an installed plugin should work out of the box. In this example we will use <strong><a href="https://www.spigotmc.org/resources/placeholderapi.19978/">PlaceholderAPI</a></strong>, a plugin you should be already familiar with.</p>
287+
<p>Assuming the plugin is <strong>installed</strong> and <strong>enabled</strong> on the server, we should be able to call its API like any other function.</p>
288+
<div class="codeblock-wrapper"><doc-codeblock>
289+
<div class="codeblock-title">/plugins/LuaLink/scripts/example_script/main.lua</div>
290+
<pre class="language-lua"><code v-pre class="language-lua">local PlaceholderAPI = import(&quot;me.clip.placeholderapi.PlaceholderAPI&quot;)
291+
292+
script.logger:info(PlaceholderAPI:setPlaceholders(nil, &quot;Server is running %server_variant% %server_version_full%&quot;))</code></pre>
293+
</doc-codeblock></div>
294+
<div class="codeblock-wrapper"><doc-codeblock>
295+
<div class="codeblock-title">Console Output</div>
296+
<pre class="language-log"><code v-pre class="language-log">[00:00:00 INFO]: [LuaLink/example_script] Server is running Paper 1.21.4-224</code></pre>
297+
</doc-codeblock></div>
298+
<p>That&#x27;s it. As mentioned earlier, current implementation is really simple and should just work.</p>
248299

249300

250301
<!-- Required only on API pages -->
@@ -311,6 +362,6 @@ <h1>
311362

312363
<div id="docs-overlay-target"></div>
313364

314-
<script data-cfasync="false">window.__DOCS__ = { "title": "Dependencies", level: 1, icon: "file", hasPrism: false, hasMermaid: false, hasMath: false, tocDepth: 23 }</script>
365+
<script data-cfasync="false">window.__DOCS__ = { "title": "Dependencies", level: 1, icon: "file", hasPrism: true, hasMermaid: false, hasMath: false, tocDepth: 23 }</script>
315366
</body>
316367
</html>

getting-started/index.html

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width,initial-scale=1">
6-
<meta name="turbo-cache-control" content="no-cache" data-turbo-track="reload" data-track-token="3.7.0.797543019182">
6+
<meta name="turbo-cache-control" content="no-cache" data-turbo-track="reload" data-track-token="3.7.0.797801949918">
77

88
<!-- See retype.com -->
99
<meta name="generator" content="Retype 3.7.0">
@@ -31,12 +31,12 @@
3131
<script data-cfasync="false">(function () { var el = document.documentElement, m = localStorage.getItem("doc_theme"), wm = window.matchMedia; if (m === "dark" || (!m && wm && wm("(prefers-color-scheme: dark)").matches)) { el.classList.add("dark") } else { el.classList.remove("dark") } })();</script>
3232

3333
<link href="../assets/favicon.png" rel="icon">
34-
<link href="../resources/css/retype.css?v=3.7.0.797543019182" rel="stylesheet">
34+
<link href="../resources/css/retype.css?v=3.7.0.797801949918" rel="stylesheet">
3535

36-
<script data-cfasync="false" src="../resources/js/config.js?v=3.7.0.797543019182" data-turbo-eval="false" defer></script>
36+
<script data-cfasync="false" src="../resources/js/config.js?v=3.7.0.797801949918" data-turbo-eval="false" defer></script>
3737
<script data-cfasync="false" src="../resources/js/retype.js?v=3.7.0" data-turbo-eval="false" defer></script>
38-
<script id="lunr-js" data-cfasync="false" src="../resources/js/lunr.js?v=3.7.0.797543019182" data-turbo-eval="false" defer></script>
39-
<script id="prism-js" data-cfasync="false" src="../resources/js/prism.js?v=3.7.0.797543019182" defer></script>
38+
<script id="lunr-js" data-cfasync="false" src="../resources/js/lunr.js?v=3.7.0.797801949918" data-turbo-eval="false" defer></script>
39+
<script id="prism-js" data-cfasync="false" src="../resources/js/prism.js?v=3.7.0.797801949918" defer></script>
4040

4141
<style>
4242

@@ -296,12 +296,12 @@ <h3>
296296
</doc-anchor-target>
297297
<p>There are a couple of things to keep in mind when using LuaLink.</p>
298298
<ul>
299-
<li>Script life-cycle can be managed using <code v-pre>/lualink load</code>, <code v-pre>/lualink unload</code> and <code v-pre>/lualink reload</code> commands.<br />
300-
<sup>More on this can be found on the <strong><a href="../commands/">Commands</a></strong> page.</sup></li>
301-
<li>Each script is stored in a separate folder inside the <code v-pre>plugins/LuaLink/scripts</code> directory, and libraries are stored in the <code v-pre>plugins/LuaLink/libs</code> directory.<br />
302-
<sup>More about libraries can be found on the <strong><a href="../libraries/">Libraries</a></strong> page.</sup></li>
303-
<li>Entry point of the script (or library) is a file named <code v-pre>main.lua</code>.<br />
304-
<sup>More files can be created and loaded using the <code v-pre>require</code> keyword.</sup></li>
299+
<li>Each script is stored in a separate folder inside the <code v-pre>plugins/LuaLink/scripts</code> directory.<br />
300+
<sup>For example <code v-pre>/plugins/LuaLink/scripts/example/main.lua</code> will be loaded as <code v-pre>example</code> script.</sup></li>
301+
<li>Script life-cycle can be managed using <code v-pre>/lualink</code> command.<br />
302+
<sup>Full command reference is available on the <strong><a href="../commands/">Commands</a></strong> page.</sup></li>
303+
<li>Entry point of the script is a file named <code v-pre>main.lua</code>.<br />
304+
<sup>More files can be imported using the <code v-pre>require</code> keyword.</sup></li>
305305
</ul>
306306
<br />
307307
<doc-anchor-target id="script-life-cycle">
@@ -410,7 +410,7 @@ <h3>
410410
aliases = {&quot;e&quot;, &quot;print&quot;},
411411
permission = &quot;scripts.command.echo&quot;,
412412
description = &quot;Prints specified message to the sender.&quot;,
413-
usage = &quot;/echo [player]&quot;,
413+
usage = &quot;/echo [message]&quot;,
414414
tabComplete = onTabComplete
415415
})</code></pre>
416416
</doc-codeblock></div>
@@ -424,7 +424,7 @@ <h3>
424424
<p>Bukkit events can be hooked into relatively easily.</p>
425425
<div class="codeblock-wrapper"><doc-codeblock>
426426
<pre class="language-lua"><code v-pre class="language-lua">-- Called when player joins the server.
427-
script:registerEvent(&quot;org.bukkit.event.player.PlayerJoinEvent&quot;, function(event)
427+
script:registerListener(&quot;org.bukkit.event.player.PlayerJoinEvent&quot;, function(event)
428428
-- Getting player associated with the event.
429429
local player = event:getPlayer()
430430
-- Playing firework sound to the player.
@@ -443,28 +443,28 @@ <h3>
443443
<p>Scheduler can be used to register single-use, delayed or repeating tasks.</p>
444444
<div class="codeblock-wrapper"><doc-codeblock>
445445
<pre class="language-lua"><code v-pre class="language-lua">-- Schedules a task to be run on the next tick.
446-
scheduler:run(function()
446+
scheduler:run(function(runnable)
447447
-- Whatever belongs to the task goes here.
448448
end)
449449

450450
-- Schedules a task to be run after 20 ticks has passed.
451-
scheduler:runLater(function()
451+
scheduler:runDelayed(function(runnable)
452452
-- Whatever belongs to the task goes here.
453453
end, 20)
454454

455455
-- Schedules a task to be run after 20 ticks has passed, and repeated every 160 ticks.
456-
scheduler:runRepeating(function()
456+
scheduler:runRepeating(function(runnable)
457457
-- Whatever belongs to the task goes here.
458458
end, 20, 160)</code></pre>
459459
</doc-codeblock></div>
460460
<p>Tasks can also be run asynchronously, but please note that neither the Bukkit API nor the LuaLink API is guaranteed to be thread-safe.</p>
461461
<div class="codeblock-wrapper"><doc-codeblock>
462462
<pre class="language-lua"><code v-pre class="language-lua">-- Schedules asynchronous task to be run on the next tick.
463-
scheduler:runAsync(handler: () -&gt; void): BukkitTask
463+
scheduler:runAsync(handler: (BukkitRunnable) -&gt; void): BukkitTask
464464
-- Schedules asynchronous task to be run after {delay} ticks has passed.
465-
scheduler:runLaterAsync(handler: () -&gt; void, delay: number): BukkitTask
465+
scheduler:runDelayedAsync(handler: (BukkitRunnable) -&gt; void, delay: number): BukkitTask
466466
-- Schedules task to be run after {delay} ticks has passed, and repeated every {period} ticks.
467-
scheduler:runRepeatingAsync(handler: () -&gt; void, delay: number, period: number): BukkitTask</code></pre>
467+
scheduler:runRepeatingAsync(handler: (BukkitRunnable) -&gt; void, delay: number, period: number): BukkitTask</code></pre>
468468
</doc-codeblock></div>
469469

470470

index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width,initial-scale=1">
6-
<meta name="turbo-cache-control" content="no-cache" data-turbo-track="reload" data-track-token="3.7.0.797543019182">
6+
<meta name="turbo-cache-control" content="no-cache" data-turbo-track="reload" data-track-token="3.7.0.797801949918">
77

88
<!-- See retype.com -->
99
<meta name="generator" content="Retype 3.7.0">
@@ -31,12 +31,12 @@
3131
<script data-cfasync="false">(function () { var el = document.documentElement, m = localStorage.getItem("doc_theme"), wm = window.matchMedia; if (m === "dark" || (!m && wm && wm("(prefers-color-scheme: dark)").matches)) { el.classList.add("dark") } else { el.classList.remove("dark") } })();</script>
3232

3333
<link href="assets/favicon.png" rel="icon">
34-
<link href="resources/css/retype.css?v=3.7.0.797543019182" rel="stylesheet">
34+
<link href="resources/css/retype.css?v=3.7.0.797801949918" rel="stylesheet">
3535

36-
<script data-cfasync="false" src="resources/js/config.js?v=3.7.0.797543019182" data-turbo-eval="false" defer></script>
36+
<script data-cfasync="false" src="resources/js/config.js?v=3.7.0.797801949918" data-turbo-eval="false" defer></script>
3737
<script data-cfasync="false" src="resources/js/retype.js?v=3.7.0" data-turbo-eval="false" defer></script>
38-
<script id="lunr-js" data-cfasync="false" src="resources/js/lunr.js?v=3.7.0.797543019182" data-turbo-eval="false" defer></script>
39-
<script id="prism-js" data-cfasync="false" src="resources/js/prism.js?v=3.7.0.797543019182" defer></script>
38+
<script id="lunr-js" data-cfasync="false" src="resources/js/lunr.js?v=3.7.0.797801949918" data-turbo-eval="false" defer></script>
39+
<script id="prism-js" data-cfasync="false" src="resources/js/prism.js?v=3.7.0.797801949918" defer></script>
4040

4141
<style>
4242

0 commit comments

Comments
 (0)