Don't conflate fields with tables

This commit is contained in:
peelz
2022-08-03 21:34:42 -04:00
parent 512b95d89c
commit 2f5add1999
4 changed files with 21 additions and 37 deletions

View File

@@ -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);

View File

@@ -41,4 +41,4 @@ function TeleportTo(worldPos) end
---
-- Character.CharacterList, Table containing all characters.
-- @realm shared
-- @table Character.CharacterList
-- @field Character.CharacterList

View File

@@ -6,37 +6,7 @@
<p>{* ldoc.markup(mod.description) *}</p>
{%
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 %}
<header class="section">
<h1>{{kind}}</h1>
{% if summary ~= nil then %}
@@ -45,7 +15,7 @@
{% end %}
</header>
{% for item, _ in pairs(items) do %}
{% for item in items() do %}
<section class="method" id="{{item.name}}">
<header>
{* ldoc.item_header(item) *}

View File

@@ -74,14 +74,28 @@ end
{% end %}
{% end %}
{% if not isSectionEmpty(currentMod, {"field", "table"}) then %}
{% if not isSectionEmpty(currentMod, "table") then %}
<li>
<label class="colorful-label">TABLES</label>
</li>
{% end %}
{% for k, v in pairs(currentMod.items) do %}
{% if (v.section_id == "table") then %}
<li>
{* ldoc.sidebar_item(v, currentMod) *}
</li>
{% end %}
{% end %}
{% if not isSectionEmpty(currentMod, "field") then %}
<li>
<label class="colorful-label">FIELDS</label>
</li>
{% 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 %}
<li>
{* ldoc.sidebar_item(v, currentMod) *}
</li>