diff --git a/.gitmodules b/.gitmodules index 568b2ac40..7717574dc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,4 +3,4 @@ url = https://github.com/evilfactory/moonsharp.git [submodule "luacs-docs/lua/libs/ldoc"] path = luacs-docs/lua/libs/ldoc - url = https://github.com/impulsh/LDoc.git + url = https://github.com/evilfactory/LDoc.git diff --git a/luacs-docs/lua/css/ldoc.css b/luacs-docs/lua/css/ldoc.css index 122b60cc8..29c99dddb 100644 --- a/luacs-docs/lua/css/ldoc.css +++ b/luacs-docs/lua/css/ldoc.css @@ -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; } diff --git a/luacs-docs/lua/libs/ldoc b/luacs-docs/lua/libs/ldoc index 69ef8c976..d1d4e3700 160000 --- a/luacs-docs/lua/libs/ldoc +++ b/luacs-docs/lua/libs/ldoc @@ -1 +1 @@ -Subproject commit 69ef8c976e3ac94146f87e99c8885211128a1c13 +Subproject commit d1d4e3700ad0de2e74a5aa350a73af2fb19a071b diff --git a/luacs-docs/lua/lua/Hooks.lua b/luacs-docs/lua/lua/Hooks.lua index 7b916d761..d282e23c7 100644 --- a/luacs-docs/lua/lua/Hooks.lua +++ b/luacs-docs/lua/lua/Hooks.lua @@ -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 \ No newline at end of file +function human.CPRFailed(animController) end diff --git a/luacs-docs/lua/templates/module.ltp b/luacs-docs/lua/templates/module.ltp index 17055615c..ad19c7f95 100644 --- a/luacs-docs/lua/templates/module.ltp +++ b/luacs-docs/lua/templates/module.ltp @@ -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 %} -

{{kind}}

+
+

{{kind}}

+ {% if summary ~= nil then %} +
+

{* ldoc.markup(summary) *}

+ {% end %} +
{% for item, _ in pairs(items) do %}
diff --git a/luacs-docs/lua/templates/sidebar.ltp b/luacs-docs/lua/templates/sidebar.ltp index 17b305563..ff9c44aa9 100644 --- a/luacs-docs/lua/templates/sidebar.ltp +++ b/luacs-docs/lua/templates/sidebar.ltp @@ -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 %}