Move hooks docs to their own section
This commit is contained in:
@@ -300,6 +300,35 @@ article header.module a {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
article header.section {
|
||||
color: rgb(255, 255, 255);
|
||||
background-color: var(--color-accent);
|
||||
padding: var(--padding-tiny);
|
||||
margin-top: var(--padding-small);
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
article header.section h1 {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
font-size: var(--font-big);
|
||||
font-weight: 100;
|
||||
letter-spacing: 2px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
article header.section h2 {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-size: var(--font-normal);
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
article header.section .section-separator {
|
||||
margin: var(--padding-tiny) 0;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
|
||||
details.category > summary {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
Submodule luacs-docs/lua/libs/ldoc updated: 69ef8c976e...d1d4e3700a
@@ -1,7 +1,7 @@
|
||||
-- luacheck: ignore 111
|
||||
|
||||
--[[--
|
||||
Hooks are basically functions that get called when events happen in-game, like chat messages.
|
||||
The Hook API allow you to listen to game events and modify the behavior/logic of the game.
|
||||
]]
|
||||
-- @code Hook
|
||||
-- @pragma nostrip
|
||||
@@ -50,6 +50,13 @@ function Hook.Call(eventName, parameters) end
|
||||
-- end, Hook.HookMethodType.After)
|
||||
function Hook.HookMethod(className, methodName, callback) end
|
||||
|
||||
--- Hooks
|
||||
-- @summary
|
||||
-- Hooks are functions that get called when events happen in-game, e.g. chat messages.
|
||||
--
|
||||
-- These can be used with `Hook.Add` and `Hook.Call`.
|
||||
-- @section hook
|
||||
|
||||
--- Game's fixed update rate, gets called normally 60 times a second.
|
||||
-- @realm shared
|
||||
function think() end
|
||||
@@ -248,4 +255,4 @@ function human.CPRSuccess(animController) end
|
||||
|
||||
--- Called after the CPR skill check fails.
|
||||
-- @realm shared
|
||||
function human.CPRFailed(animController) end
|
||||
function human.CPRFailed(animController) end
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
{%
|
||||
local kinds = {}
|
||||
local kindsIpairs = {}
|
||||
for kind, items in mod.kinds() do
|
||||
for kind, items, _, summary in mod.kinds() do
|
||||
local name = kind
|
||||
if kind == "Tables" then
|
||||
name = "Fields"
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
local value = {}
|
||||
value.kind = name
|
||||
value.summary = summary
|
||||
value.items = kinds[name]
|
||||
table.insert(kindsIpairs, value)
|
||||
end
|
||||
@@ -33,9 +34,16 @@
|
||||
|
||||
{% for i, value in ipairs(kindsIpairs) do
|
||||
local kind = value.kind
|
||||
local summary = value.summary
|
||||
local items = value.items
|
||||
%}
|
||||
<h1 class="title">{{kind}}</h1>
|
||||
<header class="section">
|
||||
<h1>{{kind}}</h1>
|
||||
{% if summary ~= nil then %}
|
||||
<div class="section-separator"></div>
|
||||
<h2>{* ldoc.markup(summary) *}</h2>
|
||||
{% end %}
|
||||
</header>
|
||||
|
||||
{% for item, _ in pairs(items) do %}
|
||||
<section class="method" id="{{item.name}}">
|
||||
|
||||
@@ -3,6 +3,26 @@
|
||||
local function isKindExpandable(kind)
|
||||
return kind ~= "Manual"
|
||||
end
|
||||
|
||||
local function isSectionEmpty(mod, sections)
|
||||
if type(sections) == "table" then
|
||||
for _, v in pairs(mod.items) do
|
||||
for _, section in pairs(sections) do
|
||||
if v.section_id == section then
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
local section = sections
|
||||
for _, v in pairs(mod.items) do
|
||||
if v.section_id == section then
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
%}
|
||||
|
||||
<nav>
|
||||
@@ -40,48 +60,42 @@ end
|
||||
end)
|
||||
end %}
|
||||
|
||||
{%
|
||||
local isThereFunctions = false
|
||||
for k, v in pairs(currentMod.items) do
|
||||
if (v.kind == "functions") then
|
||||
isThereFunctions = true
|
||||
break
|
||||
end
|
||||
end
|
||||
%}
|
||||
|
||||
{% if isThereFunctions then %}
|
||||
{% if not isSectionEmpty(currentMod, "function") then %}
|
||||
<li>
|
||||
<label class="colorful-label">FUNCTIONS</label>
|
||||
</li>
|
||||
{% end %}
|
||||
|
||||
{% for k, v in pairs(currentMod.items) do %}
|
||||
{% if (v.kind == "functions") then %}
|
||||
{% if (v.section_id == "function") then %}
|
||||
<li>
|
||||
{* ldoc.sidebar_item(v, currentMod) *}
|
||||
</li>
|
||||
{% end %}
|
||||
{% end %}
|
||||
|
||||
{%
|
||||
local isThereFields = false
|
||||
for k, v in pairs(currentMod.items) do
|
||||
if (v.kind == "fields" or v.kind == "tables") then
|
||||
isThereFields = true
|
||||
break
|
||||
end
|
||||
end
|
||||
%}
|
||||
|
||||
{% if isThereFields then %}
|
||||
{% if not isSectionEmpty(currentMod, {"field", "table"}) then %}
|
||||
<li>
|
||||
<label class="colorful-label">FIELDS</label>
|
||||
</li>
|
||||
{% end %}
|
||||
|
||||
{% for k, v in pairs(currentMod.items) do %}
|
||||
{% if (v.kind == "fields" or v.kind == "tables") then %}
|
||||
{% if (v.section_id == "field" or v.section_id == "table") then %}
|
||||
<li>
|
||||
{* ldoc.sidebar_item(v, currentMod) *}
|
||||
</li>
|
||||
{% end %}
|
||||
{% end %}
|
||||
|
||||
{% if not isSectionEmpty(currentMod, "hook") then %}
|
||||
<li>
|
||||
<label class="colorful-label">HOOKS</label>
|
||||
</li>
|
||||
{% end %}
|
||||
|
||||
{% for k, v in pairs(currentMod.items) do %}
|
||||
{% if (v.section_id == "hook") then %}
|
||||
<li>
|
||||
{* ldoc.sidebar_item(v, currentMod) *}
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user