diff --git a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Lua/LuaDocs.cs b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Lua/LuaDocs.cs index a889f5a65..291ad6cfc 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Lua/LuaDocs.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Lua/LuaDocs.cs @@ -284,7 +284,7 @@ local {type.Name} = {EMPTY_TABLE}"; lsb.Append(name); lsb.Append($", Field of type {returnName}\n"); lsb.Append($"-- @realm shared\n"); - lsb.Append($"-- @{returnName} {name}\n"); + lsb.Append($"-- @field {name}\n"); lsb.Append("\n"); sb.Append(lsb); @@ -312,7 +312,7 @@ local {type.Name} = {EMPTY_TABLE}"; lsb.Append(name); lsb.Append($", Field of type {returnName}\n"); lsb.Append($"-- @realm shared\n"); - lsb.Append($"-- @{returnName} {name}\n"); + lsb.Append($"-- @field {name}\n"); lsb.Append("\n"); sb.Append(lsb); diff --git a/luacs-docs/lua/baseluadocs/Character.lua b/luacs-docs/lua/baseluadocs/Character.lua index b20ec5b22..111b5de7e 100644 --- a/luacs-docs/lua/baseluadocs/Character.lua +++ b/luacs-docs/lua/baseluadocs/Character.lua @@ -41,4 +41,4 @@ function TeleportTo(worldPos) end --- -- Character.CharacterList, Table containing all characters. -- @realm shared --- @table Character.CharacterList +-- @field Character.CharacterList diff --git a/luacs-docs/lua/templates/module.ltp b/luacs-docs/lua/templates/module.ltp index ad19c7f95..c8f7582d4 100644 --- a/luacs-docs/lua/templates/module.ltp +++ b/luacs-docs/lua/templates/module.ltp @@ -6,37 +6,7 @@

{* ldoc.markup(mod.description) *}

-{% - local kinds = {} - local kindsIpairs = {} - for kind, items, _, summary in mod.kinds() do - local name = kind - if kind == "Tables" then - name = "Fields" - end - - for item in items() do - if kinds[name] == nil then - kinds[name] = {} - - local value = {} - value.kind = name - value.summary = summary - value.items = kinds[name] - table.insert(kindsIpairs, value) - end - kinds[name][item] = true - end - end - - -%} - -{% for i, value in ipairs(kindsIpairs) do - local kind = value.kind - local summary = value.summary - local items = value.items -%} +{% for kind, items, _, summary in mod.kinds() do %}

{{kind}}

{% if summary ~= nil then %} @@ -45,7 +15,7 @@ {% end %}
- {% for item, _ in pairs(items) do %} + {% for item in items() do %}
{* ldoc.item_header(item) *} diff --git a/luacs-docs/lua/templates/sidebar.ltp b/luacs-docs/lua/templates/sidebar.ltp index ff9c44aa9..aec7570c7 100644 --- a/luacs-docs/lua/templates/sidebar.ltp +++ b/luacs-docs/lua/templates/sidebar.ltp @@ -74,14 +74,28 @@ end {% end %} {% end %} - {% if not isSectionEmpty(currentMod, {"field", "table"}) then %} + {% if not isSectionEmpty(currentMod, "table") then %} +
  • + +
  • + {% end %} + + {% for k, v in pairs(currentMod.items) do %} + {% if (v.section_id == "table") then %} +
  • + {* ldoc.sidebar_item(v, currentMod) *} +
  • + {% end %} + {% end %} + + {% if not isSectionEmpty(currentMod, "field") then %}
  • {% end %} {% for k, v in pairs(currentMod.items) do %} - {% if (v.section_id == "field" or v.section_id == "table") then %} + {% if (v.section_id == "field") then %}
  • {* ldoc.sidebar_item(v, currentMod) *}